diff --git a/CMakeLists.txt b/CMakeLists.txt index d4431bc..528514c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,8 @@ endif() set(_COMPANY SHS) set(_DOMAIN org.SHS) include_directories(${CMAKE_CURRENT_BINARY_DIR}/pip) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/qad) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/piqt) if(MINGW) find_package(MinGW REQUIRED) else() @@ -115,6 +117,7 @@ if(WIN32) endif() set(QAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qad) +set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) if (CROSSTOOLS) @@ -154,9 +157,10 @@ else() message(STATUS "Building Qt-derived targets for ${QtVersions}") add_subdirectory(qad) include_directories(${qad_includes}) - set(_DIRS piqt piqt_utils qcd_utils) + add_subdirectory(piqt) + include_directories(${piqt_includes}) + set(_DIRS) if (Qt5) - list(APPEND _DIRS) if (QGLVIEW) list(APPEND _DIRS qglview) endif() @@ -166,16 +170,11 @@ else() endif() foreach(_D ${_DIRS}) list(APPEND QT_MULTILIB_LIST ${_D}) + add_subdirectory(${_D}) endforeach(_D) - include_directories(piqt) else() message(STATUS "None of Qt found, skip Qt-derived targets") endif() - include_directories(cd_utils) - list(INSERT _DIRS 0 cd_utils) - foreach(_D ${_DIRS}) - add_subdirectory(${_D}) - endforeach(_D) endif() diff --git a/SDKMacros.cmake b/SDKMacros.cmake index 77db2e1..2e933e0 100644 --- a/SDKMacros.cmake +++ b/SDKMacros.cmake @@ -1,35 +1,96 @@ -macro(sdk_install _DIR _TARGET _H_FILES _QM_FILES) +macro(sdk_install _DIR IS_APP _TARGET _H_FILES _QM_FILES) #message("QM=${_QM_FILES}") if(LIB) if(WIN32) - if(NOT "x${_H_FILES}" STREQUAL "x") - install(FILES ${_H_FILES} DESTINATION ${MINGW_INCLUDE}/${_DIR}) + if (${IS_APP}) + qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_BIN}) + qt_install(TARGETS ${_TARGET} DESTINATION QtBin) + else() + if(NOT "x${_H_FILES}" STREQUAL "x") + install(FILES ${_H_FILES} DESTINATION ${MINGW_INCLUDE}/${_DIR}) + endif() + qt_install(TARGETS ${_TARGET} ARCHIVE DESTINATION ${MINGW_LIB}) + qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION ${MINGW_BIN}) + qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION QtBin) endif() - qt_install(TARGETS ${_TARGET} ARCHIVE DESTINATION ${MINGW_LIB}) - qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION ${MINGW_BIN}) - qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION QtBin) else() - if (NOT "x${_H_FILES}" STREQUAL "x") - install(FILES ${_H_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${_DIR}) + if (${IS_APP}) + qt_install(TARGETS ${_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + else() + if (NOT "x${_H_FILES}" STREQUAL "x") + install(FILES ${_H_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${_DIR}) + endif() + qt_install(TARGETS ${_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) endif() - qt_install(TARGETS ${_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) endif() if(NOT "x${_QM_FILES}" STREQUAL "x") qt_install(LANG ${_QM_FILES} DESTINATION QtLang) endif() else() - if(NOT "x${_H_FILES}" STREQUAL "x") - install(FILES ${_H_FILES} DESTINATION include/${_DIR}) - endif() - if(WIN32) - qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION bin) - qt_install(TARGETS ${_TARGET} ARCHIVE DESTINATION lib) + if(${IS_APP}) + qt_install(TARGETS ${_TARGET} DESTINATION bin) else() - qt_install(TARGETS ${_TARGET} DESTINATION lib) + if(NOT "x${_H_FILES}" STREQUAL "x") + install(FILES ${_H_FILES} DESTINATION include/${_DIR}) + endif() + if(WIN32) + qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION bin) + qt_install(TARGETS ${_TARGET} ARCHIVE DESTINATION lib) + else() + qt_install(TARGETS ${_TARGET} DESTINATION lib) + endif() endif() if(NOT "x${_QM_FILES}" STREQUAL "x") qt_install(LANG ${_QM_FILES} DESTINATION lang) endif() endif() endmacro() + + +macro(add_directories_with_include multilib_prefix) + set(DIRS) + file(GLOB _dl "[^.]*") + foreach(_d ${_dl}) + if(IS_DIRECTORY ${_d}) + list(APPEND DIRS ${_d}) + endif() + endforeach() + + set(inc_var ${multilib_prefix}includes) + set(${inc_var}) + foreach(_d ${DIRS}) + get_filename_component(_dname "${_d}" NAME) + list(APPEND QT_MULTILIB_LIST ${multilib_prefix}${_dname}) + list(APPEND ${inc_var} "${_d}") + endforeach() + + foreach(_d ${DIRS}) + include_directories(${_d}) + endforeach() + foreach(_d ${DIRS}) + add_subdirectory(${_d}) + endforeach() + + set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) + set(${inc_var} ${${inc_var}} PARENT_SCOPE) + if (LIB) + set(_ALL_TARGETS ${_ALL_TARGETS} PARENT_SCOPE) + endif() +endmacro() + + +macro(add_directories multilib_prefix) + include_directories(${${multilib_prefix}includes}) + file(GLOB _dl "[^.]*") + foreach(_d ${_dl}) + if(IS_DIRECTORY ${_d}) + add_subdirectory(${_d}) + endif() + endforeach() + + if (LIB) + set(_ALL_TARGETS ${_ALL_TARGETS} PARENT_SCOPE) + endif() +endmacro() + diff --git a/android.toolchain.cmake.add b/android.toolchain.cmake.add deleted file mode 100644 index 58617f7..0000000 --- a/android.toolchain.cmake.add +++ /dev/null @@ -1,6 +0,0 @@ -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY FIRST) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE FIRST) -set(CMAKE_PREFIX_PATH /soft/android/${ANDROID_ABI}) -list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_PREFIX_PATH}/lib) -include_directories(${CMAKE_PREFIX_PATH}/include) diff --git a/cd_utils/CMakeLists.txt b/cd_utils/CMakeLists.txt index c58b05e..9ac1c9b 100644 --- a/cd_utils/CMakeLists.txt +++ b/cd_utils/CMakeLists.txt @@ -1,67 +1,16 @@ cmake_minimum_required(VERSION 3.0) project(cd_utils) -if (NOT LIBPROJECT) - find_package(PIP REQUIRED) - option(LIB "System install" 1) - option(DEBUG "Build with -g3" 0) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall") - if (DEBUG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") - endif() -endif() -if (MINGW) - find_package(MinGW REQUIRED) -endif() +find_package(MinGW REQUIRED) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${PIP_INCLUDES}) -#file(GLOB HDRS_UTILS "*.h") -#file(GLOB CPPS_UTILS "*.cpp") file(GLOB CPPS_UTILS "cdutils_*.cpp") file(GLOB HDRS_UTILS "cdutils_*.h") -if (DEFINED ENV{QNX_HOST}) - add_library(${PROJECT_NAME} STATIC ${CPPS_UTILS} ${HDRS_UTILS}) -else() - add_library(${PROJECT_NAME} SHARED ${CPPS_UTILS} ${HDRS_UTILS}) -endif() +add_library(${PROJECT_NAME} SHARED ${CPPS_UTILS} ${HDRS_UTILS}) target_link_libraries(${PROJECT_NAME} ${PIP_LIBRARY}) -# # Apple crosscompiling rpath patch -# if (APPLE AND CMAKE_CROSSCOMPILING AND CMAKE_MACOSX_RPATH) - # foreach(_RP ${CMAKE_INSTALL_RPATH}) - # add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD - # COMMAND "${CMAKE_INSTALL_NAME_TOOL}" - # "-add_rpath" "${_RP}" - # "$/$" - # COMMENT "Add to ${PROJECT_NAME} rpath \"${_RP}\"") - # endforeach() -# endif() - add_executable(cdutilstest "cdutilstest.cpp" "cdtest.h") target_link_libraries(cdutilstest ${PIP_LIBRARY} ${PROJECT_NAME}) message(STATUS "Building ${PROJECT_NAME}") -if(NOT LIBPROJECT) - if(LIB) - if(WIN32) - if(MINGW) - set(CMAKE_INSTALL_PREFIX ${MINGW_DIR}) - endif() - else() - if (DEFINED ANDROID_PLATFORM) - set(CMAKE_INSTALL_PREFIX ${ANDROID_SYSTEM_LIBRARY_PATH}/usr) - else() - if(CMAKE_CROSSCOMPILING) - set(CMAKE_INSTALL_PREFIX ${CMAKE_STAGING_PREFIX}) - else() - set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX}/usr/local) - endif() - endif() - endif() - message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") - else() - message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"") - endif() -endif() - if(LIB) list(APPEND _ALL_TARGETS ${PROJECT_NAME}) set(_ALL_TARGETS ${_ALL_TARGETS} PARENT_SCOPE) diff --git a/pip b/pip index ccd6a98..fec6829 160000 --- a/pip +++ b/pip @@ -1 +1 @@ -Subproject commit ccd6a9888f0b77834fd01dd278f2f1022fa6db58 +Subproject commit fec68299c17f9e66f6a7cf88e171c490b44b8031 diff --git a/piqt/CMakeLists.txt b/piqt/CMakeLists.txt index ca1c9a8..27028b2 100644 --- a/piqt/CMakeLists.txt +++ b/piqt/CMakeLists.txt @@ -1,49 +1,50 @@ cmake_minimum_required(VERSION 3.0) -project(piqt) -if(NOT LIBPROJECT) - find_package(PIP REQUIRED) - option(LIB "System install" 0) - option(DEBUG "Build with -g3" 0) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall") - if(DEBUG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") - endif() +cmake_policy(SET CMP0017 NEW) # need include() with .cmake +set(_PIQt_MAJOR 1) +set(_PIQt_MINOR 0) +set(_PIQt_REVISION 0) +set(_PIQt_SUFFIX ) +set(_PIQt_COMPANY SHS) +set(_PIQt_DOMAIN org.SHS) +if(NOT DEFINED BUILD_NUMBER) + set(BUILD_NUMBER 9999) endif() -find_package(QAD REQUIRED) -list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME}) +set(PIQt_LIB_TYPE SHARED) + +set(QAD_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/piqt_version.h") +set_version(PIQt + MAJOR "${_PIQt_MAJOR}" + MINOR "${_PIQt_MINOR}" + REVISION "${_PIQt_REVISION}" + BUILD "${BUILD_NUMBER}" + SUFFIX "${_PIQt_SUFFIX}" + OUTPUT "${PIQt_VERSION_FILE}") +set_deploy_property(PIQt ${_PIQt_LIB_TYPE} + FULLNAME "${_PIQt_DOMAIN}.*" + COMPANY "${_PIQt_COMPANY}") + +include(QADMacros) + +macro(piqt_library NAME _MODULES _LIBS) + _qt_project(${NAME} FALSE "PIQt" "${_MODULES}" "pip;${_LIBS}" ${ARGN}) + _qt_install(${NAME} FALSE "pip" "out_HDR" "out_QM") +endmacro() + +macro(piqt_application NAME _MODULES _LIBS) + _qt_project(${NAME} TRUE "PIQt" "${_MODULES}" "pip;${_LIBS}" ${ARGN}) + _qt_install(${NAME} TRUE "pip" "" "out_QM") +endmacro() + + +include_directories(${PIP_INCLUDES}) +add_subdirectory(libs) +if (UTILS) + add_subdirectory(utils) +endif() + set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) -include_directories(${PIP_INCLUDES} ${QAD_INCLUDES}) -file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") -find_qt(${QtVersions} Core Gui Positioning) -qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) -qt_add_library(${PROJECT_NAME} SHARED out_CPP) -qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets) -message(STATUS "Building ${PROJECT_NAME}") -if(LIBPROJECT) - sdk_install("pip" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}") -else() - if(LIB) - if(WIN32) - install(FILES ${out_HDR} DESTINATION ${MINGW_INCLUDE}/pip) - if(NOT "x${out_QM}" STREQUAL "x") - qt_install(FILES ${out_QM} DESTINATION QtLang) - endif() - qt_install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${MINGW_LIB}) - qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${MINGW_BIN}) - qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtBin) - else() - install(FILES ${out_HDR} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/pip) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) - endif() - message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") - else() - if(WIN32) - qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) - qt_install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib) - else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION lib) - endif() - install(FILES ${out_HDR} DESTINATION include/pip) - message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"") - endif() +set(piqt_includes ${piqt_includes} PARENT_SCOPE) +if (LIB) + set(_ALL_TARGETS ${_ALL_TARGETS} PARENT_SCOPE) endif() + diff --git a/piqt/libs/CMakeLists.txt b/piqt/libs/CMakeLists.txt new file mode 100644 index 0000000..c20718c --- /dev/null +++ b/piqt/libs/CMakeLists.txt @@ -0,0 +1 @@ +add_directories_with_include("piqt_") diff --git a/piqt/libs/core/CMakeLists.txt b/piqt/libs/core/CMakeLists.txt new file mode 100644 index 0000000..fc48469 --- /dev/null +++ b/piqt/libs/core/CMakeLists.txt @@ -0,0 +1 @@ +piqt_library(piqt "Gui;Positioning" "qad_utils;qad_widgets") diff --git a/piqt/piqt.cpp b/piqt/libs/core/piqt.cpp similarity index 100% rename from piqt/piqt.cpp rename to piqt/libs/core/piqt.cpp diff --git a/piqt/piqt.h b/piqt/libs/core/piqt.h similarity index 100% rename from piqt/piqt.h rename to piqt/libs/core/piqt.h diff --git a/piqt/libs/qcd/CMakeLists.txt b/piqt/libs/qcd/CMakeLists.txt new file mode 100644 index 0000000..f3e84e8 --- /dev/null +++ b/piqt/libs/qcd/CMakeLists.txt @@ -0,0 +1 @@ +piqt_library(qcd_utils "Gui" "pip;qad_utils;qad_widgets;qad_graphic;cd_utils;piqt") diff --git a/qcd_utils/qcd_core.cpp b/piqt/libs/qcd/qcd_core.cpp similarity index 96% rename from qcd_utils/qcd_core.cpp rename to piqt/libs/qcd/qcd_core.cpp index c77e70e..95511a8 100644 --- a/qcd_utils/qcd_core.cpp +++ b/piqt/libs/qcd/qcd_core.cpp @@ -1,297 +1,297 @@ -#include "qcd_core.h" -#include "cdutils_k.h" -#include "cdutils_core.h" -#include "piqt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace CDUtils; - - -int __QCore_Initializer__::count_(0); -QCDCore * __QCore_Initializer__::__instance__(0); - - -__QCore_Initializer__::__QCore_Initializer__() { - count_++; - if (count_ > 1) return; - __instance__ = new QCDCore(); -} - - -__QCore_Initializer__::~__QCore_Initializer__() { - count_--; - if (count_ > 0) return; - if (__instance__ != 0) { - delete __instance__; - __instance__ = 0; - } -} - - - - -QCDCore::QCDCore() { - setObjectName("QCDCore"); - setName("QCDCore"); - CONNECTU(&K, changedGlobal, this, K_ChangedGlobal); - updating = direct_on = false; -} - - -QCDCore::~QCDCore() { -} - - -void QCDCore::K_ChangedGlobal() { - QMetaObject::invokeMethod(this, "updateBindedWidgets", Qt::QueuedConnection); -} - - -void QCDCore::slotBool(bool v) { - QWidget * w = (QWidget*)sender(); - if (!w || updating) return; - QList > pathes = binded_widgets.values(w); - foreach (const PIDeque & path, pathes) - K[path].setValue(PIString::fromBool(v)); - K.calculate(); - emit updateViewRequest(); -} - - -void QCDCore::slotInt(int v) { - QWidget * w = (QWidget*)sender(); - if (!w || updating) return; - QList > pathes = binded_widgets.values(w); - foreach (const PIDeque & path, pathes) - K[path].setValue(PIString::fromNumber(v)); - finishEdit(pathes); -} - - -void QCDCore::slotDouble(double v) { - QWidget * w = (QWidget*)sender(); - if (!w || updating) return; - QList > pathes = binded_widgets.values(w); - foreach (const PIDeque & path, pathes) - K[path].setValue(PIString::fromNumber(v)); - finishEdit(pathes); -} - - -void QCDCore::slotText(QString v) { - QWidget * w = (QWidget*)sender(); - if (!w || updating) return; - QList > pathes = binded_widgets.values(w); - foreach (const PIDeque & path, pathes) - K[path].setValue(Q2PIString(v)); - finishEdit(pathes); -} - - -void QCDCore::slotVariant(QVariant v) { - QWidget * w = (QWidget*)sender(); - if (!w || updating) return; - QList > pathes = binded_widgets.values(w); - foreach (const PIDeque & path, pathes) - K[path].setVariantValue(Q2PIVariant(v)); - finishEdit(pathes); -} - - -void QCDCore::slotDestroyed(QObject * o) { - if (!o) return; - if (!binded_widgets.contains((QWidget*)o)) return; - binded_widgets.remove((QWidget*)o); -} - - -int QCDCore::bindWindow(QWidget * wnd) { - if (!wnd) return 0; - //K.root().makePath(); - return bindWidgets(wnd->findChildren()); -} - - -int QCDCore::bindWidgets(QList wl) { - int ret = 0; - foreach (QWidget * w, wl) - if (bindWidget(w)) ++ret; - return ret; -} - - -bool QCDCore::bindWidget(QWidget * w) { - if (!w) return false; - QString on = w->objectName(); - QString cn = w->metaObject()->className(); - if (cn == "CDView") { - bindView(w); - return false; - } - PIVector ak = K.root().children(); - piForeachC (CDType * k, ak) { - if (!on.endsWith(PI2QString(k->pathString().join("_")))) continue; - if (bindWidget(w, *k)) return true; - } - return false; -} - - -bool QCDCore::bindWidget(QWidget * w, const CDType & k) { - if (!w) return false; - //piCout << "bind..." << k.name() << k.path(); - QString cn = w->metaObject()->className(); - bool ok = false; - if (cn == "QCheckBox" || cn == "QGroupBox") { - connect(w, SIGNAL(toggled(bool)), this, SLOT(slotBool(bool)), Qt::UniqueConnection); - ok = true; - } - if (cn == "QSpinBox" || cn == "QSlider" || cn == "QScrollBar") { - connect(w, SIGNAL(valueChanged(int)), this, SLOT(slotInt(int)), Qt::UniqueConnection); - ok = true; - } - if (cn == "QDoubleSpinBox" || cn == "SpinSlider" || cn == "EvalSpinBox") { - connect(w, SIGNAL(valueChanged(double)), this, SLOT(slotDouble(double)), Qt::UniqueConnection); - ok = true; - } - if (cn == "QLineEdit" || cn == "CLineEdit") { - connect(w, SIGNAL(textChanged(QString)), this, SLOT(slotText(QString)), Qt::UniqueConnection); - ok = true; - } - if (cn == "QVariantEdit") { - connect(w, SIGNAL(valueChanged(QVariant)), this, SLOT(slotVariant(QVariant)), Qt::UniqueConnection); - ok = true; - } - if (cn == "CDView") { - bindView(w); - } - connect(w, SIGNAL(destroyed(QObject*)), this, SLOT(slotDestroyed(QObject*)), Qt::UniqueConnection); - setWidgetValue(w, k); - if (!ok) return false; - //piCout << k.name() << k.path() << "ok"; - binded_widgets.insert(w, k.path()); - return true; -} - - -void QCDCore::updateBindedWidgets() { - QMapIterator > it(binded_widgets); - QWidgetList to_remove; - updating = true; - while (it.hasNext()) { - QWidget * w = it.next().key(); - if (!K.exists(it.value())) - to_remove << w; - else - setWidgetValue(w, K[it.value()]); - } - foreach (QWidget * w, to_remove) - unbindWidget(w); - updating = false; -} - - -void QCDCore::bindView(QWidget * v) { - CDView * w = qobject_cast(v); - if (!w) return; - connect(this, SIGNAL(updateViewRequest()), w, SLOT(refreshValues()), Qt::UniqueConnection); -} - - -void QCDCore::setWidgetValue(QWidget * w, const CDType & k) { - if (!w) return; - QString cn = w->metaObject()->className(); - if (cn == "QCheckBox") qobject_cast(w)->setChecked(k.toBool()); - if (cn == "QGroupBox") qobject_cast(w)->setChecked(k.toBool()); - if (cn == "QSpinBox") qobject_cast(w)->setValue(k.toInt()); - if (cn == "QSlider") qobject_cast(w)->setValue(k.toInt()); - if (cn == "QScrollBar") qobject_cast(w)->setValue(k.toInt()); - if (cn == "QDoubleSpinBox") qobject_cast(w)->setValue(k.toDouble()); - if (cn == "SpinSlider") qobject_cast(w)->setValue(k.toDouble()); - if (cn == "QLineEdit") qobject_cast(w)->setText(PI2QString(k.value())); - if (cn == "CLineEdit") qobject_cast(w)->setText(PI2QString(k.value())); - if (cn == "EvalSpinBox") qobject_cast(w)->setValue(k.toDouble()); - if (cn == "QVariantEdit") qobject_cast(w)->setValue(PI2QVariant(k.variantValue())); -} - - -void QCDCore::finishEdit(const QList > & pathes) { - K.calculate(); - if (direct_on) { - foreach (const PIDeque & path, pathes) - K.directChange(K[path]); - } - emit updateViewRequest(); -} - - -int QCDCore::unbindWindow(QWidget * wnd) { - if (!wnd) return 0; - return unbindWidgets(wnd->findChildren()); -} - - -int QCDCore::unbindWidgets(QList wl) { - int ret = 0; - foreach (QWidget * w, wl) - if (unbindWidget(w)) ++ret; - return ret; -} - - -bool QCDCore::unbindWidget(QWidget * w) { - if (!w) return false; - //qDebug() << "unbind" << w; - if (!binded_widgets.contains(w)) return false; - QString cn = w->metaObject()->className(); - if (cn == "QCheckBox" || cn == "QGroupBox") - disconnect(w, SIGNAL(toggled(bool)), this, SLOT(slotBool(bool))); - if (cn == "QSpinBox" || cn == "QSlider" || cn == "QScrollBar") - disconnect(w, SIGNAL(valueChanged(int)), this, SLOT(slotInt(int))); - if (cn == "QDoubleSpinBox" || cn == "SpinSlider" || cn == "EvalSpinBox") - disconnect(w, SIGNAL(valueChanged(double)), this, SLOT(slotDouble(double))); - if (cn == "QLineEdit" || cn == "CLineEdit") - disconnect(w, SIGNAL(textChanged(QString)), this, SLOT(slotText(QString))); - if (cn == "QVariantEdit") - disconnect(w, SIGNAL(valueChanged(QVariant)), this, SLOT(slotVariant(QVariant))); - //qDebug() << "remove b" << binded_widgets.size(); - binded_widgets.remove(w); - //qDebug() << "remove a" << binded_widgets.size(); - return true; -} - - -void QCDCore::unbindAllWidgets() { - QMap > bwm = binded_widgets; - QMapIterator > it(bwm); - while (it.hasNext()) { - QWidget * w = it.next().key(); - unbindWidget(w); - } - binded_widgets.clear(); -} - - -void QCDCore::updateBindedWidget(const CDType & k_) { - QMapIterator > it(binded_widgets); - updating = true; - while (it.hasNext()) { - QWidget * w = it.next().key(); - const CDType & k(K[it.value()]); - if (k.path() != k_.path()) continue; - setWidgetValue(w, k); - } - updating = false; -} +#include "qcd_core.h" +#include "cdutils_k.h" +#include "cdutils_core.h" +#include "piqt.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace CDUtils; + + +int __QCore_Initializer__::count_(0); +QCDCore * __QCore_Initializer__::__instance__(0); + + +__QCore_Initializer__::__QCore_Initializer__() { + count_++; + if (count_ > 1) return; + __instance__ = new QCDCore(); +} + + +__QCore_Initializer__::~__QCore_Initializer__() { + count_--; + if (count_ > 0) return; + if (__instance__ != 0) { + delete __instance__; + __instance__ = 0; + } +} + + + + +QCDCore::QCDCore() { + setObjectName("QCDCore"); + setName("QCDCore"); + CONNECTU(&K, changedGlobal, this, K_ChangedGlobal); + updating = direct_on = false; +} + + +QCDCore::~QCDCore() { +} + + +void QCDCore::K_ChangedGlobal() { + QMetaObject::invokeMethod(this, "updateBindedWidgets", Qt::QueuedConnection); +} + + +void QCDCore::slotBool(bool v) { + QWidget * w = (QWidget*)sender(); + if (!w || updating) return; + QList > pathes = binded_widgets.values(w); + foreach (const PIDeque & path, pathes) + K[path].setValue(PIString::fromBool(v)); + K.calculate(); + emit updateViewRequest(); +} + + +void QCDCore::slotInt(int v) { + QWidget * w = (QWidget*)sender(); + if (!w || updating) return; + QList > pathes = binded_widgets.values(w); + foreach (const PIDeque & path, pathes) + K[path].setValue(PIString::fromNumber(v)); + finishEdit(pathes); +} + + +void QCDCore::slotDouble(double v) { + QWidget * w = (QWidget*)sender(); + if (!w || updating) return; + QList > pathes = binded_widgets.values(w); + foreach (const PIDeque & path, pathes) + K[path].setValue(PIString::fromNumber(v)); + finishEdit(pathes); +} + + +void QCDCore::slotText(QString v) { + QWidget * w = (QWidget*)sender(); + if (!w || updating) return; + QList > pathes = binded_widgets.values(w); + foreach (const PIDeque & path, pathes) + K[path].setValue(Q2PIString(v)); + finishEdit(pathes); +} + + +void QCDCore::slotVariant(QVariant v) { + QWidget * w = (QWidget*)sender(); + if (!w || updating) return; + QList > pathes = binded_widgets.values(w); + foreach (const PIDeque & path, pathes) + K[path].setVariantValue(Q2PIVariant(v)); + finishEdit(pathes); +} + + +void QCDCore::slotDestroyed(QObject * o) { + if (!o) return; + if (!binded_widgets.contains((QWidget*)o)) return; + binded_widgets.remove((QWidget*)o); +} + + +int QCDCore::bindWindow(QWidget * wnd) { + if (!wnd) return 0; + //K.root().makePath(); + return bindWidgets(wnd->findChildren()); +} + + +int QCDCore::bindWidgets(QList wl) { + int ret = 0; + foreach (QWidget * w, wl) + if (bindWidget(w)) ++ret; + return ret; +} + + +bool QCDCore::bindWidget(QWidget * w) { + if (!w) return false; + QString on = w->objectName(); + QString cn = w->metaObject()->className(); + if (cn == "CDView") { + bindView(w); + return false; + } + PIVector ak = K.root().children(); + piForeachC (CDType * k, ak) { + if (!on.endsWith(PI2QString(k->pathString().join("_")))) continue; + if (bindWidget(w, *k)) return true; + } + return false; +} + + +bool QCDCore::bindWidget(QWidget * w, const CDType & k) { + if (!w) return false; + //piCout << "bind..." << k.name() << k.path(); + QString cn = w->metaObject()->className(); + bool ok = false; + if (cn == "QCheckBox" || cn == "QGroupBox") { + connect(w, SIGNAL(toggled(bool)), this, SLOT(slotBool(bool)), Qt::UniqueConnection); + ok = true; + } + if (cn == "QSpinBox" || cn == "QSlider" || cn == "QScrollBar") { + connect(w, SIGNAL(valueChanged(int)), this, SLOT(slotInt(int)), Qt::UniqueConnection); + ok = true; + } + if (cn == "QDoubleSpinBox" || cn == "SpinSlider" || cn == "EvalSpinBox") { + connect(w, SIGNAL(valueChanged(double)), this, SLOT(slotDouble(double)), Qt::UniqueConnection); + ok = true; + } + if (cn == "QLineEdit" || cn == "CLineEdit") { + connect(w, SIGNAL(textChanged(QString)), this, SLOT(slotText(QString)), Qt::UniqueConnection); + ok = true; + } + if (cn == "QVariantEdit") { + connect(w, SIGNAL(valueChanged(QVariant)), this, SLOT(slotVariant(QVariant)), Qt::UniqueConnection); + ok = true; + } + if (cn == "CDView") { + bindView(w); + } + connect(w, SIGNAL(destroyed(QObject*)), this, SLOT(slotDestroyed(QObject*)), Qt::UniqueConnection); + setWidgetValue(w, k); + if (!ok) return false; + //piCout << k.name() << k.path() << "ok"; + binded_widgets.insert(w, k.path()); + return true; +} + + +void QCDCore::updateBindedWidgets() { + QMapIterator > it(binded_widgets); + QWidgetList to_remove; + updating = true; + while (it.hasNext()) { + QWidget * w = it.next().key(); + if (!K.exists(it.value())) + to_remove << w; + else + setWidgetValue(w, K[it.value()]); + } + foreach (QWidget * w, to_remove) + unbindWidget(w); + updating = false; +} + + +void QCDCore::bindView(QWidget * v) { + CDView * w = qobject_cast(v); + if (!w) return; + connect(this, SIGNAL(updateViewRequest()), w, SLOT(refreshValues()), Qt::UniqueConnection); +} + + +void QCDCore::setWidgetValue(QWidget * w, const CDType & k) { + if (!w) return; + QString cn = w->metaObject()->className(); + if (cn == "QCheckBox") qobject_cast(w)->setChecked(k.toBool()); + if (cn == "QGroupBox") qobject_cast(w)->setChecked(k.toBool()); + if (cn == "QSpinBox") qobject_cast(w)->setValue(k.toInt()); + if (cn == "QSlider") qobject_cast(w)->setValue(k.toInt()); + if (cn == "QScrollBar") qobject_cast(w)->setValue(k.toInt()); + if (cn == "QDoubleSpinBox") qobject_cast(w)->setValue(k.toDouble()); + if (cn == "SpinSlider") qobject_cast(w)->setValue(k.toDouble()); + if (cn == "QLineEdit") qobject_cast(w)->setText(PI2QString(k.value())); + if (cn == "CLineEdit") qobject_cast(w)->setText(PI2QString(k.value())); + if (cn == "EvalSpinBox") qobject_cast(w)->setValue(k.toDouble()); + if (cn == "QVariantEdit") qobject_cast(w)->setValue(PI2QVariant(k.variantValue())); +} + + +void QCDCore::finishEdit(const QList > & pathes) { + K.calculate(); + if (direct_on) { + foreach (const PIDeque & path, pathes) + K.directChange(K[path]); + } + emit updateViewRequest(); +} + + +int QCDCore::unbindWindow(QWidget * wnd) { + if (!wnd) return 0; + return unbindWidgets(wnd->findChildren()); +} + + +int QCDCore::unbindWidgets(QList wl) { + int ret = 0; + foreach (QWidget * w, wl) + if (unbindWidget(w)) ++ret; + return ret; +} + + +bool QCDCore::unbindWidget(QWidget * w) { + if (!w) return false; + //qDebug() << "unbind" << w; + if (!binded_widgets.contains(w)) return false; + QString cn = w->metaObject()->className(); + if (cn == "QCheckBox" || cn == "QGroupBox") + disconnect(w, SIGNAL(toggled(bool)), this, SLOT(slotBool(bool))); + if (cn == "QSpinBox" || cn == "QSlider" || cn == "QScrollBar") + disconnect(w, SIGNAL(valueChanged(int)), this, SLOT(slotInt(int))); + if (cn == "QDoubleSpinBox" || cn == "SpinSlider" || cn == "EvalSpinBox") + disconnect(w, SIGNAL(valueChanged(double)), this, SLOT(slotDouble(double))); + if (cn == "QLineEdit" || cn == "CLineEdit") + disconnect(w, SIGNAL(textChanged(QString)), this, SLOT(slotText(QString))); + if (cn == "QVariantEdit") + disconnect(w, SIGNAL(valueChanged(QVariant)), this, SLOT(slotVariant(QVariant))); + //qDebug() << "remove b" << binded_widgets.size(); + binded_widgets.remove(w); + //qDebug() << "remove a" << binded_widgets.size(); + return true; +} + + +void QCDCore::unbindAllWidgets() { + QMap > bwm = binded_widgets; + QMapIterator > it(bwm); + while (it.hasNext()) { + QWidget * w = it.next().key(); + unbindWidget(w); + } + binded_widgets.clear(); +} + + +void QCDCore::updateBindedWidget(const CDType & k_) { + QMapIterator > it(binded_widgets); + updating = true; + while (it.hasNext()) { + QWidget * w = it.next().key(); + const CDType & k(K[it.value()]); + if (k.path() != k_.path()) continue; + setWidgetValue(w, k); + } + updating = false; +} diff --git a/qcd_utils/qcd_core.h b/piqt/libs/qcd/qcd_core.h similarity index 96% rename from qcd_utils/qcd_core.h rename to piqt/libs/qcd/qcd_core.h index 01a8b0f..e29d1ee 100644 --- a/qcd_utils/qcd_core.h +++ b/piqt/libs/qcd/qcd_core.h @@ -1,96 +1,96 @@ -/* - QCD Utils - Qt bindings/utilites for CD Utils - - Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . -*/ - -#ifndef QCD_CORE_H -#define QCD_CORE_H - -#include -#include -#include -#include "piobject.h" -#include "cdutils_types.h" - - -class QCDCore; - - -class __QCore_Initializer__ { -public: - __QCore_Initializer__(); - ~__QCore_Initializer__(); - static int count_; - static QCDCore * __instance__; -}; - - -class QCDCore: public QObject, public PIObject -{ - Q_OBJECT - PIOBJECT(QCDCore) - friend class __QCore_Initializer__; -public: - static QCDCore * instance() {return __QCore_Initializer__::__instance__;} - - int bindWindow(QWidget * wnd); - int bindWidgets(QList wl); - bool bindWidget(QWidget * w); - bool bindWidget(QWidget * w, const CDUtils::CDType & k); - - int unbindWindow(QWidget * wnd); - int unbindWidgets(QList wl); - bool unbindWidget(QWidget * w); - void unbindAllWidgets(); - - void updateBindedWidget(const CDUtils::CDType & k_); - void setDirectKEnabled(bool yes) {direct_on = yes;} - bool isDirectKEnabled() const {return direct_on;} - -private: - QCDCore(); - ~QCDCore(); - - void bindView(QWidget * v); - void setWidgetValue(QWidget * w, const CDUtils::CDType & k); - void finishEdit(const QList > & pathes); - EVENT_HANDLER(void, K_ChangedGlobal); - - QMultiMap > binded_widgets; - bool updating, direct_on; - -private slots: - void slotBool(bool v); - void slotInt(int v); - void slotDouble(double v); - void slotText(QString v); - void slotVariant(QVariant v); - void slotDestroyed(QObject * ); - -public slots: - void updateBindedWidgets(); - -signals: - void updateViewRequest(); - -}; - - -static __QCore_Initializer__ __QCore_initializer__; - - -#endif // QCD_CORE_H +/* + QCD Utils - Qt bindings/utilites for CD Utils + + Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ + +#ifndef QCD_CORE_H +#define QCD_CORE_H + +#include +#include +#include +#include "piobject.h" +#include "cdutils_types.h" + + +class QCDCore; + + +class __QCore_Initializer__ { +public: + __QCore_Initializer__(); + ~__QCore_Initializer__(); + static int count_; + static QCDCore * __instance__; +}; + + +class QCDCore: public QObject, public PIObject +{ + Q_OBJECT + PIOBJECT(QCDCore) + friend class __QCore_Initializer__; +public: + static QCDCore * instance() {return __QCore_Initializer__::__instance__;} + + int bindWindow(QWidget * wnd); + int bindWidgets(QList wl); + bool bindWidget(QWidget * w); + bool bindWidget(QWidget * w, const CDUtils::CDType & k); + + int unbindWindow(QWidget * wnd); + int unbindWidgets(QList wl); + bool unbindWidget(QWidget * w); + void unbindAllWidgets(); + + void updateBindedWidget(const CDUtils::CDType & k_); + void setDirectKEnabled(bool yes) {direct_on = yes;} + bool isDirectKEnabled() const {return direct_on;} + +private: + QCDCore(); + ~QCDCore(); + + void bindView(QWidget * v); + void setWidgetValue(QWidget * w, const CDUtils::CDType & k); + void finishEdit(const QList > & pathes); + EVENT_HANDLER(void, K_ChangedGlobal); + + QMultiMap > binded_widgets; + bool updating, direct_on; + +private slots: + void slotBool(bool v); + void slotInt(int v); + void slotDouble(double v); + void slotText(QString v); + void slotVariant(QVariant v); + void slotDestroyed(QObject * ); + +public slots: + void updateBindedWidgets(); + +signals: + void updateViewRequest(); + +}; + + +static __QCore_Initializer__ __QCore_initializer__; + + +#endif // QCD_CORE_H diff --git a/qcd_utils/qcd_graphic.cpp b/piqt/libs/qcd/qcd_graphic.cpp similarity index 94% rename from qcd_utils/qcd_graphic.cpp rename to piqt/libs/qcd/qcd_graphic.cpp index 5eac6f6..c53a9ae 100644 --- a/qcd_utils/qcd_graphic.cpp +++ b/piqt/libs/qcd/qcd_graphic.cpp @@ -1,40 +1,40 @@ -#include "qcd_graphic.h" -#include "ui_qcd_graphic.h" -#include "cdutils_core.h" -#include "cdutils_x.h" -#include "graphic.h" -#include "piqt.h" - -using namespace CDUtils; - - -CDGraphicWidget::CDGraphicWidget(QWidget * p): QWidget(p) { - ui = new Ui::CDGraphicWidget(); - ui->setupUi(this); - ui->graphic->setGraphicsCount(0); -} - - -Graphic * CDGraphicWidget::graphic() const { - return ui->graphic; -} - - -void CDGraphicWidget::setConfigVisible(bool on) { - ui->widgetConfig->setVisible(on); -} - - -bool CDGraphicWidget::isConfigVisible() const { - return ui->widgetConfig->isVisible(); -} - - -EvalSpinBox * CDGraphicWidget::evalSpinBoxHistory() { - return ui->evalHistory; -} - - -EvalSpinBox * CDGraphicWidget::evalSpinBoxVisible() { - return ui->evalVisible; -} +#include "qcd_graphic.h" +#include "ui_qcd_graphic.h" +#include "cdutils_core.h" +#include "cdutils_x.h" +#include "graphic.h" +#include "piqt.h" + +using namespace CDUtils; + + +CDGraphicWidget::CDGraphicWidget(QWidget * p): QWidget(p) { + ui = new Ui::CDGraphicWidget(); + ui->setupUi(this); + ui->graphic->setGraphicsCount(0); +} + + +Graphic * CDGraphicWidget::graphic() const { + return ui->graphic; +} + + +void CDGraphicWidget::setConfigVisible(bool on) { + ui->widgetConfig->setVisible(on); +} + + +bool CDGraphicWidget::isConfigVisible() const { + return ui->widgetConfig->isVisible(); +} + + +EvalSpinBox * CDGraphicWidget::evalSpinBoxHistory() { + return ui->evalHistory; +} + + +EvalSpinBox * CDGraphicWidget::evalSpinBoxVisible() { + return ui->evalVisible; +} diff --git a/qcd_utils/qcd_graphic.h b/piqt/libs/qcd/qcd_graphic.h similarity index 95% rename from qcd_utils/qcd_graphic.h rename to piqt/libs/qcd/qcd_graphic.h index 45529b4..cc876e4 100644 --- a/qcd_utils/qcd_graphic.h +++ b/piqt/libs/qcd/qcd_graphic.h @@ -1,66 +1,66 @@ -/* - QCD Utils - Qt bindings/utilites for CD Utils - - Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . -*/ - -#ifndef QCD_GRAPHIC_H -#define QCD_GRAPHIC_H - -#include -#include -#include - -namespace CDUtils { - class CDType; - class CDSection; -} - -namespace Ui { - class CDGraphicWidget; -} - -class Graphic; -class Graphic; - - -class CDGraphicWidget: public QWidget { - Q_OBJECT - friend class CDGraphics; - friend class GDockWidget; -public: - CDGraphicWidget(QWidget * p = 0); - - Graphic * graphic() const; - bool isConfigVisible() const; - - EvalSpinBox * evalSpinBoxHistory(); - EvalSpinBox * evalSpinBoxVisible(); - -public slots: - void setConfigVisible(bool on); - -private: - Ui::CDGraphicWidget * ui; - -private slots: - -signals: - -}; - - -#endif // QCD_GRAPHIC_H +/* + QCD Utils - Qt bindings/utilites for CD Utils + + Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ + +#ifndef QCD_GRAPHIC_H +#define QCD_GRAPHIC_H + +#include +#include +#include + +namespace CDUtils { + class CDType; + class CDSection; +} + +namespace Ui { + class CDGraphicWidget; +} + +class Graphic; +class Graphic; + + +class CDGraphicWidget: public QWidget { + Q_OBJECT + friend class CDGraphics; + friend class GDockWidget; +public: + CDGraphicWidget(QWidget * p = 0); + + Graphic * graphic() const; + bool isConfigVisible() const; + + EvalSpinBox * evalSpinBoxHistory(); + EvalSpinBox * evalSpinBoxVisible(); + +public slots: + void setConfigVisible(bool on); + +private: + Ui::CDGraphicWidget * ui; + +private slots: + +signals: + +}; + + +#endif // QCD_GRAPHIC_H diff --git a/qcd_utils/qcd_graphic.ui b/piqt/libs/qcd/qcd_graphic.ui similarity index 96% rename from qcd_utils/qcd_graphic.ui rename to piqt/libs/qcd/qcd_graphic.ui index 511ed61..f08198f 100644 --- a/qcd_utils/qcd_graphic.ui +++ b/piqt/libs/qcd/qcd_graphic.ui @@ -1,169 +1,169 @@ - - - CDGraphicWidget - - - - 0 - 0 - 470 - 380 - - - - CD Pult - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Graphic::Autofit|Graphic::BorderInputs|Graphic::Clear|Graphic::Configure|Graphic::CursorAxis|Graphic::Fullscreen|Graphic::Legend|Graphic::OnlyExpandY|Graphic::Pause|Graphic::Save - - - false - - - false - - - 100.000000000000000 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - History: - - - - - - - 100.000000000000000 - - - - - - - Qt::Horizontal - - - - 1 - 20 - - - - - - - - Visible: - - - - - - - -1.000000000000000 - - - - - - - Qt::Horizontal - - - - 1 - 20 - - - - - - - - - - - - Graphic - QFrame -
graphic.h
-
- - EvalSpinBox - QWidget -
evalspinbox.h
-
-
- - - - evalHistory - valueChanged(double) - graphic - setHistorySize(double) - - - 148 - 363 - - - 156 - 297 - - - - - evalVisible - valueChanged(double) - graphic - setMaxVisibleTime(double) - - - 345 - 361 - - - 342 - 337 - - - - -
+ + + CDGraphicWidget + + + + 0 + 0 + 470 + 380 + + + + CD Pult + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Graphic::Autofit|Graphic::BorderInputs|Graphic::Clear|Graphic::Configure|Graphic::CursorAxis|Graphic::Fullscreen|Graphic::Legend|Graphic::OnlyExpandY|Graphic::Pause|Graphic::Save + + + false + + + false + + + 100.000000000000000 + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + History: + + + + + + + 100.000000000000000 + + + + + + + Qt::Horizontal + + + + 1 + 20 + + + + + + + + Visible: + + + + + + + -1.000000000000000 + + + + + + + Qt::Horizontal + + + + 1 + 20 + + + + + + + + + + + + Graphic + QFrame +
graphic.h
+
+ + EvalSpinBox + QWidget +
evalspinbox.h
+
+
+ + + + evalHistory + valueChanged(double) + graphic + setHistorySize(double) + + + 148 + 363 + + + 156 + 297 + + + + + evalVisible + valueChanged(double) + graphic + setMaxVisibleTime(double) + + + 345 + 361 + + + 342 + 337 + + + + +
diff --git a/qcd_utils/qcd_modedialog.cpp b/piqt/libs/qcd/qcd_modedialog.cpp similarity index 95% rename from qcd_utils/qcd_modedialog.cpp rename to piqt/libs/qcd/qcd_modedialog.cpp index 9612588..c6e2bb6 100644 --- a/qcd_utils/qcd_modedialog.cpp +++ b/piqt/libs/qcd/qcd_modedialog.cpp @@ -1,46 +1,46 @@ -#include "qcd_modedialog.h" -#include "ui_qcd_modedialog.h" - - -QCDModeDialog::QCDModeDialog(QWidget * parent): QDialog(parent) { - ui = new Ui::QCDModeDialog(); - ui->setupUi(this); -} - - -QCDModeDialog::~QCDModeDialog() { - delete ui; -} - - -CDUtils::UpdateModeFlags QCDModeDialog::mode() const { - CDUtils::UpdateModeFlags ret = 0; - if (ui->checkSaveIndex->isChecked()) ret |= CDUtils::SaveByIndex; - if (ui->checkSaveName->isChecked()) ret |= CDUtils::SaveByName; - if (ui->checkMerge->isChecked()) ret |= CDUtils::Merge; - return ret; -} - - -void QCDModeDialog::changeEvent(QEvent *e) { - QDialog::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - - -void QCDModeDialog::on_checkSaveIndex_clicked(bool checked) { - if (!checked) return; - ui->checkSaveName->setChecked(false); -} - - -void QCDModeDialog::on_checkSaveName_clicked(bool checked) { - if (!checked) return; - ui->checkSaveIndex->setChecked(false); -} +#include "qcd_modedialog.h" +#include "ui_qcd_modedialog.h" + + +QCDModeDialog::QCDModeDialog(QWidget * parent): QDialog(parent) { + ui = new Ui::QCDModeDialog(); + ui->setupUi(this); +} + + +QCDModeDialog::~QCDModeDialog() { + delete ui; +} + + +CDUtils::UpdateModeFlags QCDModeDialog::mode() const { + CDUtils::UpdateModeFlags ret = 0; + if (ui->checkSaveIndex->isChecked()) ret |= CDUtils::SaveByIndex; + if (ui->checkSaveName->isChecked()) ret |= CDUtils::SaveByName; + if (ui->checkMerge->isChecked()) ret |= CDUtils::Merge; + return ret; +} + + +void QCDModeDialog::changeEvent(QEvent *e) { + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + + +void QCDModeDialog::on_checkSaveIndex_clicked(bool checked) { + if (!checked) return; + ui->checkSaveName->setChecked(false); +} + + +void QCDModeDialog::on_checkSaveName_clicked(bool checked) { + if (!checked) return; + ui->checkSaveIndex->setChecked(false); +} diff --git a/qcd_utils/qcd_modedialog.h b/piqt/libs/qcd/qcd_modedialog.h similarity index 96% rename from qcd_utils/qcd_modedialog.h rename to piqt/libs/qcd/qcd_modedialog.h index 5554d4d..c9e478b 100644 --- a/qcd_utils/qcd_modedialog.h +++ b/piqt/libs/qcd/qcd_modedialog.h @@ -1,50 +1,50 @@ -/* - QCD Utils - Qt bindings/utilites for CD Utils - - Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . -*/ - -#ifndef QCD_MODEDIALOG_H -#define QCD_MODEDIALOG_H - -#include -#include - -namespace Ui { - class QCDModeDialog; -} - -class QCDModeDialog: public QDialog -{ - Q_OBJECT -public: - explicit QCDModeDialog(QWidget * parent = 0); - ~QCDModeDialog(); - - CDUtils::UpdateModeFlags mode() const; - -protected: - void changeEvent(QEvent *e); - - Ui::QCDModeDialog * ui; - -private slots: - void on_checkSaveIndex_clicked(bool checked); - void on_checkSaveName_clicked(bool checked); - -}; - -#endif // QCD_MODEDIALOG_H +/* + QCD Utils - Qt bindings/utilites for CD Utils + + Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ + +#ifndef QCD_MODEDIALOG_H +#define QCD_MODEDIALOG_H + +#include +#include + +namespace Ui { + class QCDModeDialog; +} + +class QCDModeDialog: public QDialog +{ + Q_OBJECT +public: + explicit QCDModeDialog(QWidget * parent = 0); + ~QCDModeDialog(); + + CDUtils::UpdateModeFlags mode() const; + +protected: + void changeEvent(QEvent *e); + + Ui::QCDModeDialog * ui; + +private slots: + void on_checkSaveIndex_clicked(bool checked); + void on_checkSaveName_clicked(bool checked); + +}; + +#endif // QCD_MODEDIALOG_H diff --git a/qcd_utils/qcd_modedialog.ui b/piqt/libs/qcd/qcd_modedialog.ui similarity index 95% rename from qcd_utils/qcd_modedialog.ui rename to piqt/libs/qcd/qcd_modedialog.ui index 0c3d1dd..38c2dff 100644 --- a/qcd_utils/qcd_modedialog.ui +++ b/piqt/libs/qcd/qcd_modedialog.ui @@ -1,98 +1,98 @@ - - - QCDModeDialog - - - - 0 - 0 - 251 - 152 - - - - Update description mode - - - - - - Save by index - - - - - - - Save by name - - - - - - - Merge - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - QCDModeDialog - accept() - - - 106 - 131 - - - 101 - 146 - - - - - buttonBox - rejected() - QCDModeDialog - reject() - - - 182 - 127 - - - 169 - 146 - - - - - + + + QCDModeDialog + + + + 0 + 0 + 251 + 152 + + + + Update description mode + + + + + + Save by index + + + + + + + Save by name + + + + + + + Merge + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + QCDModeDialog + accept() + + + 106 + 131 + + + 101 + 146 + + + + + buttonBox + rejected() + QCDModeDialog + reject() + + + 182 + 127 + + + 169 + 146 + + + + + diff --git a/qcd_utils/qcd_model.cpp b/piqt/libs/qcd/qcd_model.cpp similarity index 96% rename from qcd_utils/qcd_model.cpp rename to piqt/libs/qcd/qcd_model.cpp index 1f7fa32..d6ee620 100644 --- a/qcd_utils/qcd_model.cpp +++ b/piqt/libs/qcd/qcd_model.cpp @@ -1,460 +1,460 @@ -#include "qcd_model.h" -#include "cdutils_interface.h" -#include "cdutils_core.h" -#include "cdutils_x.h" -#include "piqt.h" -#include -#include -#include -#include -#include "qvariantedit.h" -#include "qad_types.h" - - -using namespace CDUtils; - -// CDKItem - -CDItem::CDItem(CDUtils::Interface * i, int _index, CDItem::CDItemType type, CDItem *parent) { - interface = i; - index_ = _index; - parent_ = parent; - type_ = type; - item_count = 0; - expanded = true; -} - - -CDItem::~CDItem() { - qDeleteAll(childs); -} - - -QVariant CDItem::data(int column, int role) const { - if (role == Qt::BackgroundRole) { - switch (type_) { - case ItemCDType: { - CDType & t(interface->section(buildPath())[index_]); - if (t.errorString().isEmpty()) return QBrush(QColor(255, 250, 230)); - else return QBrush(QColor(255, 128, 128)); - } - case ItemCDSection: return QBrush(QColor(230, 250, 230)); - } - } - if (role == Qt::CheckStateRole && type_ == ItemCDType) { - CDType & t(interface->section(buildPath())[index_]); - if (column == cValue && t.cd_type() == CDType::cdK) { - if (t.type() == "b") return t.toBool() ? Qt::Checked : Qt::Unchecked; - else QVariant(); - } - if (column == cName_Cmd && t.cd_type() == CDType::cdX) { - return t.isSelectedX() ? Qt::Checked : Qt::Unchecked; - } - } - if (role == Qt::ToolTipRole && type_ == ItemCDType) { - CDType & t(interface->section(buildPath())[index_]); - return PI2QString(t.errorString()); - } - if (role != Qt::DisplayRole && role != Qt::EditRole) return QVariant(); - PIDeque path = buildPath(); - CDSection & rs = interface->section(path); - CDSection s; - switch (type_) { - case ItemCDType: - switch (column) { - case cID: return QString::number(index_); - case cName_Cmd: return PI2QString(rs[index_].name()); - case cType: return stringType(rs[index_].type()); - case cXMode: return QVariant::fromValue(xModeEnum(rs[index_].xmode())); - case cXAvg: return rs[index_].avg(); - case cExpression: return PI2QString(rs[index_].formula()); - case cValue: return value(rs[index_], role); - case cComment: return PI2QString(rs[index_].comment()); - default: break; - } - break; - case ItemCDSection: - s = rs.section(index_); -// piCout << rs.name << rs.alias << s.name << s.alias; - switch (column) { - case cID: return QString("[") + QString::number(index_) + QString("]"); - case cName_Cmd: return PI2QString(s.alias); - case cType: return PI2QString(s.name); - default: break; - } - break; - } - return QVariant(); -} - - -QVariant CDItem::value(CDType & t, int role) const { - if (t.type() == "f") return t.toDouble(); - if (t.type() == "n") return t.toInt(); - if (t.type() == "b") return t.toBool(); - if (t.type() == "e") { - QAD::Enum et = PI2QADEnum(t.enumValues()); - et.selectValue(t.toInt()); - if (role == Qt::EditRole) return QVariant::fromValue(et); - else return et.selectedName(); - } - return PI2QString(t.value()); -} - - -bool CDItem::setData(int column, const QVariant & value) { - if (type_ == ItemCDType) { - CDType & t(interface->section(buildPath())[index_]); - if ((column == cExpression || column == cValue) && (t.cd_type() == CDType::cdK)) { - interface->section(buildPath())[index_].setValue(Q2PIString(value.toString())); - interface->calculate(); - return true; - } - if (t.cd_type() == CDType::cdX) { - switch (column) { - case cName_Cmd: - X.setEnabled(t, value.toBool()); - return true; - case cXMode: - t.setXMode((CDType::XMode)value.toInt()); - return true; - case cXAvg: - t.setAvg(piMax(value.toInt(), 1)); - return true; - default: break; - } - } - } - return false; -} - - -PIDeque CDItem::buildPath() const { - PIDeque path; - CDItem * p = parent_; - while (p) { - path.push_front(p->index_); - p = p->parent_; - } - path.take_front(); - return path; -} - - -QString CDItem::stringType(const PIString & t) const { - QString n = PI2QString(t); - if (n.isEmpty()) return QString(""); - switch (n[0].toLatin1()) { - case 'l': return QString("list"); break; - case 'b': return QString("bool"); break; - case 'n': return QString("int"); break; - case 'f': return QString("double"); break; - case 'c': return QString("color"); break; - case 'r': return QString("rect"); break; - case 'a': return QString("rect"); break; - case 'p': return QString("point"); break; - case 'v': return QString("vector"); break; - case 'i': return QString("IP"); break; - case 'e': return QString("enum"); break; - case 'F': return QString("file"); break; - case 'D': return QString("dir"); break; - } - return QString("string"); -} - - -QAD::Enum CDItem::xModeEnum(int v) const { - QAD::Enum ret; - ret << QAD::Enumerator(CDType::X_Current, "Current") - << QAD::Enumerator(CDType::X_All_Avg, "All, Averaging"); - ret.selectValue(v); - return ret; -} - - -// CDKDelegate - -CDDelegate::CDDelegate(QObject *parent) : QStyledItemDelegate(parent) { -} - - -void CDDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const { - CDItem * item = ((CDItemModel*)index.model())->getItem(index); - if (item) { - if (item->itemType() == CDItem::ItemCDType && item->interface->cdType() == CDType::cdC) { - QStyleOptionButton bo; - bo.direction = option.direction; - bo.fontMetrics = option.fontMetrics; - bo.palette = option.palette; - bo.rect = option.rect; - bo.state = option.state;// & ~(QStyle::State_HasFocus | QStyle::State_MouseOver); - bo.text = item->data(1, Qt::DisplayRole).toString(); - QWidget * v = (QWidget*)(painter->device()); - if (v) { - QPoint cp = v->mapFromGlobal(QCursor::pos()); - if (bo.rect.contains(cp, true)) { - //bo.state |= QStyle::State_MouseOver; - if (qApp->mouseButtons().testFlag(Qt::LeftButton)) - bo.state |= QStyle::State_On; - } - } - qApp->style()->drawControl(QStyle::CE_PushButton, &bo, painter); - return; - } - } - QStyledItemDelegate::paint(painter, option, index); - -} - - -QWidget * CDDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { - return new QVariantEdit(parent); -} - - -void CDDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { - QVariantEdit *edit = static_cast(editor); - edit->setValue(index.model()->data(index, Qt::EditRole)); -} - - -void CDDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { - QVariantEdit *edit = static_cast(editor); - QVariant v = edit->value(); - if (v.canConvert()) { - QAD::Enum et = v.value(); - model->setData(index, et.selectedValue(), Qt::EditRole); - } else model->setData(index, v, Qt::EditRole); -} - - -void CDDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const { - editor->setGeometry(option.rect); -} - - -QSize CDDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { - QSize s = QStyledItemDelegate::sizeHint(option, index); - s.setWidth(s.width() + 20); - return s; -} - - -// CDItemModel - -CDItemModel::CDItemModel(int type_, QObject *parent) : QAbstractItemModel(parent) { - interface = new Interface((CDType::cdT)type_); - root = 0; - internalRebuild(); -} - - -CDItemModel::~CDItemModel() { - delete root; - delete interface; -} - - -QVariant CDItemModel::data(const QModelIndex &index, int role) const { - if (!index.isValid()) return QVariant(); - CDItem * item = getItem(index); - return item->data(index.column(), role); -} - - -QVariant CDItemModel::headerData(int section, Qt::Orientation orientation, int role) const { - if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { - switch (section) { - case cID: return tr("Index"); - case cName_Cmd: return interface->cdType() == CDType::cdC ? tr("Command") : tr("Name"); - case cType: return tr("Type"); - case cXMode: return tr("Mode"); - case cXAvg: return tr("Averaging"); - case cExpression: return tr("Expression"); - case cValue: return tr("Value"); - case cComment: return tr("Comment"); - } - } - return QVariant(); -} - - -QModelIndex CDItemModel::index(int row, int column, const QModelIndex &parent) const { - if (parent.isValid() && parent.column() != cID) return QModelIndex(); - CDItem * p = getItem(parent); - CDItem * c = p->childs.value(row, 0); - if (c) return createIndex(row, column, c); - else return QModelIndex(); -} - - -QModelIndex CDItemModel::parent(const QModelIndex &index) const { - if (!index.isValid()) return QModelIndex(); - CDItem * c = getItem(index); - CDItem * p = c->parent_; - if (p == root) return QModelIndex(); - return createIndex(p->parent_->childs.indexOf(p), cID, p); -} - - -int CDItemModel::rowCount(const QModelIndex &parent) const { - CDItem * p = getItem(parent); - return p->childs.count(); -} - - -int CDItemModel::columnCount(const QModelIndex &parent) const { - return cLastColumn; -} - - -Qt::ItemFlags CDItemModel::flags(const QModelIndex & index) const { - if (!index.isValid()) return 0; - Qt::ItemFlags f = Qt::ItemIsEnabled | Qt::ItemIsSelectable; - CDItem * item = getItem(index); - if (!item) return 0; - if (item->type_ == CDItem::ItemCDType) { - CDType & t(interface->section(item->buildPath())[item->index_]); - if (t.cd_type() == CDType::cdK) { - if (index.column() == cExpression || index.column() == cValue) - f |= Qt::ItemIsEditable; - if (index.column() == cValue && t.type() == "b") - f |= Qt::ItemIsUserCheckable; - if (index.column() == cName_Cmd) - f |= Qt::ItemIsDragEnabled; - } - if (t.cd_type() == CDType::cdX) { - if (index.column() == cXMode || index.column() == cXAvg) - f |= Qt::ItemIsEditable; - if (index.column() == cName_Cmd) - f |= Qt::ItemIsUserCheckable | Qt::ItemIsDragEnabled; - } - } - return f; -} - - -bool CDItemModel::setData(const QModelIndex & index, const QVariant & value, int role) { - if (role == Qt::CheckStateRole && (index.column() == cName_Cmd || index.column() == cValue)) { - CDItem * item = getItem(index); - if (item->type_ == CDItem::ItemCDType) { - CDType & t(interface->section(item->buildPath())[item->index_]); - if (index.column() == cValue && (t.cd_type() == CDType::cdK)) { - if (t.type() == "b") { - bool result = item->setData(index.column(), PI2QString(PIString::fromBool(value.toBool()))); - QModelIndex rin(CDItemModel::index(index.row(), cExpression, index.parent())); - emit dataChanged(rin, rin); - return result; - } - } - if (index.column() == cName_Cmd && (t.cd_type() == CDType::cdX)) { - bool result = item->setData(index.column(), value); - //QModelIndex rin(CDItemModel::index(index.row(), 1, index.parent())); - //emit dataChanged(rin, rin); - return result; - } - } - } - if (role != Qt::EditRole) return false; - CDItem * item = getItem(index); - bool result = item->setData(index.column(), value); - if (result) { - QModelIndex rin(CDItemModel::index(index.row(), cExpression, index.parent())); - emit dataChanged(rin, rin); - emit dataChanged(index, index); - } - return result; -} - - -QMimeData * CDItemModel::mimeData(const QModelIndexList & indexes) const { - if (indexes.size() == 1) { - QModelIndex index = indexes[0]; - if (index.isValid()/* && interface->cdType() == CDType::cdX*/) { - CDItem * item = getItem(index); - if (item) { - CDType & t(interface->section(item->buildPath())[item->index_]); - QMimeData * mime = new QMimeData(); - mime->setText(PI2QString(CDCore::instance()->typeLetter(interface->cdType()) + - CDCore::pathToString(t.path()))); - return mime; - } - } - } - return QAbstractItemModel::mimeData(indexes); -} - - -void CDItemModel::rebuildModel() { - beginResetModel(); - internalRebuild(); - endResetModel(); -} - - -void CDItemModel::buildItem(CDItem * it, CDSection & r) { - //piCout << "build item" << r.name << r.alias; - auto i = r.cd.makeIterator(); - while (i.next()) { - it->childs << new CDItem(interface, i.key(), CDItem::ItemCDType, it); - } - it->item_count = it->childs.size(); - auto j = r.s.makeIterator(); - while (j.next()) { - it->childs << new CDItem(interface, j.key(), CDItem::ItemCDSection, it); - buildItem(it->childs.back(), j.valueRef()); - } -} - - -void CDItemModel::updateModel() { - beginResetModel(); - endResetModel(); -} - - -void CDItemModel::internalRebuild() { - //qDebug() << "[CDKItemModel]" << "internalRebuild()"; - if (root) delete root; - root = new CDItem(interface, 0, CDItem::ItemCDSection, 0); - CDSection & r = interface->root(); - buildItem(root, r); -} - - -CDItem * CDItemModel::getItem(const QModelIndex &index) const { - if (index.isValid()) { - CDItem * item = static_cast(index.internalPointer()); - if (item) return item; - } - return root; -} - - -QModelIndex CDItemModel::indexByPath(const PIDeque & path, int column) const { - if (path.isEmpty()) return QModelIndex(); - CDItem * item = root; - //piCout << path << "..."; - bool ok = false; - for (int i = 0; i < path.size_s() - 1; ++i) { - ok = false; - foreach (CDItem * j, item->childs) - if (j->type_ == CDItem::ItemCDSection && j->index_ == path[i]) { - item = j; - ok = true; - break; - } - if (!ok) return QModelIndex(); - } - ok = false; - foreach (CDItem * j, item->childs) - if (j->type_ == CDItem::ItemCDType && j->index_ == path.back()) { - item = j; - ok = true; - break; - } - if (!ok || !item->parent_) return QModelIndex(); - QModelIndex ret = createIndex(item->parent_->childs.indexOf(item), column, item); - //piCout << path << Q2PIString(item->data(cName_Cmd, Qt::DisplayRole).toString()) << getItem(ret)->buildPath(); - return ret; -} +#include "qcd_model.h" +#include "cdutils_interface.h" +#include "cdutils_core.h" +#include "cdutils_x.h" +#include "piqt.h" +#include +#include +#include +#include +#include "qvariantedit.h" +#include "qad_types.h" + + +using namespace CDUtils; + +// CDKItem + +CDItem::CDItem(CDUtils::Interface * i, int _index, CDItem::CDItemType type, CDItem *parent) { + interface = i; + index_ = _index; + parent_ = parent; + type_ = type; + item_count = 0; + expanded = true; +} + + +CDItem::~CDItem() { + qDeleteAll(childs); +} + + +QVariant CDItem::data(int column, int role) const { + if (role == Qt::BackgroundRole) { + switch (type_) { + case ItemCDType: { + CDType & t(interface->section(buildPath())[index_]); + if (t.errorString().isEmpty()) return QBrush(QColor(255, 250, 230)); + else return QBrush(QColor(255, 128, 128)); + } + case ItemCDSection: return QBrush(QColor(230, 250, 230)); + } + } + if (role == Qt::CheckStateRole && type_ == ItemCDType) { + CDType & t(interface->section(buildPath())[index_]); + if (column == cValue && t.cd_type() == CDType::cdK) { + if (t.type() == "b") return t.toBool() ? Qt::Checked : Qt::Unchecked; + else QVariant(); + } + if (column == cName_Cmd && t.cd_type() == CDType::cdX) { + return t.isSelectedX() ? Qt::Checked : Qt::Unchecked; + } + } + if (role == Qt::ToolTipRole && type_ == ItemCDType) { + CDType & t(interface->section(buildPath())[index_]); + return PI2QString(t.errorString()); + } + if (role != Qt::DisplayRole && role != Qt::EditRole) return QVariant(); + PIDeque path = buildPath(); + CDSection & rs = interface->section(path); + CDSection s; + switch (type_) { + case ItemCDType: + switch (column) { + case cID: return QString::number(index_); + case cName_Cmd: return PI2QString(rs[index_].name()); + case cType: return stringType(rs[index_].type()); + case cXMode: return QVariant::fromValue(xModeEnum(rs[index_].xmode())); + case cXAvg: return rs[index_].avg(); + case cExpression: return PI2QString(rs[index_].formula()); + case cValue: return value(rs[index_], role); + case cComment: return PI2QString(rs[index_].comment()); + default: break; + } + break; + case ItemCDSection: + s = rs.section(index_); +// piCout << rs.name << rs.alias << s.name << s.alias; + switch (column) { + case cID: return QString("[") + QString::number(index_) + QString("]"); + case cName_Cmd: return PI2QString(s.alias); + case cType: return PI2QString(s.name); + default: break; + } + break; + } + return QVariant(); +} + + +QVariant CDItem::value(CDType & t, int role) const { + if (t.type() == "f") return t.toDouble(); + if (t.type() == "n") return t.toInt(); + if (t.type() == "b") return t.toBool(); + if (t.type() == "e") { + QAD::Enum et = PI2QADEnum(t.enumValues()); + et.selectValue(t.toInt()); + if (role == Qt::EditRole) return QVariant::fromValue(et); + else return et.selectedName(); + } + return PI2QString(t.value()); +} + + +bool CDItem::setData(int column, const QVariant & value) { + if (type_ == ItemCDType) { + CDType & t(interface->section(buildPath())[index_]); + if ((column == cExpression || column == cValue) && (t.cd_type() == CDType::cdK)) { + interface->section(buildPath())[index_].setValue(Q2PIString(value.toString())); + interface->calculate(); + return true; + } + if (t.cd_type() == CDType::cdX) { + switch (column) { + case cName_Cmd: + X.setEnabled(t, value.toBool()); + return true; + case cXMode: + t.setXMode((CDType::XMode)value.toInt()); + return true; + case cXAvg: + t.setAvg(piMax(value.toInt(), 1)); + return true; + default: break; + } + } + } + return false; +} + + +PIDeque CDItem::buildPath() const { + PIDeque path; + CDItem * p = parent_; + while (p) { + path.push_front(p->index_); + p = p->parent_; + } + path.take_front(); + return path; +} + + +QString CDItem::stringType(const PIString & t) const { + QString n = PI2QString(t); + if (n.isEmpty()) return QString(""); + switch (n[0].toLatin1()) { + case 'l': return QString("list"); break; + case 'b': return QString("bool"); break; + case 'n': return QString("int"); break; + case 'f': return QString("double"); break; + case 'c': return QString("color"); break; + case 'r': return QString("rect"); break; + case 'a': return QString("rect"); break; + case 'p': return QString("point"); break; + case 'v': return QString("vector"); break; + case 'i': return QString("IP"); break; + case 'e': return QString("enum"); break; + case 'F': return QString("file"); break; + case 'D': return QString("dir"); break; + } + return QString("string"); +} + + +QAD::Enum CDItem::xModeEnum(int v) const { + QAD::Enum ret; + ret << QAD::Enumerator(CDType::X_Current, "Current") + << QAD::Enumerator(CDType::X_All_Avg, "All, Averaging"); + ret.selectValue(v); + return ret; +} + + +// CDKDelegate + +CDDelegate::CDDelegate(QObject *parent) : QStyledItemDelegate(parent) { +} + + +void CDDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const { + CDItem * item = ((CDItemModel*)index.model())->getItem(index); + if (item) { + if (item->itemType() == CDItem::ItemCDType && item->interface->cdType() == CDType::cdC) { + QStyleOptionButton bo; + bo.direction = option.direction; + bo.fontMetrics = option.fontMetrics; + bo.palette = option.palette; + bo.rect = option.rect; + bo.state = option.state;// & ~(QStyle::State_HasFocus | QStyle::State_MouseOver); + bo.text = item->data(1, Qt::DisplayRole).toString(); + QWidget * v = (QWidget*)(painter->device()); + if (v) { + QPoint cp = v->mapFromGlobal(QCursor::pos()); + if (bo.rect.contains(cp, true)) { + //bo.state |= QStyle::State_MouseOver; + if (qApp->mouseButtons().testFlag(Qt::LeftButton)) + bo.state |= QStyle::State_On; + } + } + qApp->style()->drawControl(QStyle::CE_PushButton, &bo, painter); + return; + } + } + QStyledItemDelegate::paint(painter, option, index); + +} + + +QWidget * CDDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { + return new QVariantEdit(parent); +} + + +void CDDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { + QVariantEdit *edit = static_cast(editor); + edit->setValue(index.model()->data(index, Qt::EditRole)); +} + + +void CDDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { + QVariantEdit *edit = static_cast(editor); + QVariant v = edit->value(); + if (v.canConvert()) { + QAD::Enum et = v.value(); + model->setData(index, et.selectedValue(), Qt::EditRole); + } else model->setData(index, v, Qt::EditRole); +} + + +void CDDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const { + editor->setGeometry(option.rect); +} + + +QSize CDDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { + QSize s = QStyledItemDelegate::sizeHint(option, index); + s.setWidth(s.width() + 20); + return s; +} + + +// CDItemModel + +CDItemModel::CDItemModel(int type_, QObject *parent) : QAbstractItemModel(parent) { + interface = new Interface((CDType::cdT)type_); + root = 0; + internalRebuild(); +} + + +CDItemModel::~CDItemModel() { + delete root; + delete interface; +} + + +QVariant CDItemModel::data(const QModelIndex &index, int role) const { + if (!index.isValid()) return QVariant(); + CDItem * item = getItem(index); + return item->data(index.column(), role); +} + + +QVariant CDItemModel::headerData(int section, Qt::Orientation orientation, int role) const { + if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { + switch (section) { + case cID: return tr("Index"); + case cName_Cmd: return interface->cdType() == CDType::cdC ? tr("Command") : tr("Name"); + case cType: return tr("Type"); + case cXMode: return tr("Mode"); + case cXAvg: return tr("Averaging"); + case cExpression: return tr("Expression"); + case cValue: return tr("Value"); + case cComment: return tr("Comment"); + } + } + return QVariant(); +} + + +QModelIndex CDItemModel::index(int row, int column, const QModelIndex &parent) const { + if (parent.isValid() && parent.column() != cID) return QModelIndex(); + CDItem * p = getItem(parent); + CDItem * c = p->childs.value(row, 0); + if (c) return createIndex(row, column, c); + else return QModelIndex(); +} + + +QModelIndex CDItemModel::parent(const QModelIndex &index) const { + if (!index.isValid()) return QModelIndex(); + CDItem * c = getItem(index); + CDItem * p = c->parent_; + if (p == root) return QModelIndex(); + return createIndex(p->parent_->childs.indexOf(p), cID, p); +} + + +int CDItemModel::rowCount(const QModelIndex &parent) const { + CDItem * p = getItem(parent); + return p->childs.count(); +} + + +int CDItemModel::columnCount(const QModelIndex &parent) const { + return cLastColumn; +} + + +Qt::ItemFlags CDItemModel::flags(const QModelIndex & index) const { + if (!index.isValid()) return 0; + Qt::ItemFlags f = Qt::ItemIsEnabled | Qt::ItemIsSelectable; + CDItem * item = getItem(index); + if (!item) return 0; + if (item->type_ == CDItem::ItemCDType) { + CDType & t(interface->section(item->buildPath())[item->index_]); + if (t.cd_type() == CDType::cdK) { + if (index.column() == cExpression || index.column() == cValue) + f |= Qt::ItemIsEditable; + if (index.column() == cValue && t.type() == "b") + f |= Qt::ItemIsUserCheckable; + if (index.column() == cName_Cmd) + f |= Qt::ItemIsDragEnabled; + } + if (t.cd_type() == CDType::cdX) { + if (index.column() == cXMode || index.column() == cXAvg) + f |= Qt::ItemIsEditable; + if (index.column() == cName_Cmd) + f |= Qt::ItemIsUserCheckable | Qt::ItemIsDragEnabled; + } + } + return f; +} + + +bool CDItemModel::setData(const QModelIndex & index, const QVariant & value, int role) { + if (role == Qt::CheckStateRole && (index.column() == cName_Cmd || index.column() == cValue)) { + CDItem * item = getItem(index); + if (item->type_ == CDItem::ItemCDType) { + CDType & t(interface->section(item->buildPath())[item->index_]); + if (index.column() == cValue && (t.cd_type() == CDType::cdK)) { + if (t.type() == "b") { + bool result = item->setData(index.column(), PI2QString(PIString::fromBool(value.toBool()))); + QModelIndex rin(CDItemModel::index(index.row(), cExpression, index.parent())); + emit dataChanged(rin, rin); + return result; + } + } + if (index.column() == cName_Cmd && (t.cd_type() == CDType::cdX)) { + bool result = item->setData(index.column(), value); + //QModelIndex rin(CDItemModel::index(index.row(), 1, index.parent())); + //emit dataChanged(rin, rin); + return result; + } + } + } + if (role != Qt::EditRole) return false; + CDItem * item = getItem(index); + bool result = item->setData(index.column(), value); + if (result) { + QModelIndex rin(CDItemModel::index(index.row(), cExpression, index.parent())); + emit dataChanged(rin, rin); + emit dataChanged(index, index); + } + return result; +} + + +QMimeData * CDItemModel::mimeData(const QModelIndexList & indexes) const { + if (indexes.size() == 1) { + QModelIndex index = indexes[0]; + if (index.isValid()/* && interface->cdType() == CDType::cdX*/) { + CDItem * item = getItem(index); + if (item) { + CDType & t(interface->section(item->buildPath())[item->index_]); + QMimeData * mime = new QMimeData(); + mime->setText(PI2QString(CDCore::instance()->typeLetter(interface->cdType()) + + CDCore::pathToString(t.path()))); + return mime; + } + } + } + return QAbstractItemModel::mimeData(indexes); +} + + +void CDItemModel::rebuildModel() { + beginResetModel(); + internalRebuild(); + endResetModel(); +} + + +void CDItemModel::buildItem(CDItem * it, CDSection & r) { + //piCout << "build item" << r.name << r.alias; + auto i = r.cd.makeIterator(); + while (i.next()) { + it->childs << new CDItem(interface, i.key(), CDItem::ItemCDType, it); + } + it->item_count = it->childs.size(); + auto j = r.s.makeIterator(); + while (j.next()) { + it->childs << new CDItem(interface, j.key(), CDItem::ItemCDSection, it); + buildItem(it->childs.back(), j.valueRef()); + } +} + + +void CDItemModel::updateModel() { + beginResetModel(); + endResetModel(); +} + + +void CDItemModel::internalRebuild() { + //qDebug() << "[CDKItemModel]" << "internalRebuild()"; + if (root) delete root; + root = new CDItem(interface, 0, CDItem::ItemCDSection, 0); + CDSection & r = interface->root(); + buildItem(root, r); +} + + +CDItem * CDItemModel::getItem(const QModelIndex &index) const { + if (index.isValid()) { + CDItem * item = static_cast(index.internalPointer()); + if (item) return item; + } + return root; +} + + +QModelIndex CDItemModel::indexByPath(const PIDeque & path, int column) const { + if (path.isEmpty()) return QModelIndex(); + CDItem * item = root; + //piCout << path << "..."; + bool ok = false; + for (int i = 0; i < path.size_s() - 1; ++i) { + ok = false; + foreach (CDItem * j, item->childs) + if (j->type_ == CDItem::ItemCDSection && j->index_ == path[i]) { + item = j; + ok = true; + break; + } + if (!ok) return QModelIndex(); + } + ok = false; + foreach (CDItem * j, item->childs) + if (j->type_ == CDItem::ItemCDType && j->index_ == path.back()) { + item = j; + ok = true; + break; + } + if (!ok || !item->parent_) return QModelIndex(); + QModelIndex ret = createIndex(item->parent_->childs.indexOf(item), column, item); + //piCout << path << Q2PIString(item->data(cName_Cmd, Qt::DisplayRole).toString()) << getItem(ret)->buildPath(); + return ret; +} diff --git a/qcd_utils/qcd_model.h b/piqt/libs/qcd/qcd_model.h similarity index 96% rename from qcd_utils/qcd_model.h rename to piqt/libs/qcd/qcd_model.h index bfc92da..30cc734 100644 --- a/qcd_utils/qcd_model.h +++ b/piqt/libs/qcd/qcd_model.h @@ -1,132 +1,132 @@ -/* - QCD Utils - Qt bindings/utilites for CD Utils - - Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . -*/ - -#ifndef QCD_MODEL_H -#define QCD_MODEL_H - -#include -#include -#include -#include "pistring.h" - -namespace CDUtils { - class CDType; - class CDSection; - class Interface; - - enum Column { - cID , - cName_Cmd , - cType , - cXMode , - cXAvg , - cExpression, - cValue , - cComment , - cLastColumn, - }; -} - -namespace QAD { - struct Enum; -} - -class CDItemModel; - - -class CDItem { - friend class CDItemModel; - friend class CDView; -public: - enum CDItemType{ItemCDType, ItemCDSection}; - CDItem(CDUtils::Interface * interface, int _index, CDItemType type, CDItem * parent); - ~CDItem(); - QVariant data(int column, int role) const; - QVariant value(CDUtils::CDType & t, int role) const; - bool setData(int column, const QVariant & value); - CDItemType itemType() const {return type_;} - PIDeque buildPath() const; - int index() const {return index_;} - - CDUtils::Interface * interface; - bool expanded; - -private: - QString stringType(const PIString & t) const; - QAD::Enum xModeEnum(int v) const; - - CDItem * parent_; - int index_, item_count; - CDItemType type_; - QList childs; -}; - - -class CDDelegate : public QStyledItemDelegate -{ - Q_OBJECT -public: - CDDelegate(QObject *parent = 0); - - void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; - QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; - void setEditorData(QWidget *editor, const QModelIndex &index) const; - void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; - void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; - -}; - - -class CDItemModel : public QAbstractItemModel { - Q_OBJECT - friend class CDView; -public: - explicit CDItemModel(int type_, QObject *parent = 0); - ~CDItemModel(); - - QVariant data(const QModelIndex & index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); - QMimeData * mimeData(const QModelIndexList & indexes) const; - CDItem * getItem(const QModelIndex & index) const; - QModelIndex indexByPath(const PIDeque & path, int column = CDUtils::cID) const; - - void buildItem(CDItem * it, CDUtils::CDSection &r); - -public slots: - void rebuildModel(); - void updateModel(); - -private: - void internalRebuild(); - - CDUtils::Interface * interface; - CDItem * root; - -signals: - -}; - -#endif // QCD_MODEL_H +/* + QCD Utils - Qt bindings/utilites for CD Utils + + Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ + +#ifndef QCD_MODEL_H +#define QCD_MODEL_H + +#include +#include +#include +#include "pistring.h" + +namespace CDUtils { + class CDType; + class CDSection; + class Interface; + + enum Column { + cID , + cName_Cmd , + cType , + cXMode , + cXAvg , + cExpression, + cValue , + cComment , + cLastColumn, + }; +} + +namespace QAD { + struct Enum; +} + +class CDItemModel; + + +class CDItem { + friend class CDItemModel; + friend class CDView; +public: + enum CDItemType{ItemCDType, ItemCDSection}; + CDItem(CDUtils::Interface * interface, int _index, CDItemType type, CDItem * parent); + ~CDItem(); + QVariant data(int column, int role) const; + QVariant value(CDUtils::CDType & t, int role) const; + bool setData(int column, const QVariant & value); + CDItemType itemType() const {return type_;} + PIDeque buildPath() const; + int index() const {return index_;} + + CDUtils::Interface * interface; + bool expanded; + +private: + QString stringType(const PIString & t) const; + QAD::Enum xModeEnum(int v) const; + + CDItem * parent_; + int index_, item_count; + CDItemType type_; + QList childs; +}; + + +class CDDelegate : public QStyledItemDelegate +{ + Q_OBJECT +public: + CDDelegate(QObject *parent = 0); + + void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; + QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; + void setEditorData(QWidget *editor, const QModelIndex &index) const; + void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; + void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + +}; + + +class CDItemModel : public QAbstractItemModel { + Q_OBJECT + friend class CDView; +public: + explicit CDItemModel(int type_, QObject *parent = 0); + ~CDItemModel(); + + QVariant data(const QModelIndex & index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; + QModelIndex parent(const QModelIndex &index) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + Qt::ItemFlags flags(const QModelIndex &index) const; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + QMimeData * mimeData(const QModelIndexList & indexes) const; + CDItem * getItem(const QModelIndex & index) const; + QModelIndex indexByPath(const PIDeque & path, int column = CDUtils::cID) const; + + void buildItem(CDItem * it, CDUtils::CDSection &r); + +public slots: + void rebuildModel(); + void updateModel(); + +private: + void internalRebuild(); + + CDUtils::Interface * interface; + CDItem * root; + +signals: + +}; + +#endif // QCD_MODEL_H diff --git a/qcd_utils/qcd_view.cpp b/piqt/libs/qcd/qcd_view.cpp similarity index 96% rename from qcd_utils/qcd_view.cpp rename to piqt/libs/qcd/qcd_view.cpp index 5ecea4c..619c46e 100644 --- a/qcd_utils/qcd_view.cpp +++ b/piqt/libs/qcd/qcd_view.cpp @@ -1,371 +1,371 @@ -#include -#include -#include -#include "cdutils_k.h" -#include "cdutils_x.h" -#include "cdutils_c.h" -#include "cdutils_m.h" -#include "cdutils_core.h" -#include "qcd_view.h" -#include "qcd_model.h" -#include "piqt.h" -#include "pifile.h" - -using namespace CDUtils; - - -CDView::CDView(QWidget * parent) : QTreeView(parent) { - type_ = -1; - model_ = 0; - proxy_ = 0; - connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(indexClicked(QModelIndex))); - connect(this, SIGNAL(_qcd_sendFailed()), this, SLOT(cd_sendFailed()), Qt::QueuedConnection); - connect(this, SIGNAL(_qcd_sendSucceed()), this, SLOT(cd_sendSucceed()), Qt::QueuedConnection); - connect(this, SIGNAL(_qcd_receiveFailed()), this, SLOT(cd_receiveFailed()), Qt::QueuedConnection); - connect(this, SIGNAL(_qcd_receiveSucceed()), this, SLOT(cd_receiveSucceed()), Qt::QueuedConnection); - connect(this, SIGNAL(_qcd_receivedX()), this, SLOT(cd_receivedX()), Qt::QueuedConnection); - connect(this, SIGNAL(_qcd_changedGlobal()), this, SLOT(cd_changedGlobal()), Qt::QueuedConnection); -} - - -CDView::~CDView() { - if (model_) { - delete model_; - delete proxy_; - } - model_ = 0; - proxy_ = 0; -} - - -void CDView::setType(int cdt) { - if (cdt < 0) return; - if (type_ >= 0) return; - type_ = cdt; - switch ((CDType::cdT)type_) { - case CDType::cdK: - CONNECTU(&K, sended, this, pi_cd_sendSucceed); - CONNECTU(&K, sendFailed, this, pi_cd_sendFailed); - CONNECTU(&K, received, this, pi_cd_receiveSucceed); - CONNECTU(&K, receiveFailed, this, pi_cd_receiveFailed); - CONNECTU(&K, changedGlobal, this, pi_cd_changedGlobal); - break; - case CDType::cdX: - CONNECTU(&X, sended, this, pi_cd_sendSucceed); - CONNECTU(&X, sendFailed, this, pi_cd_sendFailed); - CONNECTU(&X, received, this, pi_cd_receiveSucceed); - CONNECTU(&X, receiveFailed, this, pi_cd_receiveFailed); - CONNECTU(&X, receivedX, this, pi_cd_receivedX); - CONNECTU(&X, changedGlobal, this, pi_cd_changedGlobal); - break; - case CDType::cdC: - CONNECTU(&C, sended, this, pi_cd_sendSucceed); - CONNECTU(&C, sendFailed, this, pi_cd_sendFailed); - CONNECTU(&C, received, this, pi_cd_receiveSucceed); - CONNECTU(&C, receiveFailed, this, pi_cd_receiveFailed); - CONNECTU(&C, changedGlobal, this, pi_cd_changedGlobal); - break; - case CDType::cdM: - CONNECTU(&M, sended, this, pi_cd_sendSucceed); - CONNECTU(&M, sendFailed, this, pi_cd_sendFailed); - CONNECTU(&M, received, this, pi_cd_receiveSucceed); - CONNECTU(&M, receiveFailed, this, pi_cd_receiveFailed); - CONNECTU(&M, changedGlobal, this, pi_cd_changedGlobal); - CONNECTU(&M, messageReceived, this, pi_cd_messageReceived); - break; - default: break; - } - -} - - -void CDView::mousePressEvent(QMouseEvent * e) { - if (type_ == CDType::cdC) { - QModelIndex i = indexAt(e->pos()); - if (i.isValid() && i.column() == cName_Cmd) - update(i); - } - QTreeView::mousePressEvent(e); -} - - -void CDView::mouseReleaseEvent(QMouseEvent * e) { - if (type_ == CDType::cdC) { - QModelIndex i = indexAt(e->pos()); - if (i.isValid() && i.column() == cName_Cmd) - update(i); - } - QTreeView::mouseReleaseEvent(e); -} - - -void CDView::currentChanged(const QModelIndex & cur, const QModelIndex & prev) { - if (type_ == CDType::cdC) { - if (prev.isValid() && prev.column() == cName_Cmd) - update(prev); - } - QTreeView::currentChanged(cur, prev); -} - - -void CDView::refresh() { - if (type_ < 0) return; - if (!model_) { - model_ = new CDItemModel(type_); - proxy_ = new QSortFilterProxyModel(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) - proxy_->setRecursiveFilteringEnabled(true); -#endif - proxy_->setFilterKeyColumn(-1); - proxy_->setFilterCaseSensitivity(Qt::CaseInsensitive); - proxy_->setSourceModel(model_); - setModel(proxy_); - setItemDelegateForColumn(type_ == CDType::cdC ? cName_Cmd : cValue, new CDDelegate()); - if (type_ == CDType::cdX) - setItemDelegateForColumn(cXMode, new CDDelegate()); - } - model_->rebuildModel(); - switch ((CDType::cdT)type_) { - case CDType::cdK: - setColumnHidden(cXMode, true); - setColumnHidden(cXAvg, true); - break; - case CDType::cdX: - setColumnHidden(cExpression, true); - break; - case CDType::cdC: - case CDType::cdM: - setColumnHidden(cType, true); - setColumnHidden(cXMode, true); - setColumnHidden(cXAvg, true); - setColumnHidden(cExpression, true); - setColumnHidden(cValue, true); - break; - default: break; - } - expandAll(); - for (int i = 0; i < model_->columnCount(); i++) resizeColumnToContents(i); -} - - -void CDView::refreshValues() { - if (!model_) return; - model_->dataChanged(model_->index(0, 0), model_->index(model_->columnCount() - 1, model_->rowCount() - 1)); -} - - -void CDView::setFile(const QString & filename) { - switch ((CDType::cdT)type_) { - case CDType::cdK: K.setFileName(Q2PIString(filename)); break; - case CDType::cdX: X.setFileName(Q2PIString(filename)); break; - case CDType::cdC: C.setFileName(Q2PIString(filename)); break; - case CDType::cdM: M.setFileName(Q2PIString(filename)); break; - default: break; - } -} - - -bool CDView::inProgress() const { - switch ((CDType::cdT)type_) { - case CDType::cdK: return K.inProgress(); break; - case CDType::cdX: return X.inProgress(); break; - case CDType::cdC: return C.inProgress(); break; - case CDType::cdM: return M.inProgress(); break; - default: break; - } - return false; -} - - -void CDView::startX(double freq) { - switch ((CDType::cdT)type_) { - case CDType::cdX: X.start(freq); break; - default: break; - } -} - - -CDSection * CDView::root() { - return CDCore::instance()->root((CDType::cdT)type_); -} - - -QString CDView::typeLetter() const { - return PI2QString(CDCore::instance()->typeLetter((CDType::cdT)type_)); -} - - -void CDView::send() { - busyStatusChanged(true); - switch ((CDType::cdT)type_) { - case CDType::cdK: K.send(); break; - case CDType::cdX: X.send(); break; - case CDType::cdC: C.send(); break; - case CDType::cdM: M.send(); break; - default: break; - } -} - - -void CDView::receive() { - busyStatusChanged(true); - switch ((CDType::cdT)type_) { - case CDType::cdK: K.request(); break; - case CDType::cdX: X.request(); break; - case CDType::cdC: C.request(); break; - case CDType::cdM: M.request(); break; - default: break; - } -} - - -void CDView::save() { - switch ((CDType::cdT)type_) { - case CDType::cdK: K.writeFile(); break; - case CDType::cdX: X.writeFile(); break; - case CDType::cdC: C.writeFile(); break; - case CDType::cdM: M.writeFile(); break; - default: break; - } -} - - -void CDView::load() { - switch ((CDType::cdT)type_) { - case CDType::cdK: - K.readFile(); - K.calculate(); - break; - case CDType::cdX: - X.readFile(); - X.calculate(); - break; - case CDType::cdC: - C.readFile(); - C.calculate(); - break; - case CDType::cdM: - M.readFile(); - M.calculate(); - break; - default: break; - } - refresh(); -} - - -void CDView::clear() { - //piCout << "clearK"; - switch ((CDType::cdT)type_) { - case CDType::cdK: K.root() = CDSection(); break; - case CDType::cdX: X.root() = CDSection(); break; - case CDType::cdC: C.root() = CDSection(); break; - case CDType::cdM: M.root() = CDSection(); break; - default: break; - } - refresh(); -} - - -void CDView::buildFromHeader(const QString & description, int mode) { - if (description.isEmpty()) return; - PIString desc_file = Q2PIString(QDir::current().relativeFilePath(description)); - PIFile f(desc_file, PIIODevice::ReadOnly); - switch ((CDType::cdT)type_) { - case CDType::cdK: K.update(&f, mode); break; - case CDType::cdX: X.update(&f, mode); break; - case CDType::cdC: C.update(&f, mode); break; - case CDType::cdM: M.update(&f, mode); break; - default: break; - } - refresh(); -} - - -void CDView::calculate() { - switch ((CDType::cdT)type_) { - case CDType::cdK: K.calculate(); break; - case CDType::cdX: X.calculate(); break; - case CDType::cdC: C.calculate(); break; - case CDType::cdM: M.calculate(); break; - default: break; - } -} - - -void CDView::filter(const QString & f) { - proxy_->setFilterRegExp(QRegExp(f, Qt::CaseInsensitive)); -} - - -void CDView::indexClicked(const QModelIndex & i) { - if (!model_ || !i.isValid() || type_ != CDType::cdC || i.column() != cName_Cmd) return; - CDItem * item = model_->getItem(i); - if (!item) return; - if (item->itemType() != CDItem::ItemCDType) return; - CDType & t(model_->interface->section(item->buildPath())[item->index()]); - C.sendCommand(t); - emit commandSended(PI2QString(t.pathString().join("."))); - //piCout << t; - qDebug() << PI2QString(t.pathString().join(".")); -} - - -void CDView::cd_sendFailed() { - busyStatusChanged(false); - emit messageStatus("send failed"); - emit sendFailed(); -} - - -void CDView::cd_sendSucceed() { - busyStatusChanged(false); - emit messageStatus("send success"); - emit sendSucceed(); -} - - -void CDView::cd_receiveFailed() { - busyStatusChanged(false); - emit messageStatus("receive failed"); - emit receiveFailed(); -} - - -void CDView::cd_receiveSucceed() { - refresh(); - busyStatusChanged(false); - emit messageStatus("receive success"); - emit receiveSucceed(); -} - - -void CDView::cd_receivedX() { - X.lock(); - PIVector > xl = X.enabledList(); - //piCout << "X" << xl.size(); - piForeachC (PIDeque & x, xl) { - CDType & t(X[x]); - //piCout << t; - //piCout << t.path(); - if (t.cd_type() != CDType::cdX) continue; - update(model_->indexByPath(t.path(), cValue)); - //piCout << CDCore::pathToString(t.path()) << t.toDouble() << "model"; - //qDebug() << "val" << model_->data(model_->indexByPath(t.path(), cValue), Qt::DisplayRole).toDouble(); - } - X.unlock(); - emit receivedX(); -} - - -void CDView::cd_changedGlobal() { - emit changedGlobal(); -} - - -void CDView::pi_cd_messageReceived(PIDeque path, int type, PIString msg) { - QMetaObject::invokeMethod(this, "messageReceived", Qt::QueuedConnection, - Q_ARG(QString, PI2QString(CDCore::pathToString(path))), - Q_ARG(int, type), - Q_ARG(QString, PI2QString(msg))); -} +#include +#include +#include +#include "cdutils_k.h" +#include "cdutils_x.h" +#include "cdutils_c.h" +#include "cdutils_m.h" +#include "cdutils_core.h" +#include "qcd_view.h" +#include "qcd_model.h" +#include "piqt.h" +#include "pifile.h" + +using namespace CDUtils; + + +CDView::CDView(QWidget * parent) : QTreeView(parent) { + type_ = -1; + model_ = 0; + proxy_ = 0; + connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(indexClicked(QModelIndex))); + connect(this, SIGNAL(_qcd_sendFailed()), this, SLOT(cd_sendFailed()), Qt::QueuedConnection); + connect(this, SIGNAL(_qcd_sendSucceed()), this, SLOT(cd_sendSucceed()), Qt::QueuedConnection); + connect(this, SIGNAL(_qcd_receiveFailed()), this, SLOT(cd_receiveFailed()), Qt::QueuedConnection); + connect(this, SIGNAL(_qcd_receiveSucceed()), this, SLOT(cd_receiveSucceed()), Qt::QueuedConnection); + connect(this, SIGNAL(_qcd_receivedX()), this, SLOT(cd_receivedX()), Qt::QueuedConnection); + connect(this, SIGNAL(_qcd_changedGlobal()), this, SLOT(cd_changedGlobal()), Qt::QueuedConnection); +} + + +CDView::~CDView() { + if (model_) { + delete model_; + delete proxy_; + } + model_ = 0; + proxy_ = 0; +} + + +void CDView::setType(int cdt) { + if (cdt < 0) return; + if (type_ >= 0) return; + type_ = cdt; + switch ((CDType::cdT)type_) { + case CDType::cdK: + CONNECTU(&K, sended, this, pi_cd_sendSucceed); + CONNECTU(&K, sendFailed, this, pi_cd_sendFailed); + CONNECTU(&K, received, this, pi_cd_receiveSucceed); + CONNECTU(&K, receiveFailed, this, pi_cd_receiveFailed); + CONNECTU(&K, changedGlobal, this, pi_cd_changedGlobal); + break; + case CDType::cdX: + CONNECTU(&X, sended, this, pi_cd_sendSucceed); + CONNECTU(&X, sendFailed, this, pi_cd_sendFailed); + CONNECTU(&X, received, this, pi_cd_receiveSucceed); + CONNECTU(&X, receiveFailed, this, pi_cd_receiveFailed); + CONNECTU(&X, receivedX, this, pi_cd_receivedX); + CONNECTU(&X, changedGlobal, this, pi_cd_changedGlobal); + break; + case CDType::cdC: + CONNECTU(&C, sended, this, pi_cd_sendSucceed); + CONNECTU(&C, sendFailed, this, pi_cd_sendFailed); + CONNECTU(&C, received, this, pi_cd_receiveSucceed); + CONNECTU(&C, receiveFailed, this, pi_cd_receiveFailed); + CONNECTU(&C, changedGlobal, this, pi_cd_changedGlobal); + break; + case CDType::cdM: + CONNECTU(&M, sended, this, pi_cd_sendSucceed); + CONNECTU(&M, sendFailed, this, pi_cd_sendFailed); + CONNECTU(&M, received, this, pi_cd_receiveSucceed); + CONNECTU(&M, receiveFailed, this, pi_cd_receiveFailed); + CONNECTU(&M, changedGlobal, this, pi_cd_changedGlobal); + CONNECTU(&M, messageReceived, this, pi_cd_messageReceived); + break; + default: break; + } + +} + + +void CDView::mousePressEvent(QMouseEvent * e) { + if (type_ == CDType::cdC) { + QModelIndex i = indexAt(e->pos()); + if (i.isValid() && i.column() == cName_Cmd) + update(i); + } + QTreeView::mousePressEvent(e); +} + + +void CDView::mouseReleaseEvent(QMouseEvent * e) { + if (type_ == CDType::cdC) { + QModelIndex i = indexAt(e->pos()); + if (i.isValid() && i.column() == cName_Cmd) + update(i); + } + QTreeView::mouseReleaseEvent(e); +} + + +void CDView::currentChanged(const QModelIndex & cur, const QModelIndex & prev) { + if (type_ == CDType::cdC) { + if (prev.isValid() && prev.column() == cName_Cmd) + update(prev); + } + QTreeView::currentChanged(cur, prev); +} + + +void CDView::refresh() { + if (type_ < 0) return; + if (!model_) { + model_ = new CDItemModel(type_); + proxy_ = new QSortFilterProxyModel(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + proxy_->setRecursiveFilteringEnabled(true); +#endif + proxy_->setFilterKeyColumn(-1); + proxy_->setFilterCaseSensitivity(Qt::CaseInsensitive); + proxy_->setSourceModel(model_); + setModel(proxy_); + setItemDelegateForColumn(type_ == CDType::cdC ? cName_Cmd : cValue, new CDDelegate()); + if (type_ == CDType::cdX) + setItemDelegateForColumn(cXMode, new CDDelegate()); + } + model_->rebuildModel(); + switch ((CDType::cdT)type_) { + case CDType::cdK: + setColumnHidden(cXMode, true); + setColumnHidden(cXAvg, true); + break; + case CDType::cdX: + setColumnHidden(cExpression, true); + break; + case CDType::cdC: + case CDType::cdM: + setColumnHidden(cType, true); + setColumnHidden(cXMode, true); + setColumnHidden(cXAvg, true); + setColumnHidden(cExpression, true); + setColumnHidden(cValue, true); + break; + default: break; + } + expandAll(); + for (int i = 0; i < model_->columnCount(); i++) resizeColumnToContents(i); +} + + +void CDView::refreshValues() { + if (!model_) return; + model_->dataChanged(model_->index(0, 0), model_->index(model_->columnCount() - 1, model_->rowCount() - 1)); +} + + +void CDView::setFile(const QString & filename) { + switch ((CDType::cdT)type_) { + case CDType::cdK: K.setFileName(Q2PIString(filename)); break; + case CDType::cdX: X.setFileName(Q2PIString(filename)); break; + case CDType::cdC: C.setFileName(Q2PIString(filename)); break; + case CDType::cdM: M.setFileName(Q2PIString(filename)); break; + default: break; + } +} + + +bool CDView::inProgress() const { + switch ((CDType::cdT)type_) { + case CDType::cdK: return K.inProgress(); break; + case CDType::cdX: return X.inProgress(); break; + case CDType::cdC: return C.inProgress(); break; + case CDType::cdM: return M.inProgress(); break; + default: break; + } + return false; +} + + +void CDView::startX(double freq) { + switch ((CDType::cdT)type_) { + case CDType::cdX: X.start(freq); break; + default: break; + } +} + + +CDSection * CDView::root() { + return CDCore::instance()->root((CDType::cdT)type_); +} + + +QString CDView::typeLetter() const { + return PI2QString(CDCore::instance()->typeLetter((CDType::cdT)type_)); +} + + +void CDView::send() { + busyStatusChanged(true); + switch ((CDType::cdT)type_) { + case CDType::cdK: K.send(); break; + case CDType::cdX: X.send(); break; + case CDType::cdC: C.send(); break; + case CDType::cdM: M.send(); break; + default: break; + } +} + + +void CDView::receive() { + busyStatusChanged(true); + switch ((CDType::cdT)type_) { + case CDType::cdK: K.request(); break; + case CDType::cdX: X.request(); break; + case CDType::cdC: C.request(); break; + case CDType::cdM: M.request(); break; + default: break; + } +} + + +void CDView::save() { + switch ((CDType::cdT)type_) { + case CDType::cdK: K.writeFile(); break; + case CDType::cdX: X.writeFile(); break; + case CDType::cdC: C.writeFile(); break; + case CDType::cdM: M.writeFile(); break; + default: break; + } +} + + +void CDView::load() { + switch ((CDType::cdT)type_) { + case CDType::cdK: + K.readFile(); + K.calculate(); + break; + case CDType::cdX: + X.readFile(); + X.calculate(); + break; + case CDType::cdC: + C.readFile(); + C.calculate(); + break; + case CDType::cdM: + M.readFile(); + M.calculate(); + break; + default: break; + } + refresh(); +} + + +void CDView::clear() { + //piCout << "clearK"; + switch ((CDType::cdT)type_) { + case CDType::cdK: K.root() = CDSection(); break; + case CDType::cdX: X.root() = CDSection(); break; + case CDType::cdC: C.root() = CDSection(); break; + case CDType::cdM: M.root() = CDSection(); break; + default: break; + } + refresh(); +} + + +void CDView::buildFromHeader(const QString & description, int mode) { + if (description.isEmpty()) return; + PIString desc_file = Q2PIString(QDir::current().relativeFilePath(description)); + PIFile f(desc_file, PIIODevice::ReadOnly); + switch ((CDType::cdT)type_) { + case CDType::cdK: K.update(&f, mode); break; + case CDType::cdX: X.update(&f, mode); break; + case CDType::cdC: C.update(&f, mode); break; + case CDType::cdM: M.update(&f, mode); break; + default: break; + } + refresh(); +} + + +void CDView::calculate() { + switch ((CDType::cdT)type_) { + case CDType::cdK: K.calculate(); break; + case CDType::cdX: X.calculate(); break; + case CDType::cdC: C.calculate(); break; + case CDType::cdM: M.calculate(); break; + default: break; + } +} + + +void CDView::filter(const QString & f) { + proxy_->setFilterRegExp(QRegExp(f, Qt::CaseInsensitive)); +} + + +void CDView::indexClicked(const QModelIndex & i) { + if (!model_ || !i.isValid() || type_ != CDType::cdC || i.column() != cName_Cmd) return; + CDItem * item = model_->getItem(i); + if (!item) return; + if (item->itemType() != CDItem::ItemCDType) return; + CDType & t(model_->interface->section(item->buildPath())[item->index()]); + C.sendCommand(t); + emit commandSended(PI2QString(t.pathString().join("."))); + //piCout << t; + qDebug() << PI2QString(t.pathString().join(".")); +} + + +void CDView::cd_sendFailed() { + busyStatusChanged(false); + emit messageStatus("send failed"); + emit sendFailed(); +} + + +void CDView::cd_sendSucceed() { + busyStatusChanged(false); + emit messageStatus("send success"); + emit sendSucceed(); +} + + +void CDView::cd_receiveFailed() { + busyStatusChanged(false); + emit messageStatus("receive failed"); + emit receiveFailed(); +} + + +void CDView::cd_receiveSucceed() { + refresh(); + busyStatusChanged(false); + emit messageStatus("receive success"); + emit receiveSucceed(); +} + + +void CDView::cd_receivedX() { + X.lock(); + PIVector > xl = X.enabledList(); + //piCout << "X" << xl.size(); + piForeachC (PIDeque & x, xl) { + CDType & t(X[x]); + //piCout << t; + //piCout << t.path(); + if (t.cd_type() != CDType::cdX) continue; + update(model_->indexByPath(t.path(), cValue)); + //piCout << CDCore::pathToString(t.path()) << t.toDouble() << "model"; + //qDebug() << "val" << model_->data(model_->indexByPath(t.path(), cValue), Qt::DisplayRole).toDouble(); + } + X.unlock(); + emit receivedX(); +} + + +void CDView::cd_changedGlobal() { + emit changedGlobal(); +} + + +void CDView::pi_cd_messageReceived(PIDeque path, int type, PIString msg) { + QMetaObject::invokeMethod(this, "messageReceived", Qt::QueuedConnection, + Q_ARG(QString, PI2QString(CDCore::pathToString(path))), + Q_ARG(int, type), + Q_ARG(QString, PI2QString(msg))); +} diff --git a/qcd_utils/qcd_view.h b/piqt/libs/qcd/qcd_view.h similarity index 96% rename from qcd_utils/qcd_view.h rename to piqt/libs/qcd/qcd_view.h index 76d2130..50faaa5 100644 --- a/qcd_utils/qcd_view.h +++ b/piqt/libs/qcd/qcd_view.h @@ -1,112 +1,112 @@ -/* - QCD Utils - Qt bindings/utilites for CD Utils - - Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . -*/ - -#ifndef QCD_VIEW_H -#define QCD_VIEW_H - -#include "piobject.h" -#include - -namespace CDUtils { - class CDType; - class CDSection; -} - -class CDItemModel; -class QSortFilterProxyModel; - -class CDView: public QTreeView, public PIObject -{ - Q_OBJECT - PIOBJECT(CDView) -public: - explicit CDView(QWidget *parent = 0); - ~CDView(); - - void setType(int cdt); - void setFile(const QString & filename); - bool inProgress() const; - void startX(double freq = 20.); - CDUtils::CDSection * root(); - QString typeLetter() const; - - CDItemModel * CDModel() {return model_;} - -protected: - void mousePressEvent(QMouseEvent * ); - void mouseReleaseEvent(QMouseEvent * ); - void currentChanged(const QModelIndex & cur, const QModelIndex & prev); - -public slots: - void refresh(); - void refreshValues(); - void send(); - void receive(); - void save(); - void load(); - void clear(); - void buildFromHeader(const QString & description, int mode = 2); - void calculate(); - void filter(const QString & f); - -private slots: - void indexClicked(const QModelIndex & i); - void cd_sendFailed(); - void cd_sendSucceed(); - void cd_receiveFailed(); - void cd_receiveSucceed(); - void cd_receivedX(); - void cd_changedGlobal(); - -private: - bool filterTree(const QModelIndex & ti, const QString & filter); - EVENT_HANDLER(void, pi_cd_sendFailed) {emit _qcd_sendFailed();} - EVENT_HANDLER(void, pi_cd_sendSucceed) {emit _qcd_sendSucceed();} - EVENT_HANDLER(void, pi_cd_receiveFailed) {emit _qcd_receiveFailed();} - EVENT_HANDLER(void, pi_cd_receiveSucceed) {emit _qcd_receiveSucceed();} - EVENT_HANDLER(void, pi_cd_receivedX) {emit _qcd_receivedX();} - EVENT_HANDLER(void, pi_cd_changedGlobal) {emit _qcd_changedGlobal();} - EVENT_HANDLER3(void, pi_cd_messageReceived, PIDeque, path, int, type, PIString, msg); - - CDItemModel * model_; - QSortFilterProxyModel * proxy_; - int type_; - -signals: - void sendFailed(); - void sendSucceed(); - void receiveFailed(); - void receiveSucceed(); - void receivedX(); - void changedGlobal(); - void messageStatus(QString msg); - void commandSended(QString msg); - void messageReceived(QString path, int type, QString msg); - void busyStatusChanged(bool busy); - - void _qcd_sendFailed(); // PRIVATE - void _qcd_sendSucceed(); // PRIVATE - void _qcd_receiveFailed(); // PRIVATE - void _qcd_receiveSucceed(); // PRIVATE - void _qcd_receivedX(); // PRIVATE - void _qcd_changedGlobal(); // PRIVATE - -}; - -#endif // QCD_VIEW_H +/* + QCD Utils - Qt bindings/utilites for CD Utils + + Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ + +#ifndef QCD_VIEW_H +#define QCD_VIEW_H + +#include "piobject.h" +#include + +namespace CDUtils { + class CDType; + class CDSection; +} + +class CDItemModel; +class QSortFilterProxyModel; + +class CDView: public QTreeView, public PIObject +{ + Q_OBJECT + PIOBJECT(CDView) +public: + explicit CDView(QWidget *parent = 0); + ~CDView(); + + void setType(int cdt); + void setFile(const QString & filename); + bool inProgress() const; + void startX(double freq = 20.); + CDUtils::CDSection * root(); + QString typeLetter() const; + + CDItemModel * CDModel() {return model_;} + +protected: + void mousePressEvent(QMouseEvent * ); + void mouseReleaseEvent(QMouseEvent * ); + void currentChanged(const QModelIndex & cur, const QModelIndex & prev); + +public slots: + void refresh(); + void refreshValues(); + void send(); + void receive(); + void save(); + void load(); + void clear(); + void buildFromHeader(const QString & description, int mode = 2); + void calculate(); + void filter(const QString & f); + +private slots: + void indexClicked(const QModelIndex & i); + void cd_sendFailed(); + void cd_sendSucceed(); + void cd_receiveFailed(); + void cd_receiveSucceed(); + void cd_receivedX(); + void cd_changedGlobal(); + +private: + bool filterTree(const QModelIndex & ti, const QString & filter); + EVENT_HANDLER(void, pi_cd_sendFailed) {emit _qcd_sendFailed();} + EVENT_HANDLER(void, pi_cd_sendSucceed) {emit _qcd_sendSucceed();} + EVENT_HANDLER(void, pi_cd_receiveFailed) {emit _qcd_receiveFailed();} + EVENT_HANDLER(void, pi_cd_receiveSucceed) {emit _qcd_receiveSucceed();} + EVENT_HANDLER(void, pi_cd_receivedX) {emit _qcd_receivedX();} + EVENT_HANDLER(void, pi_cd_changedGlobal) {emit _qcd_changedGlobal();} + EVENT_HANDLER3(void, pi_cd_messageReceived, PIDeque, path, int, type, PIString, msg); + + CDItemModel * model_; + QSortFilterProxyModel * proxy_; + int type_; + +signals: + void sendFailed(); + void sendSucceed(); + void receiveFailed(); + void receiveSucceed(); + void receivedX(); + void changedGlobal(); + void messageStatus(QString msg); + void commandSended(QString msg); + void messageReceived(QString path, int type, QString msg); + void busyStatusChanged(bool busy); + + void _qcd_sendFailed(); // PRIVATE + void _qcd_sendSucceed(); // PRIVATE + void _qcd_receiveFailed(); // PRIVATE + void _qcd_receiveSucceed(); // PRIVATE + void _qcd_receivedX(); // PRIVATE + void _qcd_changedGlobal(); // PRIVATE + +}; + +#endif // QCD_VIEW_H diff --git a/piqt/libs/widgets/CMakeLists.txt b/piqt/libs/widgets/CMakeLists.txt new file mode 100644 index 0000000..d7e4002 --- /dev/null +++ b/piqt/libs/widgets/CMakeLists.txt @@ -0,0 +1,9 @@ +include(PIPMacros) +pip_code_model(CCM "${ROOT_DIR}/pip/libs/main/io_devices/piiodevice.h" "${ROOT_DIR}/pip/libs/main/io_utils/pipacketextractor.h" OPTIONS "-DPIP_EXPORT" "-Es") +piqt_library(piqt_utils "Gui" "qad_utils;qad_widgets;qad_blockview;piqt" ${CCM}) + +foreach(_v ${_QT_VERSIONS_}) + if (LOCAL_FOUND${_v}) + add_dependencies(piqt_utils${_v} pip_cmg) + endif() +endforeach() diff --git a/piqt_utils/piqt_connection_edit.cpp b/piqt/libs/widgets/piqt_connection_edit.cpp similarity index 100% rename from piqt_utils/piqt_connection_edit.cpp rename to piqt/libs/widgets/piqt_connection_edit.cpp diff --git a/piqt_utils/piqt_connection_edit.h b/piqt/libs/widgets/piqt_connection_edit.h similarity index 100% rename from piqt_utils/piqt_connection_edit.h rename to piqt/libs/widgets/piqt_connection_edit.h diff --git a/piqt_utils/piqt_connection_edit.ui b/piqt/libs/widgets/piqt_connection_edit.ui similarity index 100% rename from piqt_utils/piqt_connection_edit.ui rename to piqt/libs/widgets/piqt_connection_edit.ui diff --git a/piqt_utils/piqt_connection_view.cpp b/piqt/libs/widgets/piqt_connection_view.cpp similarity index 100% rename from piqt_utils/piqt_connection_view.cpp rename to piqt/libs/widgets/piqt_connection_view.cpp diff --git a/piqt_utils/piqt_connection_view.h b/piqt/libs/widgets/piqt_connection_view.h similarity index 100% rename from piqt_utils/piqt_connection_view.h rename to piqt/libs/widgets/piqt_connection_view.h diff --git a/piqt_utils/piqt_highlighter.cpp b/piqt/libs/widgets/piqt_highlighter.cpp similarity index 100% rename from piqt_utils/piqt_highlighter.cpp rename to piqt/libs/widgets/piqt_highlighter.cpp diff --git a/piqt_utils/piqt_highlighter.h b/piqt/libs/widgets/piqt_highlighter.h similarity index 100% rename from piqt_utils/piqt_highlighter.h rename to piqt/libs/widgets/piqt_highlighter.h diff --git a/piqt_utils/piqt_iodevice_edit.cpp b/piqt/libs/widgets/piqt_iodevice_edit.cpp similarity index 100% rename from piqt_utils/piqt_iodevice_edit.cpp rename to piqt/libs/widgets/piqt_iodevice_edit.cpp diff --git a/piqt_utils/piqt_iodevice_edit.h b/piqt/libs/widgets/piqt_iodevice_edit.h similarity index 100% rename from piqt_utils/piqt_iodevice_edit.h rename to piqt/libs/widgets/piqt_iodevice_edit.h diff --git a/piqt_utils/piqt_iodevice_edit_dialog.cpp b/piqt/libs/widgets/piqt_iodevice_edit_dialog.cpp similarity index 100% rename from piqt_utils/piqt_iodevice_edit_dialog.cpp rename to piqt/libs/widgets/piqt_iodevice_edit_dialog.cpp diff --git a/piqt_utils/piqt_iodevice_edit_dialog.h b/piqt/libs/widgets/piqt_iodevice_edit_dialog.h similarity index 100% rename from piqt_utils/piqt_iodevice_edit_dialog.h rename to piqt/libs/widgets/piqt_iodevice_edit_dialog.h diff --git a/piqt_utils/piqt_iodevice_edit_dialog.ui b/piqt/libs/widgets/piqt_iodevice_edit_dialog.ui similarity index 100% rename from piqt_utils/piqt_iodevice_edit_dialog.ui rename to piqt/libs/widgets/piqt_iodevice_edit_dialog.ui diff --git a/piqt_utils/qpiconnection.cpp b/piqt/libs/widgets/qpiconnection.cpp similarity index 100% rename from piqt_utils/qpiconnection.cpp rename to piqt/libs/widgets/qpiconnection.cpp diff --git a/piqt_utils/qpiconnection.h b/piqt/libs/widgets/qpiconnection.h similarity index 100% rename from piqt_utils/qpiconnection.h rename to piqt/libs/widgets/qpiconnection.h diff --git a/piqt/utils/CMakeLists.txt b/piqt/utils/CMakeLists.txt new file mode 100644 index 0000000..4dbf12d --- /dev/null +++ b/piqt/utils/CMakeLists.txt @@ -0,0 +1 @@ +add_directories("piqt_") diff --git a/piqt/utils/cd_pult/CMakeLists.txt b/piqt/utils/cd_pult/CMakeLists.txt new file mode 100644 index 0000000..1ffaae3 --- /dev/null +++ b/piqt/utils/cd_pult/CMakeLists.txt @@ -0,0 +1,14 @@ +project(cd_pult) +if(APPLE) + set(APP_ICON "") +elseif(WIN32) + set(APP_ICON "") +else() + set(APP_ICON "") +endif() +set(APP_INFO "CD Pult") +piqt_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;qad_graphic;qad_application;qcd_utils;piqt_utils") +if (Qt5_FOUND) + import_version(${PROJ_NAME}5 ${PROJECT_NAME}) + deploy_target(${PROJECT_NAME}5 DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${ROOT_DIR}/release) +endif() diff --git a/qcd_utils/pult/cddirectk.cpp b/piqt/utils/cd_pult/cddirectk.cpp similarity index 96% rename from qcd_utils/pult/cddirectk.cpp rename to piqt/utils/cd_pult/cddirectk.cpp index f2dc425..ce7e756 100644 --- a/qcd_utils/pult/cddirectk.cpp +++ b/piqt/utils/cd_pult/cddirectk.cpp @@ -1,312 +1,312 @@ -#include "cddirectk.h" -#include "ui_cddirectk_type_dialog.h" -#include "cdutils_core.h" -#include "cdutils_k.h" -#include "qcd_core.h" -#include "qcd_model.h" -#include "graphic.h" -#include "piqt.h" -#include "qvariantedit.h" -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace CDUtils; - - -KDockWidget::KDockWidget(QString title, QMainWindow * p): QDockWidget(title, p) { - da = p; - menu = new QMenu(this); - QAction * a = new QAction(QIcon(":/icons/document-edit.png"), "Rename ...", this); - connect(a, SIGNAL(triggered(bool)), this, SLOT(rename())); - dactions << a; - a = new QAction(QIcon(":/icons/edit-delete.png"), "Remove", this); - connect(a, SIGNAL(triggered(bool)), this, SIGNAL(removeRequest())); - dactions << a; - menu_k = new QMenu(this); - menu_k->setTitle(tr("Remove K")); - lay = new QFormLayout(); - lay->setContentsMargins(0, qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin), 0, 0); - lay->setLabelAlignment(Qt::AlignRight | Qt::AlignVCenter); - QWidget * w = new QWidget(); - w->setAcceptDrops(true); - w->installEventFilter(this); - w->setLayout(lay); - setWidget(w); - type_dialog = new CDDirectKTypeDialog(); -} - - -void KDockWidget::addK(const CDType & t, CDDirectKTypeDialog::TypeInfo ti) { - if (t.cd_type() != CDType::cdK) return; - PIDeque xp = t.path(); - if (k_list.contains(xp)) return; - k_list << xp; - info_list << ti; - //piCout << "add" << xp; - QWidget * ve = ti.create(); - //qDebug() << "add" << ve; - lay->addRow(PI2QString(t.pathString().join(".")) + ":", ve); - QCDCore::instance()->bindWidget(ve, t); - //ve->setValue(); -} - - -QByteArray KDockWidget::save() const { - ChunkStream cs; - cs.add(1, windowTitle()) - .add(2, getList(k_list)) - .add(3, info_list); - return cs.data(); -} - - -void KDockWidget::load(QByteArray ba) { - clear(); - if (ba.isEmpty()) return; - ChunkStream cs(ba); - PIVector > list; - QVector ilist; - while (!cs.atEnd()) { - switch (cs.read()) { - case 1: setWindowTitle(cs.getData()); break; - case 2: list = setList(cs.getData()); break; - case 3: ilist = cs.getData >(); break; - default: break; - } - } - ilist.resize(list.size()); - for (int i = 0; i < list.size_s(); ++i) { - addK(K[list[i]], ilist[i]); - } -} - - -void KDockWidget::clear() { - while (lay->rowCount() > 0) - removeRow(0); - k_list.clear(); - info_list.clear(); -} - - -void KDockWidget::changedGlobal() { - //piCout << "changedGlobal ..." << k_list.size_s() << info_list.size() << lay->count() << lay->rowCount(); - for (int i = 0; i < k_list.size_s(); ++i) { - //piCout << "update" << i << "0"; - if (!K.exists(k_list[i])) { - k_list.remove(i); - info_list.remove(i); - removeRow(i); - --i; - continue; - } - //piCout << "update" << i << "1"; - QLabel * lbl = qobject_cast(lay->itemAt(i, QFormLayout::LabelRole)->widget()); - //piCout << "update" << i << "2"; - if (lbl) lbl->setText(PI2QString(K[k_list[i]].pathString().join(".")) + ":"); - //piCout << "update" << i << "3"; - } - //piCout << "changedGlobal ok"; -} - - -bool KDockWidget::eventFilter(QObject * o, QEvent * e) { - //if (o == graphic->viewport()) { - switch (e->type()) { - case QEvent::DragMove: { - QDragMoveEvent * de = (QDragMoveEvent*)e; - const QMimeData * mime = de->mimeData(); - if (!mime) break; - if (!mime->text().startsWith("k")) break; - de->setDropAction(Qt::CopyAction); - de->accept(); - return true; - } break; - case QEvent::DragEnter: { - QDragEnterEvent * de = (QDragEnterEvent*)e; - const QMimeData * mime = de->mimeData(); - if (!mime) break; - if (!mime->text().startsWith("k")) break; - de->setDropAction(Qt::CopyAction); - de->accept(); - return true; - } break; - case QEvent::Drop: { - QDropEvent * de = (QDropEvent*)e; - const QMimeData * mime = de->mimeData(); - if (!mime) break; - //qDebug() << "drop" << mime->text(); - if (!mime->text().startsWith("k")) break; - CDDirectKTypeDialog::TypeInfo ti; - CDType & k(K[CDCore::stringToPath(Q2PIString(mime->text().mid(1)))]); - if (k.type().left(1) == "n" || k.type().left(1) == "f") { - if (type_dialog->exec() == QDialog::Accepted) - ti = type_dialog->getType(); - else - return true; - } - addK(k, ti); - de->accept(); - return true; - } break; - default: break; - } - //} - return QWidget::eventFilter(o, e); -} - - -void KDockWidget::contextMenuEvent(QContextMenuEvent * e) { - qDeleteAll(menu_k->actions()); - menu_k->clear(); - for (int i = 0; i < k_list.size_s(); ++i) { - QAction * a = new QAction(PI2QString(K[k_list[i]].pathString().join(".")), this); - a->setData(i); - connect(a, SIGNAL(triggered(bool)), this, SLOT(removeK())); - menu_k->addAction(a); - } - QMenu * mwm = da->createPopupMenu(); - menu->clear(); - menu->addActions(dactions); - menu->addMenu(menu_k); - menu->addSeparator(); - menu->addActions(mwm->actions()); - menu->popup(e->globalPos()); - mwm->deleteLater(); -} - - -void KDockWidget::removeRow(int r) { - if (r < 0 || r >= lay->rowCount()) return; -#if QT_VERSION >= 0x050800 - QFormLayout::TakeRowResult rr = lay->takeRow(r); - if (rr.fieldItem) {delete rr.fieldItem->widget(); delete rr.fieldItem;} - if (rr.labelItem) {delete rr.labelItem->widget(); delete rr.labelItem;} -#else - piForTimes (2) { - QLayoutItem * i = lay->itemAt(r+r); - lay->removeItem(i); - if (i) {delete i->widget(); delete i;} - } -#endif -} - - -void KDockWidget::rename() { - QString nn = QInputDialog::getText(this, tr("Rename area"), tr("New area name:"), - QLineEdit::Normal, windowTitle()); - if (nn.isEmpty()) return; - setWindowTitle(nn); -} - - -void KDockWidget::removeK() { - QAction * a = qobject_cast(sender()); - if (!a) return; - int ind = a->data().toInt(); - if (ind < 0 || ind >= k_list.size_s()) return; - k_list.remove(ind); - if (ind >= 0 && ind < info_list.size()) - info_list.remove(ind); - removeRow(ind); -} - - - - -CDDirectK::CDDirectK(QWidget * parent) : QWidget(parent), Ui::CDDirectK() { - setupUi(this); - da = new QMainWindow(); - da->setWindowFlags(frame->windowFlags()); - da->setDockNestingEnabled(true); - layoutMain->addWidget(da); -} - - -CDDirectK::~CDDirectK() { -} - - -void CDDirectK::reset() { - qDeleteAll(docks); - docks.clear(); -} - - -QByteArray CDDirectK::save() const { - ChunkStream cs; - QVector dstates; - foreach (KDockWidget * d, docks) { - dstates << d->save(); - } - cs.add(1, docks.size()) - .add(2, dstates) - .add(3, da->saveState()); - return cs.data(); -} - - -void CDDirectK::load(QByteArray ba) { - reset(); - if (ba.isEmpty()) return; - ChunkStream cs(ba); - while (!cs.atEnd()) { - switch (cs.read()) { - case 1: { - int s = cs.getData(); - piForTimes (s) - addArea(); - } break; - case 2: { - QVector dstates = cs.getData >(); - for (int i = 0; i < piMini(dstates.size(), docks.size()); ++i) - docks[i]->load(dstates[i]); - } break; - case 3: da->restoreState(cs.getData()); break; - default: break; - } - } -} - - -void CDDirectK::addArea() { - KDockWidget * dw = new KDockWidget(QString("area %1").arg(docks.size()), da); - connect(dw, SIGNAL(removeRequest()), this, SLOT(removeArea())); - da->addDockWidget(Qt::RightDockWidgetArea, dw); - docks << dw; - for (int i = 0; i < docks.size(); ++i) - docks[i]->setObjectName(QString("dock_%1").arg(i)); -} - - -void CDDirectK::changedGlobal() { - foreach (KDockWidget * d, docks) - d->changedGlobal(); -} - - -void CDDirectK::removeArea() { - KDockWidget * d = qobject_cast(sender()); - if (!d) return; - docks.removeAll(d); - d->deleteLater(); - for (int i = 0; i < docks.size(); ++i) - docks[i]->setObjectName(QString("dock_%1").arg(i)); -} - - -void CDDirectK::on_buttonAdd_clicked() { - addArea(); -} - - -void CDDirectK::on_buttonRemoveAll_clicked() { - qDeleteAll(docks); - docks.clear(); -} +#include "cddirectk.h" +#include "ui_cddirectk_type_dialog.h" +#include "cdutils_core.h" +#include "cdutils_k.h" +#include "qcd_core.h" +#include "qcd_model.h" +#include "graphic.h" +#include "piqt.h" +#include "qvariantedit.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace CDUtils; + + +KDockWidget::KDockWidget(QString title, QMainWindow * p): QDockWidget(title, p) { + da = p; + menu = new QMenu(this); + QAction * a = new QAction(QIcon(":/icons/document-edit.png"), "Rename ...", this); + connect(a, SIGNAL(triggered(bool)), this, SLOT(rename())); + dactions << a; + a = new QAction(QIcon(":/icons/edit-delete.png"), "Remove", this); + connect(a, SIGNAL(triggered(bool)), this, SIGNAL(removeRequest())); + dactions << a; + menu_k = new QMenu(this); + menu_k->setTitle(tr("Remove K")); + lay = new QFormLayout(); + lay->setContentsMargins(0, qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin), 0, 0); + lay->setLabelAlignment(Qt::AlignRight | Qt::AlignVCenter); + QWidget * w = new QWidget(); + w->setAcceptDrops(true); + w->installEventFilter(this); + w->setLayout(lay); + setWidget(w); + type_dialog = new CDDirectKTypeDialog(); +} + + +void KDockWidget::addK(const CDType & t, CDDirectKTypeDialog::TypeInfo ti) { + if (t.cd_type() != CDType::cdK) return; + PIDeque xp = t.path(); + if (k_list.contains(xp)) return; + k_list << xp; + info_list << ti; + //piCout << "add" << xp; + QWidget * ve = ti.create(); + //qDebug() << "add" << ve; + lay->addRow(PI2QString(t.pathString().join(".")) + ":", ve); + QCDCore::instance()->bindWidget(ve, t); + //ve->setValue(); +} + + +QByteArray KDockWidget::save() const { + ChunkStream cs; + cs.add(1, windowTitle()) + .add(2, getList(k_list)) + .add(3, info_list); + return cs.data(); +} + + +void KDockWidget::load(QByteArray ba) { + clear(); + if (ba.isEmpty()) return; + ChunkStream cs(ba); + PIVector > list; + QVector ilist; + while (!cs.atEnd()) { + switch (cs.read()) { + case 1: setWindowTitle(cs.getData()); break; + case 2: list = setList(cs.getData()); break; + case 3: ilist = cs.getData >(); break; + default: break; + } + } + ilist.resize(list.size()); + for (int i = 0; i < list.size_s(); ++i) { + addK(K[list[i]], ilist[i]); + } +} + + +void KDockWidget::clear() { + while (lay->rowCount() > 0) + removeRow(0); + k_list.clear(); + info_list.clear(); +} + + +void KDockWidget::changedGlobal() { + //piCout << "changedGlobal ..." << k_list.size_s() << info_list.size() << lay->count() << lay->rowCount(); + for (int i = 0; i < k_list.size_s(); ++i) { + //piCout << "update" << i << "0"; + if (!K.exists(k_list[i])) { + k_list.remove(i); + info_list.remove(i); + removeRow(i); + --i; + continue; + } + //piCout << "update" << i << "1"; + QLabel * lbl = qobject_cast(lay->itemAt(i, QFormLayout::LabelRole)->widget()); + //piCout << "update" << i << "2"; + if (lbl) lbl->setText(PI2QString(K[k_list[i]].pathString().join(".")) + ":"); + //piCout << "update" << i << "3"; + } + //piCout << "changedGlobal ok"; +} + + +bool KDockWidget::eventFilter(QObject * o, QEvent * e) { + //if (o == graphic->viewport()) { + switch (e->type()) { + case QEvent::DragMove: { + QDragMoveEvent * de = (QDragMoveEvent*)e; + const QMimeData * mime = de->mimeData(); + if (!mime) break; + if (!mime->text().startsWith("k")) break; + de->setDropAction(Qt::CopyAction); + de->accept(); + return true; + } break; + case QEvent::DragEnter: { + QDragEnterEvent * de = (QDragEnterEvent*)e; + const QMimeData * mime = de->mimeData(); + if (!mime) break; + if (!mime->text().startsWith("k")) break; + de->setDropAction(Qt::CopyAction); + de->accept(); + return true; + } break; + case QEvent::Drop: { + QDropEvent * de = (QDropEvent*)e; + const QMimeData * mime = de->mimeData(); + if (!mime) break; + //qDebug() << "drop" << mime->text(); + if (!mime->text().startsWith("k")) break; + CDDirectKTypeDialog::TypeInfo ti; + CDType & k(K[CDCore::stringToPath(Q2PIString(mime->text().mid(1)))]); + if (k.type().left(1) == "n" || k.type().left(1) == "f") { + if (type_dialog->exec() == QDialog::Accepted) + ti = type_dialog->getType(); + else + return true; + } + addK(k, ti); + de->accept(); + return true; + } break; + default: break; + } + //} + return QWidget::eventFilter(o, e); +} + + +void KDockWidget::contextMenuEvent(QContextMenuEvent * e) { + qDeleteAll(menu_k->actions()); + menu_k->clear(); + for (int i = 0; i < k_list.size_s(); ++i) { + QAction * a = new QAction(PI2QString(K[k_list[i]].pathString().join(".")), this); + a->setData(i); + connect(a, SIGNAL(triggered(bool)), this, SLOT(removeK())); + menu_k->addAction(a); + } + QMenu * mwm = da->createPopupMenu(); + menu->clear(); + menu->addActions(dactions); + menu->addMenu(menu_k); + menu->addSeparator(); + menu->addActions(mwm->actions()); + menu->popup(e->globalPos()); + mwm->deleteLater(); +} + + +void KDockWidget::removeRow(int r) { + if (r < 0 || r >= lay->rowCount()) return; +#if QT_VERSION >= 0x050800 + QFormLayout::TakeRowResult rr = lay->takeRow(r); + if (rr.fieldItem) {delete rr.fieldItem->widget(); delete rr.fieldItem;} + if (rr.labelItem) {delete rr.labelItem->widget(); delete rr.labelItem;} +#else + piForTimes (2) { + QLayoutItem * i = lay->itemAt(r+r); + lay->removeItem(i); + if (i) {delete i->widget(); delete i;} + } +#endif +} + + +void KDockWidget::rename() { + QString nn = QInputDialog::getText(this, tr("Rename area"), tr("New area name:"), + QLineEdit::Normal, windowTitle()); + if (nn.isEmpty()) return; + setWindowTitle(nn); +} + + +void KDockWidget::removeK() { + QAction * a = qobject_cast(sender()); + if (!a) return; + int ind = a->data().toInt(); + if (ind < 0 || ind >= k_list.size_s()) return; + k_list.remove(ind); + if (ind >= 0 && ind < info_list.size()) + info_list.remove(ind); + removeRow(ind); +} + + + + +CDDirectK::CDDirectK(QWidget * parent) : QWidget(parent), Ui::CDDirectK() { + setupUi(this); + da = new QMainWindow(); + da->setWindowFlags(frame->windowFlags()); + da->setDockNestingEnabled(true); + layoutMain->addWidget(da); +} + + +CDDirectK::~CDDirectK() { +} + + +void CDDirectK::reset() { + qDeleteAll(docks); + docks.clear(); +} + + +QByteArray CDDirectK::save() const { + ChunkStream cs; + QVector dstates; + foreach (KDockWidget * d, docks) { + dstates << d->save(); + } + cs.add(1, docks.size()) + .add(2, dstates) + .add(3, da->saveState()); + return cs.data(); +} + + +void CDDirectK::load(QByteArray ba) { + reset(); + if (ba.isEmpty()) return; + ChunkStream cs(ba); + while (!cs.atEnd()) { + switch (cs.read()) { + case 1: { + int s = cs.getData(); + piForTimes (s) + addArea(); + } break; + case 2: { + QVector dstates = cs.getData >(); + for (int i = 0; i < piMini(dstates.size(), docks.size()); ++i) + docks[i]->load(dstates[i]); + } break; + case 3: da->restoreState(cs.getData()); break; + default: break; + } + } +} + + +void CDDirectK::addArea() { + KDockWidget * dw = new KDockWidget(QString("area %1").arg(docks.size()), da); + connect(dw, SIGNAL(removeRequest()), this, SLOT(removeArea())); + da->addDockWidget(Qt::RightDockWidgetArea, dw); + docks << dw; + for (int i = 0; i < docks.size(); ++i) + docks[i]->setObjectName(QString("dock_%1").arg(i)); +} + + +void CDDirectK::changedGlobal() { + foreach (KDockWidget * d, docks) + d->changedGlobal(); +} + + +void CDDirectK::removeArea() { + KDockWidget * d = qobject_cast(sender()); + if (!d) return; + docks.removeAll(d); + d->deleteLater(); + for (int i = 0; i < docks.size(); ++i) + docks[i]->setObjectName(QString("dock_%1").arg(i)); +} + + +void CDDirectK::on_buttonAdd_clicked() { + addArea(); +} + + +void CDDirectK::on_buttonRemoveAll_clicked() { + qDeleteAll(docks); + docks.clear(); +} diff --git a/qcd_utils/pult/cddirectk.h b/piqt/utils/cd_pult/cddirectk.h similarity index 94% rename from qcd_utils/pult/cddirectk.h rename to piqt/utils/cd_pult/cddirectk.h index b5d71f4..47ade06 100644 --- a/qcd_utils/pult/cddirectk.h +++ b/piqt/utils/cd_pult/cddirectk.h @@ -1,77 +1,77 @@ -#ifndef CDDIRECTK_H -#define CDDIRECTK_H - -#include "cdgraphics.h" -#include "ui_cddirectk.h" -#include "cddirectk_type_dialog.h" - -class QFormLayout; - - -class KDockWidget: public QDockWidget { - Q_OBJECT -public: - KDockWidget(QString title = QString(), QMainWindow * p = 0); - - void addK(const CDUtils::CDType & t, CDDirectKTypeDialog::TypeInfo ti); - QByteArray save() const; - void load(QByteArray ba); - void clear(); - void changedGlobal(); - - QFormLayout * lay; - -private: - bool eventFilter(QObject * o, QEvent * e); - void contextMenuEvent(QContextMenuEvent * e); - void removeRow(int r); - - QMenu * menu, * menu_k; - QList dactions; - QMainWindow * da; - CDDirectKTypeDialog * type_dialog; - PIVector > k_list; - QVector info_list; - -private slots: - void rename(); - void removeK(); - -signals: - void removeRequest(); - -}; - - - - -class CDDirectK: public QWidget, public Ui::CDDirectK -{ - Q_OBJECT -public: - explicit CDDirectK(QWidget *parent = 0); - ~CDDirectK(); - - void reset(); - QByteArray save() const; - void load(QByteArray ba); - -private: - void addArea(); - - QList docks; - QMainWindow * da; - -public slots: - void changedGlobal(); - -private slots: - void removeArea(); - void on_buttonAdd_clicked(); - void on_buttonRemoveAll_clicked(); - -signals: - -}; - -#endif // CDDIRECTK_H +#ifndef CDDIRECTK_H +#define CDDIRECTK_H + +#include "cdgraphics.h" +#include "ui_cddirectk.h" +#include "cddirectk_type_dialog.h" + +class QFormLayout; + + +class KDockWidget: public QDockWidget { + Q_OBJECT +public: + KDockWidget(QString title = QString(), QMainWindow * p = 0); + + void addK(const CDUtils::CDType & t, CDDirectKTypeDialog::TypeInfo ti); + QByteArray save() const; + void load(QByteArray ba); + void clear(); + void changedGlobal(); + + QFormLayout * lay; + +private: + bool eventFilter(QObject * o, QEvent * e); + void contextMenuEvent(QContextMenuEvent * e); + void removeRow(int r); + + QMenu * menu, * menu_k; + QList dactions; + QMainWindow * da; + CDDirectKTypeDialog * type_dialog; + PIVector > k_list; + QVector info_list; + +private slots: + void rename(); + void removeK(); + +signals: + void removeRequest(); + +}; + + + + +class CDDirectK: public QWidget, public Ui::CDDirectK +{ + Q_OBJECT +public: + explicit CDDirectK(QWidget *parent = 0); + ~CDDirectK(); + + void reset(); + QByteArray save() const; + void load(QByteArray ba); + +private: + void addArea(); + + QList docks; + QMainWindow * da; + +public slots: + void changedGlobal(); + +private slots: + void removeArea(); + void on_buttonAdd_clicked(); + void on_buttonRemoveAll_clicked(); + +signals: + +}; + +#endif // CDDIRECTK_H diff --git a/qcd_utils/pult/cddirectk.ui b/piqt/utils/cd_pult/cddirectk.ui similarity index 96% rename from qcd_utils/pult/cddirectk.ui rename to piqt/utils/cd_pult/cddirectk.ui index a14e715..731498b 100644 --- a/qcd_utils/pult/cddirectk.ui +++ b/piqt/utils/cd_pult/cddirectk.ui @@ -1,85 +1,85 @@ - - - CDDirectK - - - - 0 - 0 - 624 - 411 - - - - CD Pult - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QFrame::StyledPanel - - - - 0 - - - 0 - - - - - Add new - - - - :/icons/list-add.png:/icons/list-add.png - - - - - - - Remove all - - - - :/icons/edit-delete.png:/icons/edit-delete.png - - - - - - - Qt::Horizontal - - - - 1 - 20 - - - - - - - - - - - - - - + + + CDDirectK + + + + 0 + 0 + 624 + 411 + + + + CD Pult + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::StyledPanel + + + + 0 + + + 0 + + + + + Add new + + + + :/icons/list-add.png:/icons/list-add.png + + + + + + + Remove all + + + + :/icons/edit-delete.png:/icons/edit-delete.png + + + + + + + Qt::Horizontal + + + + 1 + 20 + + + + + + + + + + + + + + diff --git a/qcd_utils/pult/cddirectk_type_dialog.cpp b/piqt/utils/cd_pult/cddirectk_type_dialog.cpp similarity index 95% rename from qcd_utils/pult/cddirectk_type_dialog.cpp rename to piqt/utils/cd_pult/cddirectk_type_dialog.cpp index ba95141..c6be2fa 100644 --- a/qcd_utils/pult/cddirectk_type_dialog.cpp +++ b/piqt/utils/cd_pult/cddirectk_type_dialog.cpp @@ -1,76 +1,76 @@ -#include "cddirectk_type_dialog.h" -#include "cdutils_core.h" -#include "qcd_core.h" -#include "qcd_model.h" -#include "piqt.h" -#include "spinslider.h" -#include "qvariantedit.h" - - -CDDirectKTypeDialog::CDDirectKTypeDialog(QWidget * parent) : QDialog(parent), Ui::CDDirectKTypeDialog() { - setupUi(this); -} - - -CDDirectKTypeDialog::~CDDirectKTypeDialog() { -} - - -CDDirectKTypeDialog::TypeInfo CDDirectKTypeDialog::getType() const { - if (!groupBox->isChecked()) return TypeInfo(); - TypeInfo ret; - ret.type = comboType->currentIndex(); - ret.params_d[0] = evalMin->value(); - ret.params_d[1] = evalMax->value(); - ret.params_d[2] = spinDecimals->value(); - ret.params_d[3] = evalStep->value(); - ret.params_s[0] = linePrefix->text(); - ret.params_s[1] = lineSuffix->text(); - return ret; -} - - - - -CDDirectKTypeDialog::TypeInfo::TypeInfo(int type_) { - type = type_; - params_d.resize(4); - params_s.resize(2); -} - - -QWidget * CDDirectKTypeDialog::TypeInfo::create() { - params_d.resize(4); - params_s.resize(2); - switch (type) { - case 0: { - QDoubleSpinBox * ret = new QDoubleSpinBox(); - ret->setMinimum(params_d[0]); - ret->setMaximum(params_d[1]); - ret->setDecimals(params_d[2]); - ret->setSingleStep(params_d[3]); - ret->setPrefix(params_s[0]); - ret->setSuffix(params_s[1]); - return ret; - } break; - case 1: { - QSlider * ret = new QSlider(Qt::Horizontal); - ret->setMinimum(params_d[0]); - ret->setMaximum(params_d[1]); - ret->setSingleStep(params_d[3]); - return ret; - } break; - case 2: { - SpinSlider * ret = new SpinSlider(); - ret->setMinimum(params_d[0]); - ret->setMaximum(params_d[1]); - ret->setDecimals(params_d[2]); - ret->setSingleStep(params_d[3]); - ret->setPrefix(params_s[0]); - ret->setSuffix(params_s[1]); - return ret; - } break; - default: break; - } - return new QVariantEdit(); -} +#include "cddirectk_type_dialog.h" +#include "cdutils_core.h" +#include "qcd_core.h" +#include "qcd_model.h" +#include "piqt.h" +#include "spinslider.h" +#include "qvariantedit.h" + + +CDDirectKTypeDialog::CDDirectKTypeDialog(QWidget * parent) : QDialog(parent), Ui::CDDirectKTypeDialog() { + setupUi(this); +} + + +CDDirectKTypeDialog::~CDDirectKTypeDialog() { +} + + +CDDirectKTypeDialog::TypeInfo CDDirectKTypeDialog::getType() const { + if (!groupBox->isChecked()) return TypeInfo(); + TypeInfo ret; + ret.type = comboType->currentIndex(); + ret.params_d[0] = evalMin->value(); + ret.params_d[1] = evalMax->value(); + ret.params_d[2] = spinDecimals->value(); + ret.params_d[3] = evalStep->value(); + ret.params_s[0] = linePrefix->text(); + ret.params_s[1] = lineSuffix->text(); + return ret; +} + + + + +CDDirectKTypeDialog::TypeInfo::TypeInfo(int type_) { + type = type_; + params_d.resize(4); + params_s.resize(2); +} + + +QWidget * CDDirectKTypeDialog::TypeInfo::create() { + params_d.resize(4); + params_s.resize(2); + switch (type) { + case 0: { + QDoubleSpinBox * ret = new QDoubleSpinBox(); + ret->setMinimum(params_d[0]); + ret->setMaximum(params_d[1]); + ret->setDecimals(params_d[2]); + ret->setSingleStep(params_d[3]); + ret->setPrefix(params_s[0]); + ret->setSuffix(params_s[1]); + return ret; + } break; + case 1: { + QSlider * ret = new QSlider(Qt::Horizontal); + ret->setMinimum(params_d[0]); + ret->setMaximum(params_d[1]); + ret->setSingleStep(params_d[3]); + return ret; + } break; + case 2: { + SpinSlider * ret = new SpinSlider(); + ret->setMinimum(params_d[0]); + ret->setMaximum(params_d[1]); + ret->setDecimals(params_d[2]); + ret->setSingleStep(params_d[3]); + ret->setPrefix(params_s[0]); + ret->setSuffix(params_s[1]); + return ret; + } break; + default: break; + } + return new QVariantEdit(); +} diff --git a/qcd_utils/pult/cddirectk_type_dialog.h b/piqt/utils/cd_pult/cddirectk_type_dialog.h similarity index 95% rename from qcd_utils/pult/cddirectk_type_dialog.h rename to piqt/utils/cd_pult/cddirectk_type_dialog.h index c3ee06a..9881864 100644 --- a/qcd_utils/pult/cddirectk_type_dialog.h +++ b/piqt/utils/cd_pult/cddirectk_type_dialog.h @@ -1,44 +1,44 @@ -#ifndef CDDIRECTK_TYPE_DIALOG_H -#define CDDIRECTK_TYPE_DIALOG_H - -#include -#include "ui_cddirectk_type_dialog.h" - - -class CDDirectKTypeDialog: public QDialog, public Ui::CDDirectKTypeDialog -{ - Q_OBJECT -public: - explicit CDDirectKTypeDialog(QWidget * parent = 0); - ~CDDirectKTypeDialog(); - - struct TypeInfo { - TypeInfo(int type_ = -1); - QWidget * create(); - int type; - QVector params_d; - QVector params_s; - }; - - TypeInfo getType() const; - -private: - -public slots: - -private slots: - -signals: - -}; - -inline QDataStream & operator <<(QDataStream & s, const CDDirectKTypeDialog::TypeInfo & v) { - s << v.type << v.params_d << v.params_s; - return s; -} -inline QDataStream & operator >>(QDataStream & s, CDDirectKTypeDialog::TypeInfo & v) { - s >> v.type >> v.params_d >> v.params_s; - return s; -} - -#endif // CDDIRECTK_TYPE_DIALOG_H +#ifndef CDDIRECTK_TYPE_DIALOG_H +#define CDDIRECTK_TYPE_DIALOG_H + +#include +#include "ui_cddirectk_type_dialog.h" + + +class CDDirectKTypeDialog: public QDialog, public Ui::CDDirectKTypeDialog +{ + Q_OBJECT +public: + explicit CDDirectKTypeDialog(QWidget * parent = 0); + ~CDDirectKTypeDialog(); + + struct TypeInfo { + TypeInfo(int type_ = -1); + QWidget * create(); + int type; + QVector params_d; + QVector params_s; + }; + + TypeInfo getType() const; + +private: + +public slots: + +private slots: + +signals: + +}; + +inline QDataStream & operator <<(QDataStream & s, const CDDirectKTypeDialog::TypeInfo & v) { + s << v.type << v.params_d << v.params_s; + return s; +} +inline QDataStream & operator >>(QDataStream & s, CDDirectKTypeDialog::TypeInfo & v) { + s >> v.type >> v.params_d >> v.params_s; + return s; +} + +#endif // CDDIRECTK_TYPE_DIALOG_H diff --git a/qcd_utils/pult/cddirectk_type_dialog.ui b/piqt/utils/cd_pult/cddirectk_type_dialog.ui similarity index 96% rename from qcd_utils/pult/cddirectk_type_dialog.ui rename to piqt/utils/cd_pult/cddirectk_type_dialog.ui index 3c4ac3a..0b5ec15 100644 --- a/qcd_utils/pult/cddirectk_type_dialog.ui +++ b/piqt/utils/cd_pult/cddirectk_type_dialog.ui @@ -1,232 +1,232 @@ - - - CDDirectKTypeDialog - - - - 0 - 0 - 275 - 310 - - - - CD Pult - - - - - - Custom - - - true - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Type: - - - - - - - - Spin - - - - - Slider - - - - - SpinSlider - - - - - - - - Min: - - - - - - - - - - Max: - - - - - - - 100.000000000000000 - - - - - - - Decimals: - - - - - - - - - - Single step: - - - - - - - 1.000000000000000 - - - - - - - Prefix: - - - - - - - - - - Suffix: - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - CLineEdit - QLineEdit -
clineedit.h
-
- - EvalSpinBox - QWidget -
evalspinbox.h
-
-
- - - - groupBox - toggled(bool) - widget - setEnabled(bool) - - - 86 - 49 - - - 94 - 91 - - - - - buttonBox - accepted() - CDDirectKTypeDialog - accept() - - - 297 - 285 - - - 315 - 280 - - - - - buttonBox - rejected() - CDDirectKTypeDialog - reject() - - - 281 - 290 - - - 283 - 307 - - - - -
+ + + CDDirectKTypeDialog + + + + 0 + 0 + 275 + 310 + + + + CD Pult + + + + + + Custom + + + true + + + + + + + QFormLayout::AllNonFixedFieldsGrow + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Type: + + + + + + + + Spin + + + + + Slider + + + + + SpinSlider + + + + + + + + Min: + + + + + + + + + + Max: + + + + + + + 100.000000000000000 + + + + + + + Decimals: + + + + + + + + + + Single step: + + + + + + + 1.000000000000000 + + + + + + + Prefix: + + + + + + + + + + Suffix: + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + CLineEdit + QLineEdit +
clineedit.h
+
+ + EvalSpinBox + QWidget +
evalspinbox.h
+
+
+ + + + groupBox + toggled(bool) + widget + setEnabled(bool) + + + 86 + 49 + + + 94 + 91 + + + + + buttonBox + accepted() + CDDirectKTypeDialog + accept() + + + 297 + 285 + + + 315 + 280 + + + + + buttonBox + rejected() + CDDirectKTypeDialog + reject() + + + 281 + 290 + + + 283 + 307 + + + + +
diff --git a/qcd_utils/pult/cdgraphics.cpp b/piqt/utils/cd_pult/cdgraphics.cpp similarity index 96% rename from qcd_utils/pult/cdgraphics.cpp rename to piqt/utils/cd_pult/cdgraphics.cpp index 0cb72ba..b067683 100644 --- a/qcd_utils/pult/cdgraphics.cpp +++ b/piqt/utils/cd_pult/cdgraphics.cpp @@ -1,354 +1,354 @@ -#include "cdgraphics.h" -//#include "ui_qcd_graphic.h" -#include "cdutils_core.h" -#include "cdutils_x.h" -#include "qcd_core.h" -#include "qcd_model.h" -#include "qcd_graphic.h" -#include "graphic.h" -#include "piqt.h" -#include -#include -#include -#include -#include -#include -#include - -using namespace CDUtils; - - -QStringList CDUtils::getList(const PIVector > & x_list) { - QStringList ret; - piForeachC (PIDeque & p, x_list) - ret << PI2QString(CDCore::pathToString(p)); - return ret; -} - - -PIVector > CDUtils::setList(const QStringList & l) { - PIVector > ret; - foreach (QString s, l) - ret << CDCore::stringToPath(Q2PIString(s)); - return ret; -} - - - - -GDockWidget::GDockWidget(QString title, QMainWindow * p): QDockWidget(title, p) { - da = p; - menu = new QMenu(this); - QAction * a = new QAction(QIcon(":/icons/document-edit.png"), "Rename ...", this); - connect(a, SIGNAL(triggered(bool)), this, SLOT(rename())); - dactions << a; - a = new QAction(QIcon(":/icons/edit-delete.png"), "Remove", this); - connect(a, SIGNAL(triggered(bool)), this, SIGNAL(removeRequest())); - dactions << a; - menu_x = new QMenu(this); - menu_x->setTitle(tr("Remove X")); - graphic = new CDGraphicWidget(); - graphic->graphic()->viewport()->setAcceptDrops(true); - graphic->graphic()->viewport()->installEventFilter(this); - setWidget(graphic); -} - - -void GDockWidget::addX(const CDType & t) { - if (t.cd_type() != CDType::cdX) return; - PIDeque xp = t.path(); - if (x_list.contains(xp)) return; - x_list << xp; - int gind = graphic->graphic()->graphicsCount(); - graphic->graphic()->setGraphicsCount(gind + 1); - graphic->graphic()->setGraphicName(PI2QString(t.pathString().join(".")), gind); -} - - -void GDockWidget::drawX(const PIMap > & data) { - for (int i = 0; i < x_list.size_s(); ++i) { - PIString sp = CDCore::pathToString(x_list[i]); - const PIVector & ch(data[sp]); - for (int j = 0; j < ch.size_s(); ++j) - graphic->graphic()->addPoint(ch[j], i, false); - } - graphic->graphic()->updateGraphics(); -} - - -QByteArray GDockWidget::save() const { - ChunkStream cs; - cs.add(1, windowTitle()) - .add(2, getList(x_list)) - .add(3, graphic->graphic()->save()) - .add(4, graphic->evalSpinBoxHistory()->expression()) - .add(5, graphic->evalSpinBoxVisible()->expression()); - return cs.data(); -} - - -void GDockWidget::load(QByteArray ba) { - if (ba.isEmpty()) return; - ChunkStream cs(ba); - while (!cs.atEnd()) { - switch (cs.read()) { - case 1: setWindowTitle(cs.getData()); break; - case 2: x_list = setList(cs.getData()); break; - case 3: graphic->graphic()->load(cs.getData()); break; - case 4: graphic->evalSpinBoxHistory()->setExpression(cs.getData()); break; - case 5: graphic->evalSpinBoxVisible()->setExpression(cs.getData()); break; - default: break; - } - } -} - - -void GDockWidget::changedGlobal() { - for (int i = 0; i < x_list.size_s(); ++i) { - if (!X.exists(x_list[i])) { - x_list.remove(i); - graphic->graphic()->removeGraphic(i); - --i; - continue; - } - graphic->graphic()->setGraphicName(PI2QString(X[x_list[i]].pathString().join(".")), i); - } -} - - -bool GDockWidget::eventFilter(QObject * o, QEvent * e) { - //if (o == graphic->viewport()) { - switch (e->type()) { - case QEvent::DragMove: { - QDragMoveEvent * de = (QDragMoveEvent*)e; - const QMimeData * mime = de->mimeData(); - //qDebug() << "enter" << mime; - if (!mime) break; - if (!mime->text().startsWith("x")) break; - de->setDropAction(Qt::CopyAction); - de->accept(); - return true; - } break; - case QEvent::DragEnter: { - QDragEnterEvent * de = (QDragEnterEvent*)e; - const QMimeData * mime = de->mimeData(); - //qDebug() << "enter" << mime; - if (!mime) break; - if (!mime->text().startsWith("x")) break; - de->setDropAction(Qt::CopyAction); - de->accept(); - return true; - } break; - case QEvent::Drop: { - QDropEvent * de = (QDropEvent*)e; - const QMimeData * mime = de->mimeData(); - if (!mime) break; - //qDebug() << "drop" << mime->text(); - if (!mime->text().startsWith("x")) break; - addX(X[CDCore::stringToPath(Q2PIString(mime->text().mid(1)))]); - de->accept(); - return true; - } break; - default: break; - } - //} - return QWidget::eventFilter(o, e); -} - - -void GDockWidget::contextMenuEvent(QContextMenuEvent * e) { - if (graphic->graphic()->underMouse()) return; - qDeleteAll(menu_x->actions()); - menu_x->clear(); - for (int i = 0; i < graphic->graphic()->graphicsCount(); ++i) { - QPixmap icon(da->iconSize()); - icon.fill(graphic->graphic()->graphic(i).pen.color()); - QAction * a = new QAction(QIcon(icon), graphic->graphic()->graphic(i).name, this); - a->setData(i); - connect(a, SIGNAL(triggered(bool)), this, SLOT(removeX())); - menu_x->addAction(a); - } - QMenu * mwm = da->createPopupMenu(); - menu->clear(); - menu->addActions(dactions); - menu->addMenu(menu_x); - menu->addSeparator(); - menu->addActions(mwm->actions()); - menu->popup(e->globalPos()); - mwm->deleteLater(); -} - - -CDGraphicWidget * GDockWidget::viewportGraphic(QObject * o) const { - if (!o) return 0; - while (!qobject_cast(o) && o) - o = o->parent(); - return qobject_cast(o); -} - - -void GDockWidget::rename() { - QString nn = QInputDialog::getText(this, tr("Rename area"), tr("New area name:"), - QLineEdit::Normal, windowTitle()); - if (nn.isEmpty()) return; - setWindowTitle(nn); -} - - -void GDockWidget::removeX() { - QAction * a = qobject_cast(sender()); - if (!a) return; - int ind = a->data().toInt(); - if (ind < 0 || ind >= x_list.size_s()) return; - x_list.remove(ind); - graphic->graphic()->removeGraphic(ind); -} - - - - -CDGraphics::CDGraphics(QWidget * parent) : QWidget(parent), Ui::CDGraphics() { - setupUi(this); - da = new QMainWindow(); - da->setWindowFlags(frame->windowFlags()); - da->setDockNestingEnabled(true); - layoutMain->addWidget(da); -} - - -CDGraphics::~CDGraphics() { -} - - -void CDGraphics::reset() { - qDeleteAll(docks); - docks.clear(); -} - - -QByteArray CDGraphics::save() const { - ChunkStream cs; - QVector dstates; - foreach (GDockWidget * d, docks) { - dstates << d->save(); - } - cs.add(1, docks.size()) - .add(2, dstates) - .add(3, da->saveState()); - X.lock(); - cs.add(4, getList(X.enabledList())); - X.unlock(); - cs.add(5, buttonConfigVisible->isChecked()); - return cs.data(); -} - - -void CDGraphics::load(QByteArray ba) { - reset(); - if (ba.isEmpty()) return; - ChunkStream cs(ba); - while (!cs.atEnd()) { - switch (cs.read()) { - case 1: { - int s = cs.getData(); - piForTimes (s) - addGraphic(); - } break; - case 2: { - QVector dstates = cs.getData >(); - for (int i = 0; i < piMini(dstates.size(), docks.size()); ++i) - docks[i]->load(dstates[i]); - } break; - case 3: da->restoreState(cs.getData()); break; - case 4: - X.lock(); - X.setEnabledList(setList(cs.getData())); - X.unlock(); - break; - case 5: - buttonConfigVisible->setChecked(cs.getData()); - break; - default: break; - } - } -} - - -GDockWidget * CDGraphics::graphicDock(Graphic * o) const { - if (!o) return 0; - foreach (GDockWidget * d, docks) - if (d->widget() == o) - return d; - return 0; -} - - -void CDGraphics::addGraphic() { - GDockWidget * dw = new GDockWidget(QString("area %1").arg(docks.size()), da); - connect(dw, SIGNAL(removeRequest()), this, SLOT(removeGraphic())); - connect(buttonConfigVisible, SIGNAL(toggled(bool)), dw->graphic, SLOT(setConfigVisible(bool))); - connect(buttonLegendVisible, SIGNAL(clicked(bool)), dw->graphic->graphic(), SLOT(setLegendVisible(bool))); - connect(buttonBorderInputsVisible, SIGNAL(clicked(bool)), dw->graphic->graphic(), SLOT(setBorderInputsVisible(bool))); - connect(buttonPause, SIGNAL(clicked(bool)), dw->graphic->graphic(), SLOT(setPaused(bool))); - dw->graphic->setConfigVisible(buttonConfigVisible->isChecked()); - dw->graphic->graphic()->setLegendVisible(buttonLegendVisible->isChecked()); - dw->graphic->graphic()->setBorderInputsVisible(buttonBorderInputsVisible->isChecked()); - da->addDockWidget(Qt::RightDockWidgetArea, dw); - docks << dw; - for (int i = 0; i < docks.size(); ++i) - docks[i]->setObjectName(QString("dock_%1").arg(i)); -} - - -void CDGraphics::receivedX() { - PIMap > data; - X.lock(); - PIVector > x_list = X.enabledList(); - PIVector ch; - piForeachC (PIDeque & p, x_list) { - CDType & t(X[p]); - if (t.xmode_rec() == CDType::X_Current) - ch.resize(1).fill(t.toDouble()); - else - ch = t.history; - t.history.clear(); - data[CDCore::pathToString(t.path())] = ch; - } - //piCout << data; - X.unlock(); - foreach (GDockWidget * d, docks) - d->drawX(data); -} - - -void CDGraphics::changedGlobal() { - foreach (GDockWidget * d, docks) - d->changedGlobal(); -} - - -void CDGraphics::removeGraphic() { - GDockWidget * d = qobject_cast(sender()); - if (!d) return; - docks.removeAll(d); - d->deleteLater(); - for (int i = 0; i < docks.size(); ++i) - docks[i]->setObjectName(QString("dock_%1").arg(i)); -} - - -void CDGraphics::on_buttonAdd_clicked() { - addGraphic(); -} - - -void CDGraphics::on_buttonClear_clicked() { - foreach (GDockWidget * d, docks) - d->graphic->graphic()->clear(); -} - - -void CDGraphics::on_buttonRemoveAll_clicked() { - qDeleteAll(docks); - docks.clear(); -} +#include "cdgraphics.h" +//#include "ui_qcd_graphic.h" +#include "cdutils_core.h" +#include "cdutils_x.h" +#include "qcd_core.h" +#include "qcd_model.h" +#include "qcd_graphic.h" +#include "graphic.h" +#include "piqt.h" +#include +#include +#include +#include +#include +#include +#include + +using namespace CDUtils; + + +QStringList CDUtils::getList(const PIVector > & x_list) { + QStringList ret; + piForeachC (PIDeque & p, x_list) + ret << PI2QString(CDCore::pathToString(p)); + return ret; +} + + +PIVector > CDUtils::setList(const QStringList & l) { + PIVector > ret; + foreach (QString s, l) + ret << CDCore::stringToPath(Q2PIString(s)); + return ret; +} + + + + +GDockWidget::GDockWidget(QString title, QMainWindow * p): QDockWidget(title, p) { + da = p; + menu = new QMenu(this); + QAction * a = new QAction(QIcon(":/icons/document-edit.png"), "Rename ...", this); + connect(a, SIGNAL(triggered(bool)), this, SLOT(rename())); + dactions << a; + a = new QAction(QIcon(":/icons/edit-delete.png"), "Remove", this); + connect(a, SIGNAL(triggered(bool)), this, SIGNAL(removeRequest())); + dactions << a; + menu_x = new QMenu(this); + menu_x->setTitle(tr("Remove X")); + graphic = new CDGraphicWidget(); + graphic->graphic()->viewport()->setAcceptDrops(true); + graphic->graphic()->viewport()->installEventFilter(this); + setWidget(graphic); +} + + +void GDockWidget::addX(const CDType & t) { + if (t.cd_type() != CDType::cdX) return; + PIDeque xp = t.path(); + if (x_list.contains(xp)) return; + x_list << xp; + int gind = graphic->graphic()->graphicsCount(); + graphic->graphic()->setGraphicsCount(gind + 1); + graphic->graphic()->setGraphicName(PI2QString(t.pathString().join(".")), gind); +} + + +void GDockWidget::drawX(const PIMap > & data) { + for (int i = 0; i < x_list.size_s(); ++i) { + PIString sp = CDCore::pathToString(x_list[i]); + const PIVector & ch(data[sp]); + for (int j = 0; j < ch.size_s(); ++j) + graphic->graphic()->addPoint(ch[j], i, false); + } + graphic->graphic()->updateGraphics(); +} + + +QByteArray GDockWidget::save() const { + ChunkStream cs; + cs.add(1, windowTitle()) + .add(2, getList(x_list)) + .add(3, graphic->graphic()->save()) + .add(4, graphic->evalSpinBoxHistory()->expression()) + .add(5, graphic->evalSpinBoxVisible()->expression()); + return cs.data(); +} + + +void GDockWidget::load(QByteArray ba) { + if (ba.isEmpty()) return; + ChunkStream cs(ba); + while (!cs.atEnd()) { + switch (cs.read()) { + case 1: setWindowTitle(cs.getData()); break; + case 2: x_list = setList(cs.getData()); break; + case 3: graphic->graphic()->load(cs.getData()); break; + case 4: graphic->evalSpinBoxHistory()->setExpression(cs.getData()); break; + case 5: graphic->evalSpinBoxVisible()->setExpression(cs.getData()); break; + default: break; + } + } +} + + +void GDockWidget::changedGlobal() { + for (int i = 0; i < x_list.size_s(); ++i) { + if (!X.exists(x_list[i])) { + x_list.remove(i); + graphic->graphic()->removeGraphic(i); + --i; + continue; + } + graphic->graphic()->setGraphicName(PI2QString(X[x_list[i]].pathString().join(".")), i); + } +} + + +bool GDockWidget::eventFilter(QObject * o, QEvent * e) { + //if (o == graphic->viewport()) { + switch (e->type()) { + case QEvent::DragMove: { + QDragMoveEvent * de = (QDragMoveEvent*)e; + const QMimeData * mime = de->mimeData(); + //qDebug() << "enter" << mime; + if (!mime) break; + if (!mime->text().startsWith("x")) break; + de->setDropAction(Qt::CopyAction); + de->accept(); + return true; + } break; + case QEvent::DragEnter: { + QDragEnterEvent * de = (QDragEnterEvent*)e; + const QMimeData * mime = de->mimeData(); + //qDebug() << "enter" << mime; + if (!mime) break; + if (!mime->text().startsWith("x")) break; + de->setDropAction(Qt::CopyAction); + de->accept(); + return true; + } break; + case QEvent::Drop: { + QDropEvent * de = (QDropEvent*)e; + const QMimeData * mime = de->mimeData(); + if (!mime) break; + //qDebug() << "drop" << mime->text(); + if (!mime->text().startsWith("x")) break; + addX(X[CDCore::stringToPath(Q2PIString(mime->text().mid(1)))]); + de->accept(); + return true; + } break; + default: break; + } + //} + return QWidget::eventFilter(o, e); +} + + +void GDockWidget::contextMenuEvent(QContextMenuEvent * e) { + if (graphic->graphic()->underMouse()) return; + qDeleteAll(menu_x->actions()); + menu_x->clear(); + for (int i = 0; i < graphic->graphic()->graphicsCount(); ++i) { + QPixmap icon(da->iconSize()); + icon.fill(graphic->graphic()->graphic(i).pen.color()); + QAction * a = new QAction(QIcon(icon), graphic->graphic()->graphic(i).name, this); + a->setData(i); + connect(a, SIGNAL(triggered(bool)), this, SLOT(removeX())); + menu_x->addAction(a); + } + QMenu * mwm = da->createPopupMenu(); + menu->clear(); + menu->addActions(dactions); + menu->addMenu(menu_x); + menu->addSeparator(); + menu->addActions(mwm->actions()); + menu->popup(e->globalPos()); + mwm->deleteLater(); +} + + +CDGraphicWidget * GDockWidget::viewportGraphic(QObject * o) const { + if (!o) return 0; + while (!qobject_cast(o) && o) + o = o->parent(); + return qobject_cast(o); +} + + +void GDockWidget::rename() { + QString nn = QInputDialog::getText(this, tr("Rename area"), tr("New area name:"), + QLineEdit::Normal, windowTitle()); + if (nn.isEmpty()) return; + setWindowTitle(nn); +} + + +void GDockWidget::removeX() { + QAction * a = qobject_cast(sender()); + if (!a) return; + int ind = a->data().toInt(); + if (ind < 0 || ind >= x_list.size_s()) return; + x_list.remove(ind); + graphic->graphic()->removeGraphic(ind); +} + + + + +CDGraphics::CDGraphics(QWidget * parent) : QWidget(parent), Ui::CDGraphics() { + setupUi(this); + da = new QMainWindow(); + da->setWindowFlags(frame->windowFlags()); + da->setDockNestingEnabled(true); + layoutMain->addWidget(da); +} + + +CDGraphics::~CDGraphics() { +} + + +void CDGraphics::reset() { + qDeleteAll(docks); + docks.clear(); +} + + +QByteArray CDGraphics::save() const { + ChunkStream cs; + QVector dstates; + foreach (GDockWidget * d, docks) { + dstates << d->save(); + } + cs.add(1, docks.size()) + .add(2, dstates) + .add(3, da->saveState()); + X.lock(); + cs.add(4, getList(X.enabledList())); + X.unlock(); + cs.add(5, buttonConfigVisible->isChecked()); + return cs.data(); +} + + +void CDGraphics::load(QByteArray ba) { + reset(); + if (ba.isEmpty()) return; + ChunkStream cs(ba); + while (!cs.atEnd()) { + switch (cs.read()) { + case 1: { + int s = cs.getData(); + piForTimes (s) + addGraphic(); + } break; + case 2: { + QVector dstates = cs.getData >(); + for (int i = 0; i < piMini(dstates.size(), docks.size()); ++i) + docks[i]->load(dstates[i]); + } break; + case 3: da->restoreState(cs.getData()); break; + case 4: + X.lock(); + X.setEnabledList(setList(cs.getData())); + X.unlock(); + break; + case 5: + buttonConfigVisible->setChecked(cs.getData()); + break; + default: break; + } + } +} + + +GDockWidget * CDGraphics::graphicDock(Graphic * o) const { + if (!o) return 0; + foreach (GDockWidget * d, docks) + if (d->widget() == o) + return d; + return 0; +} + + +void CDGraphics::addGraphic() { + GDockWidget * dw = new GDockWidget(QString("area %1").arg(docks.size()), da); + connect(dw, SIGNAL(removeRequest()), this, SLOT(removeGraphic())); + connect(buttonConfigVisible, SIGNAL(toggled(bool)), dw->graphic, SLOT(setConfigVisible(bool))); + connect(buttonLegendVisible, SIGNAL(clicked(bool)), dw->graphic->graphic(), SLOT(setLegendVisible(bool))); + connect(buttonBorderInputsVisible, SIGNAL(clicked(bool)), dw->graphic->graphic(), SLOT(setBorderInputsVisible(bool))); + connect(buttonPause, SIGNAL(clicked(bool)), dw->graphic->graphic(), SLOT(setPaused(bool))); + dw->graphic->setConfigVisible(buttonConfigVisible->isChecked()); + dw->graphic->graphic()->setLegendVisible(buttonLegendVisible->isChecked()); + dw->graphic->graphic()->setBorderInputsVisible(buttonBorderInputsVisible->isChecked()); + da->addDockWidget(Qt::RightDockWidgetArea, dw); + docks << dw; + for (int i = 0; i < docks.size(); ++i) + docks[i]->setObjectName(QString("dock_%1").arg(i)); +} + + +void CDGraphics::receivedX() { + PIMap > data; + X.lock(); + PIVector > x_list = X.enabledList(); + PIVector ch; + piForeachC (PIDeque & p, x_list) { + CDType & t(X[p]); + if (t.xmode_rec() == CDType::X_Current) + ch.resize(1).fill(t.toDouble()); + else + ch = t.history; + t.history.clear(); + data[CDCore::pathToString(t.path())] = ch; + } + //piCout << data; + X.unlock(); + foreach (GDockWidget * d, docks) + d->drawX(data); +} + + +void CDGraphics::changedGlobal() { + foreach (GDockWidget * d, docks) + d->changedGlobal(); +} + + +void CDGraphics::removeGraphic() { + GDockWidget * d = qobject_cast(sender()); + if (!d) return; + docks.removeAll(d); + d->deleteLater(); + for (int i = 0; i < docks.size(); ++i) + docks[i]->setObjectName(QString("dock_%1").arg(i)); +} + + +void CDGraphics::on_buttonAdd_clicked() { + addGraphic(); +} + + +void CDGraphics::on_buttonClear_clicked() { + foreach (GDockWidget * d, docks) + d->graphic->graphic()->clear(); +} + + +void CDGraphics::on_buttonRemoveAll_clicked() { + qDeleteAll(docks); + docks.clear(); +} diff --git a/qcd_utils/pult/cdgraphics.h b/piqt/utils/cd_pult/cdgraphics.h similarity index 94% rename from qcd_utils/pult/cdgraphics.h rename to piqt/utils/cd_pult/cdgraphics.h index 33ca214..51e3483 100644 --- a/qcd_utils/pult/cdgraphics.h +++ b/piqt/utils/cd_pult/cdgraphics.h @@ -1,92 +1,92 @@ -#ifndef CDGRAPHICS_H -#define CDGRAPHICS_H - -#include -#include -#include -#include "ui_cdgraphics.h" -#include "qcd_graphic.h" -#include - -namespace CDUtils { - class CDType; - class CDSection; - QStringList getList(const PIVector > & x_list); - PIVector > setList(const QStringList & l); -} - -class QMainWindow; -class Graphic; - - - - -class GDockWidget: public QDockWidget { - Q_OBJECT -public: - GDockWidget(QString title = QString(), QMainWindow * p = 0); - - void addX(const CDUtils::CDType & t); - void drawX(const PIMap > & data); - QByteArray save() const; - void load(QByteArray ba); - void changedGlobal(); - - CDGraphicWidget * graphic; - -private: - bool eventFilter(QObject * o, QEvent * e); - void contextMenuEvent(QContextMenuEvent * e); - CDGraphicWidget * viewportGraphic(QObject * o) const; - - QMenu * menu, * menu_x; - QList dactions; - QMainWindow * da; - PIVector > x_list; - -private slots: - void rename(); - void removeX(); - -signals: - void removeRequest(); - -}; - - - - -class CDGraphics : public QWidget, public Ui::CDGraphics -{ - Q_OBJECT -public: - explicit CDGraphics(QWidget *parent = 0); - ~CDGraphics(); - - void reset(); - QByteArray save() const; - void load(QByteArray ba); - -private: - GDockWidget * graphicDock(Graphic * o) const; - void addXToGraphic(const QString & xp, Graphic * g); - void addGraphic(); - - QList docks; - QMainWindow * da; - -public slots: - void receivedX(); - void changedGlobal(); - -private slots: - void removeGraphic(); - void on_buttonAdd_clicked(); - void on_buttonClear_clicked(); - void on_buttonRemoveAll_clicked(); - -signals: - -}; - -#endif // CDGRAPHICS_H +#ifndef CDGRAPHICS_H +#define CDGRAPHICS_H + +#include +#include +#include +#include "ui_cdgraphics.h" +#include "qcd_graphic.h" +#include + +namespace CDUtils { + class CDType; + class CDSection; + QStringList getList(const PIVector > & x_list); + PIVector > setList(const QStringList & l); +} + +class QMainWindow; +class Graphic; + + + + +class GDockWidget: public QDockWidget { + Q_OBJECT +public: + GDockWidget(QString title = QString(), QMainWindow * p = 0); + + void addX(const CDUtils::CDType & t); + void drawX(const PIMap > & data); + QByteArray save() const; + void load(QByteArray ba); + void changedGlobal(); + + CDGraphicWidget * graphic; + +private: + bool eventFilter(QObject * o, QEvent * e); + void contextMenuEvent(QContextMenuEvent * e); + CDGraphicWidget * viewportGraphic(QObject * o) const; + + QMenu * menu, * menu_x; + QList dactions; + QMainWindow * da; + PIVector > x_list; + +private slots: + void rename(); + void removeX(); + +signals: + void removeRequest(); + +}; + + + + +class CDGraphics : public QWidget, public Ui::CDGraphics +{ + Q_OBJECT +public: + explicit CDGraphics(QWidget *parent = 0); + ~CDGraphics(); + + void reset(); + QByteArray save() const; + void load(QByteArray ba); + +private: + GDockWidget * graphicDock(Graphic * o) const; + void addXToGraphic(const QString & xp, Graphic * g); + void addGraphic(); + + QList docks; + QMainWindow * da; + +public slots: + void receivedX(); + void changedGlobal(); + +private slots: + void removeGraphic(); + void on_buttonAdd_clicked(); + void on_buttonClear_clicked(); + void on_buttonRemoveAll_clicked(); + +signals: + +}; + +#endif // CDGRAPHICS_H diff --git a/qcd_utils/pult/cdgraphics.ui b/piqt/utils/cd_pult/cdgraphics.ui similarity index 96% rename from qcd_utils/pult/cdgraphics.ui rename to piqt/utils/cd_pult/cdgraphics.ui index 9974f72..6a40b06 100644 --- a/qcd_utils/pult/cdgraphics.ui +++ b/piqt/utils/cd_pult/cdgraphics.ui @@ -1,168 +1,168 @@ - - - CDGraphics - - - - 0 - 0 - 624 - 411 - - - - CD Pult - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QFrame::StyledPanel - - - - 0 - - - 0 - - - - - Add new - - - - :/icons/list-add.png:/icons/list-add.png - - - - - - - Clear all - - - - :/icons/edit-clear.png:/icons/edit-clear.png - - - - - - - Remove all - - - - :/icons/edit-delete.png:/icons/edit-delete.png - - - - - - - Remove all - - - - :/icons/layer-visible-off.png - :/icons/layer-visible-on.png:/icons/layer-visible-off.png - - - true - - - true - - - - - - - Remove all - - - - :/icons/legend.png:/icons/legend.png - - - true - - - true - - - - - - - Remove all - - - - :/icons/media-playback-pause.png:/icons/media-playback-pause.png - - - true - - - false - - - - - - - Remove all - - - - :/icons/border-line.png:/icons/border-line.png - - - true - - - false - - - - - - - Qt::Horizontal - - - - 1 - 20 - - - - - - - - - - - - - - - - - + + + CDGraphics + + + + 0 + 0 + 624 + 411 + + + + CD Pult + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::StyledPanel + + + + 0 + + + 0 + + + + + Add new + + + + :/icons/list-add.png:/icons/list-add.png + + + + + + + Clear all + + + + :/icons/edit-clear.png:/icons/edit-clear.png + + + + + + + Remove all + + + + :/icons/edit-delete.png:/icons/edit-delete.png + + + + + + + Remove all + + + + :/icons/layer-visible-off.png + :/icons/layer-visible-on.png:/icons/layer-visible-off.png + + + true + + + true + + + + + + + Remove all + + + + :/icons/legend.png:/icons/legend.png + + + true + + + true + + + + + + + Remove all + + + + :/icons/media-playback-pause.png:/icons/media-playback-pause.png + + + true + + + false + + + + + + + Remove all + + + + :/icons/border-line.png:/icons/border-line.png + + + true + + + false + + + + + + + Qt::Horizontal + + + + 1 + 20 + + + + + + + + + + + + + + + + + diff --git a/piqt/utils/cd_pult/cdpult.qrc b/piqt/utils/cd_pult/cdpult.qrc new file mode 100644 index 0000000..08a59ac --- /dev/null +++ b/piqt/utils/cd_pult/cdpult.qrc @@ -0,0 +1,16 @@ + + + ../../../qad/icons/dialog-information.png + ../../../qad/icons/dialog-cancel.png + ../../../qad/icons/dialog-ok-apply.png + ../../../qad/icons/document-revert.png + ../../../qad/icons/view-refresh.png + ../../../qad/icons/format-stroke-color.png + icons/db-export.png + icons/db-import.png + icons/timer.png + icons/flame.png + icons/Apps-accessories-calculator-icon.png + icons/accessories-text-editor.png + + diff --git a/qcd_utils/pult/cdpultwindow.cpp b/piqt/utils/cd_pult/cdpultwindow.cpp similarity index 97% rename from qcd_utils/pult/cdpultwindow.cpp rename to piqt/utils/cd_pult/cdpultwindow.cpp index ce58fb3..c388c5a 100644 --- a/qcd_utils/pult/cdpultwindow.cpp +++ b/piqt/utils/cd_pult/cdpultwindow.cpp @@ -1,292 +1,292 @@ -#include "edockwidget.h" -#include "cdpultwindow.h" -#include "cdutils_core.h" -#include "cdutils_k.h" -#include "cdutils_x.h" -#include "cdutils_m.h" -#include "qcd_core.h" -#include "qcd_view.h" -#include "qcd_model.h" -#include "qcd_modedialog.h" -#include "chunkstream.h" -#include "qvariantedit.h" -#include "piqt.h" -#include "piqt_highlighter.h" -#include "qcodeedit.h" -#include -#include -#include -#include - -using namespace CDUtils; - - -CDPultWindow::CDPultWindow(QWidget *parent) : EMainWindow(parent), Ui::CDPultWindow() { - setupUi(this); - centralWidget()->hide(); - setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); - CDCore::instance()->initPult(); - def_config = codeConfig->text(); - checkDefaultConfig->setChecked(true); - new ConfigHighlighter(codeConfig->document()); - widgetK->setType(CDUtils::CDType::cdK); - widgetX->setType(CDUtils::CDType::cdX); - widgetC->setType(CDUtils::CDType::cdC); - widgetM->setType(CDUtils::CDType::cdM); - editFileK->setValue(QVariant::fromValue(QAD::File("", "*.dat"))); - editFileX->setValue(QVariant::fromValue(QAD::File("", "*.dat"))); - editFileC->setValue(QVariant::fromValue(QAD::File("", "*.dat"))); - editFileM->setValue(QVariant::fromValue(QAD::File("", "*.dat"))); - log_icons[CDViewWidget::OKIcon] = QIcon(":/icons/dialog-ok-apply.png"); - log_icons[CDViewWidget::FailIcon] = QIcon(":/icons/dialog-cancel.png"); - log_icons[CDViewWidget::WaitIcon] = QIcon(":/icons/timer.png"); - setRecentMenu(menuOpen_recent); - ribbon = new Ribbon(this); - session.setFile("session_cdpult.conf"); - session.addEntry(this); - session.addEntry(ribbon->tabWidget()); - session.load(); - reset(); - connect(widgetK, SIGNAL(addToLog(CDViewWidget::LogIcon,QString)), this, SLOT(addToLog(CDViewWidget::LogIcon,QString))); - connect(widgetX, SIGNAL(addToLog(CDViewWidget::LogIcon,QString)), this, SLOT(addToLog(CDViewWidget::LogIcon,QString))); - connect(widgetC, SIGNAL(addToLog(CDViewWidget::LogIcon,QString)), this, SLOT(addToLog(CDViewWidget::LogIcon,QString))); - connect(widgetM, SIGNAL(addToLog(CDViewWidget::LogIcon,QString)), this, SLOT(addToLog(CDViewWidget::LogIcon,QString))); - connect(widgetK->view, SIGNAL(changedGlobal()), widgetDirectK, SLOT(changedGlobal())); - connect(widgetX->view, SIGNAL(changedGlobal()), widgetGraphics, SLOT(changedGlobal())); - connect(widgetX->view, SIGNAL(receivedX()), widgetGraphics, SLOT(receivedX())); - connect(widgetM->view, SIGNAL(messageReceived(QString,int,QString)), this, SLOT(messageReceived(QString,int,QString))); - QCDCore::instance()->bindWidget(widgetK->view); - QCDCore::instance()->setDirectKEnabled(true); - X.start(); - if (windowState() == Qt::WindowMinimized) - setWindowState(Qt::WindowNoState); -} - - -CDPultWindow::~CDPultWindow() { -} - - -void CDPultWindow::loadFile(const QString & fp) { - load(fp); -} - - -void CDPultWindow::apply(bool sessions) { - CDCore::instance()->stop(); - widgetK->setFile(editFileK->value().value().file); - widgetX->setFile(editFileX->value().value().file); - widgetC->setFile(editFileC->value().value().file); - widgetM->setFile(editFileM->value().value().file); - if (checkDefaultConfig->isChecked()) - CDCore::instance()->initPult(); - else - CDCore::instance()->init(Q2PIString(codeConfig->text()), true); - widgetX->view->startX(); - if (sessions) { - widgetGraphics->load(session_gr); - widgetDirectK->load(session_dk); - if (!session_mw.isEmpty()) - restoreState(session_mw); - X.lock(); - PIVector > x_list = X.enabledList(); - X.unlock(); - piForeachC (PIDeque & p, x_list) - X.enable(X[p]); - ((CDItemModel*)widgetX->view->model())->updateModel(); - widgetX->view->expandAll(); - } - dockCDKView->setVisible(checkHasK->isChecked()); - dockCDXView->setVisible(checkHasX->isChecked()); - dockCDCView->setVisible(checkHasC->isChecked()); - dockCDMView->setVisible(checkHasM->isChecked()); - QMetaObject::invokeMethod(this, "changedDock", Qt::QueuedConnection); -} - - -void CDPultWindow::closeEvent(QCloseEvent *e) { - EMainWindow::closeEvent(e); - if (!e->isAccepted()) - return; - QApplication::closeAllWindows(); - session.save(); - session.setFile(QString()); -} - - -void CDPultWindow::reset(bool full) { - setWindowTitle(QString("CD Pult")); - widgetK->reset(); - setChanged(false); -} - - -bool CDPultWindow::load(const QString & path) { - qApp->setOverrideCursor(Qt::WaitCursor); - QPIConfig conf(path, QIODevice::ReadOnly); - QAD::File f = editFileK->value().value(); - checkSyncFiles->setChecked(false); - editFileK->setValue(QVariant::fromValue(QAD::File(conf.getValue("file_k").toString(), f.filter))); - editFileX->setValue(QVariant::fromValue(QAD::File(conf.getValue("file_x").toString(), f.filter))); - editFileC->setValue(QVariant::fromValue(QAD::File(conf.getValue("file_c").toString(), f.filter))); - editFileM->setValue(QVariant::fromValue(QAD::File(conf.getValue("file_m").toString(), f.filter))); - checkSyncFiles->setChecked(conf.getValue("sync_files").toBool()); - lineSessionName->setText(conf.getValue("session_name").toString()); - last_icon = conf.getValue("icon_path").toString(); - setAppIcon(conf.getValue("icon").toByteArray()); - checkHasK->setChecked(conf.getValue("has_k").toBool()); - checkHasX->setChecked(conf.getValue("has_x").toBool()); - checkHasC->setChecked(conf.getValue("has_c").toBool()); - checkHasM->setChecked(conf.getValue("has_m").toBool()); - checkDefaultConfig->setChecked(conf.getValue("default_config").toBool()); - codeConfig->setText(QByteArray2QString(conf.getValue("config").toByteArray())); - if (codeConfig->text().isEmpty()) - codeConfig->setText(def_config); - session_gr = conf.getValue("session_gr").toByteArray(); - session_dk = conf.getValue("session_dk").toByteArray(); - session_mw = conf.getValue("session_mw").toByteArray(); - setChanged(false); - file_name = path; - apply(true); - qApp->restoreOverrideCursor(); - return true; -} - - -bool CDPultWindow::save(const QString & path) { - session_gr = widgetGraphics->save(); - session_dk = widgetDirectK->save(); - session_mw = saveState(); - QPIConfig conf(path, QIODevice::ReadWrite); - conf.clear(); - conf.setValue("file_k", editFileK->value().value().file); - conf.setValue("file_x", editFileX->value().value().file); - conf.setValue("file_c", editFileC->value().value().file); - conf.setValue("file_m", editFileM->value().value().file); - conf.setValue("sync_files", checkSyncFiles->isChecked()); - conf.setValue("session_name", lineSessionName->text()); - conf.setValue("icon_path", last_icon); - conf.setValue("icon", appIcon()); - conf.setValue("has_k", checkHasK->isChecked()); - conf.setValue("has_x", checkHasX->isChecked()); - conf.setValue("has_c", checkHasC->isChecked()); - conf.setValue("has_m", checkHasM->isChecked()); - conf.setValue("default_config", checkDefaultConfig->isChecked()); - conf.setValue("config", QString2QByteArray(codeConfig->text())); - conf.setValue("session_gr", session_gr); - conf.setValue("session_dk", session_dk); - conf.setValue("session_mw", session_mw); - file_name = path; - return true; - - //widgetK->setFile(path); - //widgetK->save(); -} - - -void CDPultWindow::loadingSession(QPIConfig & conf) { - setRecentFiles(conf.getValue("recent files").toStringList()); -} - - -void CDPultWindow::savingSession(QPIConfig & conf) { - conf.setValue("recent files", recentFiles()); -} - - -QByteArray CDPultWindow::appIcon() const { - QByteArray ret; - if (icon.isNull()) return ret; - QBuffer buff(&ret); - buff.open(QIODevice::WriteOnly); - icon.save(&buff, "png"); - //qDebug() << "s" << ret.size(); - return ret; -} - - -void CDPultWindow::setAppIcon(QByteArray ba) { - if (ba.isEmpty()) { - icon = QImage(); - setWindowIcon(QIcon()); - return; - } - //qDebug() << "l" << ba.size(); - icon = QImage::fromData(ba); - setWindowIcon(QIcon(QPixmap::fromImage(icon))); - //qDebug() << QApplication::windowIcon().availableSizes(); -} - - -void CDPultWindow::addToLog(CDViewWidget::LogIcon icon, const QString & msg) { - QListWidgetItem * ni = new QListWidgetItem(log_icons[icon], "(" + QTime::currentTime().toString() + ") " + msg); - bool s = listLog->verticalScrollBar()->value() == listLog->verticalScrollBar()->maximum(); - listLog->addItem(ni); - if (s) listLog->scrollToBottom(); -} - - -void CDPultWindow::messageReceived(QString path, int type, QString msg) { - MessageType mt = (MessageType)type; - const CDType & t(M.root()[CDCore::stringToPath(Q2PIString(path))]); - if (t.cd_type() != CDType::cdM) return; - if (mt == MessageBox) - QMessageBox::information(this, windowTitle(), QString("[%1]\n%2").arg(PI2QString(t.name()), msg)); -} - - -void CDPultWindow::on_editFileK_valueChanged(const QVariant & p) { - if (!checkSyncFiles->isChecked()) return; - QFileInfo fi(p.value().file); - if (fi.path().isEmpty()) return; - QString n = fi.baseName(); - QString xn(n), cn(n), mn(n); - if (n.contains("k")) { - xn.replace(n.indexOf("k"), 1, "x"); - cn.replace(n.indexOf("k"), 1, "c"); - mn.replace(n.indexOf("k"), 1, "m"); - } else { - xn += "_x"; - cn += "_c"; - mn += "_m"; - } - QString ext = fi.suffix(), dot, dir; - QString kfn(fi.filePath()); - if (!ext.isEmpty()) { - kfn.chop(ext.size()); - if (kfn.endsWith(".")) { - kfn.chop(1); - dot = "."; - } - } - if (!fi.path().isEmpty() && fi.path() != ".") { - dir = fi.path(); - if (!dir.endsWith("/")) - dir += "/"; - } - QAD::File f = editFileK->value().value(); - f.file = dir + xn + dot + ext; editFileX->setValue(QVariant::fromValue(f)); - f.file = dir + cn + dot + ext; editFileC->setValue(QVariant::fromValue(f)); - f.file = dir + mn + dot + ext; editFileM->setValue(QVariant::fromValue(f)); -} - - -void CDPultWindow::on_buttonSessionApply_clicked() { - apply(false); -} - - -void CDPultWindow::on_lineSessionName_textChanged(const QString & t) { - setWindowTitle(QString("CD Pult - %1").arg(t)); -} - - -void CDPultWindow::on_buttonIcon_clicked() { - QList ifl = QImageReader::supportedImageFormats(); - QStringList sfl; foreach (QByteArray s, ifl) sfl << ("*." + QString(s).toLower()); - QString f = QFileDialog::getOpenFileName(this, tr("Select icon"), last_icon, tr("Images") + " (" + sfl.join(" ") + ")"); - if (f.isEmpty()) return; - last_icon = f; - icon = QImage(last_icon); - setWindowIcon(QIcon(QPixmap::fromImage(icon))); -} +#include "edockwidget.h" +#include "cdpultwindow.h" +#include "cdutils_core.h" +#include "cdutils_k.h" +#include "cdutils_x.h" +#include "cdutils_m.h" +#include "qcd_core.h" +#include "qcd_view.h" +#include "qcd_model.h" +#include "qcd_modedialog.h" +#include "chunkstream.h" +#include "qvariantedit.h" +#include "piqt.h" +#include "piqt_highlighter.h" +#include "qcodeedit.h" +#include +#include +#include +#include + +using namespace CDUtils; + + +CDPultWindow::CDPultWindow(QWidget *parent) : EMainWindow(parent), Ui::CDPultWindow() { + setupUi(this); + centralWidget()->hide(); + setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); + CDCore::instance()->initPult(); + def_config = codeConfig->text(); + checkDefaultConfig->setChecked(true); + new ConfigHighlighter(codeConfig->document()); + widgetK->setType(CDUtils::CDType::cdK); + widgetX->setType(CDUtils::CDType::cdX); + widgetC->setType(CDUtils::CDType::cdC); + widgetM->setType(CDUtils::CDType::cdM); + editFileK->setValue(QVariant::fromValue(QAD::File("", "*.dat"))); + editFileX->setValue(QVariant::fromValue(QAD::File("", "*.dat"))); + editFileC->setValue(QVariant::fromValue(QAD::File("", "*.dat"))); + editFileM->setValue(QVariant::fromValue(QAD::File("", "*.dat"))); + log_icons[CDViewWidget::OKIcon] = QIcon(":/icons/dialog-ok-apply.png"); + log_icons[CDViewWidget::FailIcon] = QIcon(":/icons/dialog-cancel.png"); + log_icons[CDViewWidget::WaitIcon] = QIcon(":/icons/timer.png"); + setRecentMenu(menuOpen_recent); + ribbon = new Ribbon(this); + session.setFile("session_cdpult.conf"); + session.addEntry(this); + session.addEntry(ribbon->tabWidget()); + session.load(); + reset(); + connect(widgetK, SIGNAL(addToLog(CDViewWidget::LogIcon,QString)), this, SLOT(addToLog(CDViewWidget::LogIcon,QString))); + connect(widgetX, SIGNAL(addToLog(CDViewWidget::LogIcon,QString)), this, SLOT(addToLog(CDViewWidget::LogIcon,QString))); + connect(widgetC, SIGNAL(addToLog(CDViewWidget::LogIcon,QString)), this, SLOT(addToLog(CDViewWidget::LogIcon,QString))); + connect(widgetM, SIGNAL(addToLog(CDViewWidget::LogIcon,QString)), this, SLOT(addToLog(CDViewWidget::LogIcon,QString))); + connect(widgetK->view, SIGNAL(changedGlobal()), widgetDirectK, SLOT(changedGlobal())); + connect(widgetX->view, SIGNAL(changedGlobal()), widgetGraphics, SLOT(changedGlobal())); + connect(widgetX->view, SIGNAL(receivedX()), widgetGraphics, SLOT(receivedX())); + connect(widgetM->view, SIGNAL(messageReceived(QString,int,QString)), this, SLOT(messageReceived(QString,int,QString))); + QCDCore::instance()->bindWidget(widgetK->view); + QCDCore::instance()->setDirectKEnabled(true); + X.start(); + if (windowState() == Qt::WindowMinimized) + setWindowState(Qt::WindowNoState); +} + + +CDPultWindow::~CDPultWindow() { +} + + +void CDPultWindow::loadFile(const QString & fp) { + load(fp); +} + + +void CDPultWindow::apply(bool sessions) { + CDCore::instance()->stop(); + widgetK->setFile(editFileK->value().value().file); + widgetX->setFile(editFileX->value().value().file); + widgetC->setFile(editFileC->value().value().file); + widgetM->setFile(editFileM->value().value().file); + if (checkDefaultConfig->isChecked()) + CDCore::instance()->initPult(); + else + CDCore::instance()->init(Q2PIString(codeConfig->text()), true); + widgetX->view->startX(); + if (sessions) { + widgetGraphics->load(session_gr); + widgetDirectK->load(session_dk); + if (!session_mw.isEmpty()) + restoreState(session_mw); + X.lock(); + PIVector > x_list = X.enabledList(); + X.unlock(); + piForeachC (PIDeque & p, x_list) + X.enable(X[p]); + ((CDItemModel*)widgetX->view->model())->updateModel(); + widgetX->view->expandAll(); + } + dockCDKView->setVisible(checkHasK->isChecked()); + dockCDXView->setVisible(checkHasX->isChecked()); + dockCDCView->setVisible(checkHasC->isChecked()); + dockCDMView->setVisible(checkHasM->isChecked()); + QMetaObject::invokeMethod(this, "changedDock", Qt::QueuedConnection); +} + + +void CDPultWindow::closeEvent(QCloseEvent *e) { + EMainWindow::closeEvent(e); + if (!e->isAccepted()) + return; + QApplication::closeAllWindows(); + session.save(); + session.setFile(QString()); +} + + +void CDPultWindow::reset(bool full) { + setWindowTitle(QString("CD Pult")); + widgetK->reset(); + setChanged(false); +} + + +bool CDPultWindow::load(const QString & path) { + qApp->setOverrideCursor(Qt::WaitCursor); + QPIConfig conf(path, QIODevice::ReadOnly); + QAD::File f = editFileK->value().value(); + checkSyncFiles->setChecked(false); + editFileK->setValue(QVariant::fromValue(QAD::File(conf.getValue("file_k").toString(), f.filter))); + editFileX->setValue(QVariant::fromValue(QAD::File(conf.getValue("file_x").toString(), f.filter))); + editFileC->setValue(QVariant::fromValue(QAD::File(conf.getValue("file_c").toString(), f.filter))); + editFileM->setValue(QVariant::fromValue(QAD::File(conf.getValue("file_m").toString(), f.filter))); + checkSyncFiles->setChecked(conf.getValue("sync_files").toBool()); + lineSessionName->setText(conf.getValue("session_name").toString()); + last_icon = conf.getValue("icon_path").toString(); + setAppIcon(conf.getValue("icon").toByteArray()); + checkHasK->setChecked(conf.getValue("has_k").toBool()); + checkHasX->setChecked(conf.getValue("has_x").toBool()); + checkHasC->setChecked(conf.getValue("has_c").toBool()); + checkHasM->setChecked(conf.getValue("has_m").toBool()); + checkDefaultConfig->setChecked(conf.getValue("default_config").toBool()); + codeConfig->setText(QByteArray2QString(conf.getValue("config").toByteArray())); + if (codeConfig->text().isEmpty()) + codeConfig->setText(def_config); + session_gr = conf.getValue("session_gr").toByteArray(); + session_dk = conf.getValue("session_dk").toByteArray(); + session_mw = conf.getValue("session_mw").toByteArray(); + setChanged(false); + file_name = path; + apply(true); + qApp->restoreOverrideCursor(); + return true; +} + + +bool CDPultWindow::save(const QString & path) { + session_gr = widgetGraphics->save(); + session_dk = widgetDirectK->save(); + session_mw = saveState(); + QPIConfig conf(path, QIODevice::ReadWrite); + conf.clear(); + conf.setValue("file_k", editFileK->value().value().file); + conf.setValue("file_x", editFileX->value().value().file); + conf.setValue("file_c", editFileC->value().value().file); + conf.setValue("file_m", editFileM->value().value().file); + conf.setValue("sync_files", checkSyncFiles->isChecked()); + conf.setValue("session_name", lineSessionName->text()); + conf.setValue("icon_path", last_icon); + conf.setValue("icon", appIcon()); + conf.setValue("has_k", checkHasK->isChecked()); + conf.setValue("has_x", checkHasX->isChecked()); + conf.setValue("has_c", checkHasC->isChecked()); + conf.setValue("has_m", checkHasM->isChecked()); + conf.setValue("default_config", checkDefaultConfig->isChecked()); + conf.setValue("config", QString2QByteArray(codeConfig->text())); + conf.setValue("session_gr", session_gr); + conf.setValue("session_dk", session_dk); + conf.setValue("session_mw", session_mw); + file_name = path; + return true; + + //widgetK->setFile(path); + //widgetK->save(); +} + + +void CDPultWindow::loadingSession(QPIConfig & conf) { + setRecentFiles(conf.getValue("recent files").toStringList()); +} + + +void CDPultWindow::savingSession(QPIConfig & conf) { + conf.setValue("recent files", recentFiles()); +} + + +QByteArray CDPultWindow::appIcon() const { + QByteArray ret; + if (icon.isNull()) return ret; + QBuffer buff(&ret); + buff.open(QIODevice::WriteOnly); + icon.save(&buff, "png"); + //qDebug() << "s" << ret.size(); + return ret; +} + + +void CDPultWindow::setAppIcon(QByteArray ba) { + if (ba.isEmpty()) { + icon = QImage(); + setWindowIcon(QIcon()); + return; + } + //qDebug() << "l" << ba.size(); + icon = QImage::fromData(ba); + setWindowIcon(QIcon(QPixmap::fromImage(icon))); + //qDebug() << QApplication::windowIcon().availableSizes(); +} + + +void CDPultWindow::addToLog(CDViewWidget::LogIcon icon, const QString & msg) { + QListWidgetItem * ni = new QListWidgetItem(log_icons[icon], "(" + QTime::currentTime().toString() + ") " + msg); + bool s = listLog->verticalScrollBar()->value() == listLog->verticalScrollBar()->maximum(); + listLog->addItem(ni); + if (s) listLog->scrollToBottom(); +} + + +void CDPultWindow::messageReceived(QString path, int type, QString msg) { + MessageType mt = (MessageType)type; + const CDType & t(M.root()[CDCore::stringToPath(Q2PIString(path))]); + if (t.cd_type() != CDType::cdM) return; + if (mt == MessageBox) + QMessageBox::information(this, windowTitle(), QString("[%1]\n%2").arg(PI2QString(t.name()), msg)); +} + + +void CDPultWindow::on_editFileK_valueChanged(const QVariant & p) { + if (!checkSyncFiles->isChecked()) return; + QFileInfo fi(p.value().file); + if (fi.path().isEmpty()) return; + QString n = fi.baseName(); + QString xn(n), cn(n), mn(n); + if (n.contains("k")) { + xn.replace(n.indexOf("k"), 1, "x"); + cn.replace(n.indexOf("k"), 1, "c"); + mn.replace(n.indexOf("k"), 1, "m"); + } else { + xn += "_x"; + cn += "_c"; + mn += "_m"; + } + QString ext = fi.suffix(), dot, dir; + QString kfn(fi.filePath()); + if (!ext.isEmpty()) { + kfn.chop(ext.size()); + if (kfn.endsWith(".")) { + kfn.chop(1); + dot = "."; + } + } + if (!fi.path().isEmpty() && fi.path() != ".") { + dir = fi.path(); + if (!dir.endsWith("/")) + dir += "/"; + } + QAD::File f = editFileK->value().value(); + f.file = dir + xn + dot + ext; editFileX->setValue(QVariant::fromValue(f)); + f.file = dir + cn + dot + ext; editFileC->setValue(QVariant::fromValue(f)); + f.file = dir + mn + dot + ext; editFileM->setValue(QVariant::fromValue(f)); +} + + +void CDPultWindow::on_buttonSessionApply_clicked() { + apply(false); +} + + +void CDPultWindow::on_lineSessionName_textChanged(const QString & t) { + setWindowTitle(QString("CD Pult - %1").arg(t)); +} + + +void CDPultWindow::on_buttonIcon_clicked() { + QList ifl = QImageReader::supportedImageFormats(); + QStringList sfl; foreach (QByteArray s, ifl) sfl << ("*." + QString(s).toLower()); + QString f = QFileDialog::getOpenFileName(this, tr("Select icon"), last_icon, tr("Images") + " (" + sfl.join(" ") + ")"); + if (f.isEmpty()) return; + last_icon = f; + icon = QImage(last_icon); + setWindowIcon(QIcon(QPixmap::fromImage(icon))); +} diff --git a/qcd_utils/pult/cdpultwindow.h b/piqt/utils/cd_pult/cdpultwindow.h similarity index 96% rename from qcd_utils/pult/cdpultwindow.h rename to piqt/utils/cd_pult/cdpultwindow.h index 6e8c499..dad2c2b 100644 --- a/qcd_utils/pult/cdpultwindow.h +++ b/piqt/utils/cd_pult/cdpultwindow.h @@ -1,53 +1,53 @@ -#ifndef CDPULTWINDOW_H -#define CDPULTWINDOW_H - -#include "emainwindow.h" -#include "ui_cdpultwindow.h" -#include "cdviewwidget.h" -#include "ribbon.h" -#include "piobject.h" - - -class CDPultWindow : public EMainWindow, public Ui::CDPultWindow -{ - Q_OBJECT - Q_ENUMS(LogIcon) -public: - - explicit CDPultWindow(QWidget *parent = 0); - ~CDPultWindow(); - void loadFile(const QString & fp); - void apply(bool sessions); - -private: - - void closeEvent(QCloseEvent *); - void reset(bool full = false); - bool load(const QString & path); - bool save(const QString & path); - QString loadFilter() {return "Pult session(*.conf)";} - QString saveFilter() {return loadFilter();} - void loadingSession(QPIConfig & conf); - void savingSession(QPIConfig & conf); - - QByteArray appIcon() const; - void setAppIcon(QByteArray ba); - - Ribbon * ribbon; - QMap log_icons; - QByteArray session_gr, session_dk, session_mw; - QString def_config, last_icon; - QImage icon; - -private slots: - void addToLog(CDViewWidget::LogIcon icon, const QString & msg); - void messageReceived(QString path, int type, QString msg); - - void on_editFileK_valueChanged(const QVariant & p); - void on_buttonSessionApply_clicked(); - - void on_lineSessionName_textChanged(const QString & t); - void on_buttonIcon_clicked(); -}; - -#endif // CDPULTWINDOW_H +#ifndef CDPULTWINDOW_H +#define CDPULTWINDOW_H + +#include "emainwindow.h" +#include "ui_cdpultwindow.h" +#include "cdviewwidget.h" +#include "ribbon.h" +#include "piobject.h" + + +class CDPultWindow : public EMainWindow, public Ui::CDPultWindow +{ + Q_OBJECT + Q_ENUMS(LogIcon) +public: + + explicit CDPultWindow(QWidget *parent = 0); + ~CDPultWindow(); + void loadFile(const QString & fp); + void apply(bool sessions); + +private: + + void closeEvent(QCloseEvent *); + void reset(bool full = false); + bool load(const QString & path); + bool save(const QString & path); + QString loadFilter() {return "Pult session(*.conf)";} + QString saveFilter() {return loadFilter();} + void loadingSession(QPIConfig & conf); + void savingSession(QPIConfig & conf); + + QByteArray appIcon() const; + void setAppIcon(QByteArray ba); + + Ribbon * ribbon; + QMap log_icons; + QByteArray session_gr, session_dk, session_mw; + QString def_config, last_icon; + QImage icon; + +private slots: + void addToLog(CDViewWidget::LogIcon icon, const QString & msg); + void messageReceived(QString path, int type, QString msg); + + void on_editFileK_valueChanged(const QVariant & p); + void on_buttonSessionApply_clicked(); + + void on_lineSessionName_textChanged(const QString & t); + void on_buttonIcon_clicked(); +}; + +#endif // CDPULTWINDOW_H diff --git a/qcd_utils/pult/cdpultwindow.ui b/piqt/utils/cd_pult/cdpultwindow.ui similarity index 96% rename from qcd_utils/pult/cdpultwindow.ui rename to piqt/utils/cd_pult/cdpultwindow.ui index e7a1904..ee0273c 100644 --- a/qcd_utils/pult/cdpultwindow.ui +++ b/piqt/utils/cd_pult/cdpultwindow.ui @@ -1,612 +1,612 @@ - - - CDPultWindow - - - - 0 - 0 - 798 - 593 - - - - CD Pult - - - true - - - QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks - - - - - - 0 - 0 - 798 - 24 - - - - - Main - - - - Open recent - - - - :/icons/document-open-recent.png:/icons/document-open-recent.png - - - - - - - - - - - - - :/icons/document-edit.png:/icons/document-edit.png - - - K - - - 1 - - - - - 0 - - - - - - - - - - - :/icons/dialog-information.png:/icons/dialog-information.png - - - Log - - - 8 - - - - - - - QAbstractItemView::NoEditTriggers - - - false - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - QAbstractItemView::ScrollPerPixel - - - QAbstractItemView::ScrollPerPixel - - - - - - - - - - :/icons/qvariantedit.png:/icons/qvariantedit.png - - - X - - - 1 - - - - - - - - - - - - - :/icons/configure.png:/icons/configure.png - - - Session - - - 2 - - - - - - - Apply - - - - :/icons/dialog-ok-apply.png:/icons/dialog-ok-apply.png - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - Name: - - - - - - - - - - - - Select icon... - - - - :/icons/view-preview.png:/icons/view-preview.png - - - - - - - - - K file: - - - - - - - - - - X file: - - - - - - - - - - C file: - - - - - - - - - - Sync files - - - - - - - - - K - - - - - - - X - - - - - - - C - - - - - - - M - - - - - - - - - Default config - - - - - - - M file: - - - - - - - - - - - - - 0 - 0 - - - - include = ip.conf -[connection] -device.cd = eth://udp:${ip.pult}:27002:${ip.app}:27001 #s -[] - - - - - DejaVu Sans Mono - 9 - - - - - - - - - - - :/icons/legend.png:/icons/legend.png - - - C - - - 1 - - - - - - - - - - - - - :/icons/format-stroke-color.png:/icons/format-stroke-color.png - - - Graphics - - - 8 - - - - - - - - - - - - - :/icons/tools-wizard.png:/icons/tools-wizard.png - - - Direct K - - - 8 - - - - - - - - - - - - - :/icons/accessories-text-editor.png:/icons/accessories-text-editor.png - - - M - - - 1 - - - - - - - - - - - - - :/icons/document-open.png:/icons/document-open.png - - - Open... - - - Ctrl+O - - - - - - :/icons/document-save.png:/icons/document-save.png - - - Save - - - Ctrl+S - - - - - - :/icons/document-save-as.png:/icons/document-save-as.png - - - Save As... - - - Ctrl+Shift+S - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EMainWindow - QMainWindow -
emainwindow.h
- 1 -
- - CLineEdit - QLineEdit -
clineedit.h
-
- - QCodeEdit - QWidget -
qcodeedit.h
-
- - QVariantEdit - QWidget -
qvariantedit.h
-
- - EDockWidget - QDockWidget -
edockwidget.h
- 1 -
- - CDViewWidget - QWidget -
cdviewwidget.h
- 1 -
- - CDGraphics - QWidget -
cdgraphics.h
- 1 -
- - CDDirectK - QWidget -
cddirectk.h
- 1 -
-
- - - - - - - - - actionSave - triggered() - CDPultWindow - saveFile() - - - -1 - -1 - - - 399 - 299 - - - - - actionSaveAs - triggered() - CDPultWindow - saveAsFile() - - - -1 - -1 - - - 399 - 299 - - - - - actionOpen - triggered() - CDPultWindow - openFile() - - - -1 - -1 - - - 399 - 299 - - - - - checkSyncFiles - toggled(bool) - editFileX - setDisabled(bool) - - - 786 - 220 - - - 786 - 151 - - - - - checkSyncFiles - toggled(bool) - editFileC - setDisabled(bool) - - - 786 - 220 - - - 786 - 172 - - - - - checkDefaultConfig - toggled(bool) - codeConfig - setDisabled(bool) - - - 786 - 276 - - - 581 - 304 - - - - - checkSyncFiles - toggled(bool) - editFileM - setDisabled(bool) - - - 767 - 205 - - - 767 - 187 - - - - -
+ + + CDPultWindow + + + + 0 + 0 + 798 + 593 + + + + CD Pult + + + true + + + QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks + + + + + + 0 + 0 + 798 + 24 + + + + + Main + + + + Open recent + + + + :/icons/document-open-recent.png:/icons/document-open-recent.png + + + + + + + + + + + + + :/icons/document-edit.png:/icons/document-edit.png + + + K + + + 1 + + + + + 0 + + + + + + + + + + + :/icons/dialog-information.png:/icons/dialog-information.png + + + Log + + + 8 + + + + + + + QAbstractItemView::NoEditTriggers + + + false + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + QAbstractItemView::ScrollPerPixel + + + QAbstractItemView::ScrollPerPixel + + + + + + + + + + :/icons/qvariantedit.png:/icons/qvariantedit.png + + + X + + + 1 + + + + + + + + + + + + + :/icons/configure.png:/icons/configure.png + + + Session + + + 2 + + + + + + + Apply + + + + :/icons/dialog-ok-apply.png:/icons/dialog-ok-apply.png + + + + + + + QFormLayout::AllNonFixedFieldsGrow + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + Name: + + + + + + + + + + + + Select icon... + + + + :/icons/view-preview.png:/icons/view-preview.png + + + + + + + + + K file: + + + + + + + + + + X file: + + + + + + + + + + C file: + + + + + + + + + + Sync files + + + + + + + + + K + + + + + + + X + + + + + + + C + + + + + + + M + + + + + + + + + Default config + + + + + + + M file: + + + + + + + + + + + + + 0 + 0 + + + + include = ip.conf +[connection] +device.cd = eth://udp:${ip.pult}:27002:${ip.app}:27001 #s +[] + + + + + DejaVu Sans Mono + 9 + + + + + + + + + + + :/icons/legend.png:/icons/legend.png + + + C + + + 1 + + + + + + + + + + + + + :/icons/format-stroke-color.png:/icons/format-stroke-color.png + + + Graphics + + + 8 + + + + + + + + + + + + + :/icons/tools-wizard.png:/icons/tools-wizard.png + + + Direct K + + + 8 + + + + + + + + + + + + + :/icons/accessories-text-editor.png:/icons/accessories-text-editor.png + + + M + + + 1 + + + + + + + + + + + + + :/icons/document-open.png:/icons/document-open.png + + + Open... + + + Ctrl+O + + + + + + :/icons/document-save.png:/icons/document-save.png + + + Save + + + Ctrl+S + + + + + + :/icons/document-save-as.png:/icons/document-save-as.png + + + Save As... + + + Ctrl+Shift+S + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EMainWindow + QMainWindow +
emainwindow.h
+ 1 +
+ + CLineEdit + QLineEdit +
clineedit.h
+
+ + QCodeEdit + QWidget +
qcodeedit.h
+
+ + QVariantEdit + QWidget +
qvariantedit.h
+
+ + EDockWidget + QDockWidget +
edockwidget.h
+ 1 +
+ + CDViewWidget + QWidget +
cdviewwidget.h
+ 1 +
+ + CDGraphics + QWidget +
cdgraphics.h
+ 1 +
+ + CDDirectK + QWidget +
cddirectk.h
+ 1 +
+
+ + + + + + + + + actionSave + triggered() + CDPultWindow + saveFile() + + + -1 + -1 + + + 399 + 299 + + + + + actionSaveAs + triggered() + CDPultWindow + saveAsFile() + + + -1 + -1 + + + 399 + 299 + + + + + actionOpen + triggered() + CDPultWindow + openFile() + + + -1 + -1 + + + 399 + 299 + + + + + checkSyncFiles + toggled(bool) + editFileX + setDisabled(bool) + + + 786 + 220 + + + 786 + 151 + + + + + checkSyncFiles + toggled(bool) + editFileC + setDisabled(bool) + + + 786 + 220 + + + 786 + 172 + + + + + checkDefaultConfig + toggled(bool) + codeConfig + setDisabled(bool) + + + 786 + 276 + + + 581 + 304 + + + + + checkSyncFiles + toggled(bool) + editFileM + setDisabled(bool) + + + 767 + 205 + + + 767 + 187 + + + + +
diff --git a/qcd_utils/pult/cdviewwidget.cpp b/piqt/utils/cd_pult/cdviewwidget.cpp similarity index 96% rename from qcd_utils/pult/cdviewwidget.cpp rename to piqt/utils/cd_pult/cdviewwidget.cpp index a01c87a..67fa124 100644 --- a/qcd_utils/pult/cdviewwidget.cpp +++ b/piqt/utils/cd_pult/cdviewwidget.cpp @@ -1,78 +1,78 @@ -#include "cdviewwidget.h" -#include "cdutils_core.h" -#include "qcd_core.h" -#include "qcd_model.h" -#include "qcd_modedialog.h" -#include "qvariantedit.h" -#include - - -CDViewWidget::CDViewWidget(QWidget * parent) : QWidget(parent), Ui::CDViewWidget() { - qRegisterMetaType("CDViewWidget::LogIcon"); - setupUi(this); - connect(view, SIGNAL(sendSucceed()), this, SLOT(sended())); - connect(view, SIGNAL(receiveSucceed()), this, SLOT(received())); - connect(view, SIGNAL(sendFailed()), this, SLOT(sendFailed())); - connect(view, SIGNAL(receiveFailed()), this, SLOT(receiveFailed())); -} - - -CDViewWidget::~CDViewWidget() { -} - - -void CDViewWidget::reset() { - setFile(""); -} - - -void CDViewWidget::setType(int t) { - view->setType((CDUtils::CDType::cdT)t); - tl_u = view->typeLetter().toUpper(); - tl_l = view->typeLetter().toLower(); - view->refresh(); -} - - -void CDViewWidget::setFile(const QString & f) { - view->setFile(f); - view->load(); -} - - -void CDViewWidget::on_buttonSend_clicked() { - if (view->inProgress()) {addToLog(WaitIcon, "processing..."); return;} - addToLog(WaitIcon, "Sending " + tl_u + "..."); - view->send(); -} - - -void CDViewWidget::on_buttonReceive_clicked() { - if (view->inProgress()) {addToLog(WaitIcon, "processing..."); return;} - addToLog(WaitIcon, "Receiving " + tl_u + "..."); - view->receive(); -} - - -void CDViewWidget::on_buttonLoad_clicked() { - view->load(); -} - - -void CDViewWidget::on_buttonSave_clicked() { - view->save(); -} - - -void CDViewWidget::on_buttonParse_clicked() { - QString path = QFileDialog::getOpenFileName(this, "Select header file", "", - QString("%1 Description(%2_description.h);;Headers(*.h)").arg(tl_u, tl_l)); - if (path.isEmpty()) return; - CDUtils::UpdateModeFlags mode = CDUtils::SaveByName; - if (!view->root()->isEmpty()) { - QCDModeDialog cdm; - if (cdm.exec() != QDialog::Accepted) return; - mode = cdm.mode(); - } - view->buildFromHeader(path, mode); -} +#include "cdviewwidget.h" +#include "cdutils_core.h" +#include "qcd_core.h" +#include "qcd_model.h" +#include "qcd_modedialog.h" +#include "qvariantedit.h" +#include + + +CDViewWidget::CDViewWidget(QWidget * parent) : QWidget(parent), Ui::CDViewWidget() { + qRegisterMetaType("CDViewWidget::LogIcon"); + setupUi(this); + connect(view, SIGNAL(sendSucceed()), this, SLOT(sended())); + connect(view, SIGNAL(receiveSucceed()), this, SLOT(received())); + connect(view, SIGNAL(sendFailed()), this, SLOT(sendFailed())); + connect(view, SIGNAL(receiveFailed()), this, SLOT(receiveFailed())); +} + + +CDViewWidget::~CDViewWidget() { +} + + +void CDViewWidget::reset() { + setFile(""); +} + + +void CDViewWidget::setType(int t) { + view->setType((CDUtils::CDType::cdT)t); + tl_u = view->typeLetter().toUpper(); + tl_l = view->typeLetter().toLower(); + view->refresh(); +} + + +void CDViewWidget::setFile(const QString & f) { + view->setFile(f); + view->load(); +} + + +void CDViewWidget::on_buttonSend_clicked() { + if (view->inProgress()) {addToLog(WaitIcon, "processing..."); return;} + addToLog(WaitIcon, "Sending " + tl_u + "..."); + view->send(); +} + + +void CDViewWidget::on_buttonReceive_clicked() { + if (view->inProgress()) {addToLog(WaitIcon, "processing..."); return;} + addToLog(WaitIcon, "Receiving " + tl_u + "..."); + view->receive(); +} + + +void CDViewWidget::on_buttonLoad_clicked() { + view->load(); +} + + +void CDViewWidget::on_buttonSave_clicked() { + view->save(); +} + + +void CDViewWidget::on_buttonParse_clicked() { + QString path = QFileDialog::getOpenFileName(this, "Select header file", "", + QString("%1 Description(%2_description.h);;Headers(*.h)").arg(tl_u, tl_l)); + if (path.isEmpty()) return; + CDUtils::UpdateModeFlags mode = CDUtils::SaveByName; + if (!view->root()->isEmpty()) { + QCDModeDialog cdm; + if (cdm.exec() != QDialog::Accepted) return; + mode = cdm.mode(); + } + view->buildFromHeader(path, mode); +} diff --git a/qcd_utils/pult/cdviewwidget.h b/piqt/utils/cd_pult/cdviewwidget.h similarity index 96% rename from qcd_utils/pult/cdviewwidget.h rename to piqt/utils/cd_pult/cdviewwidget.h index 3145666..9b1abb1 100644 --- a/qcd_utils/pult/cdviewwidget.h +++ b/piqt/utils/cd_pult/cdviewwidget.h @@ -1,41 +1,41 @@ -#ifndef CDVIEWWIDGET_H -#define CDVIEWWIDGET_H - -#include -#include "ui_cdviewwidget.h" - - -class CDViewWidget : public QWidget, public Ui::CDViewWidget -{ - Q_OBJECT -public: - explicit CDViewWidget(QWidget *parent = 0); - ~CDViewWidget(); - - enum LogIcon {NoIcon, OKIcon, FailIcon, WaitIcon}; - - void reset(); - void setType(int t); - void setFile(const QString & f); - -private: - QString tl_u, tl_l; - -private slots: - void sended() {addToLog(OKIcon, tl_u + " " + tr("sended succesfull"));} - void received() {addToLog(OKIcon, tl_u + " " + tr("received succesfull"));} - void sendFailed() {addToLog(FailIcon, tl_u + " " + tr("NOT sended"));} - void receiveFailed() {addToLog(FailIcon, tl_u + " " + tr("NOT received"));} - void on_buttonSend_clicked(); - void on_buttonReceive_clicked(); - void on_buttonLoad_clicked(); - void on_buttonSave_clicked(); - void on_buttonParse_clicked(); - //void on_buttonCalculate_clicked(); - -signals: - void addToLog(CDViewWidget::LogIcon icon, const QString & msg); - -}; - -#endif // CDVIEWWIDGET_H +#ifndef CDVIEWWIDGET_H +#define CDVIEWWIDGET_H + +#include +#include "ui_cdviewwidget.h" + + +class CDViewWidget : public QWidget, public Ui::CDViewWidget +{ + Q_OBJECT +public: + explicit CDViewWidget(QWidget *parent = 0); + ~CDViewWidget(); + + enum LogIcon {NoIcon, OKIcon, FailIcon, WaitIcon}; + + void reset(); + void setType(int t); + void setFile(const QString & f); + +private: + QString tl_u, tl_l; + +private slots: + void sended() {addToLog(OKIcon, tl_u + " " + tr("sended succesfull"));} + void received() {addToLog(OKIcon, tl_u + " " + tr("received succesfull"));} + void sendFailed() {addToLog(FailIcon, tl_u + " " + tr("NOT sended"));} + void receiveFailed() {addToLog(FailIcon, tl_u + " " + tr("NOT received"));} + void on_buttonSend_clicked(); + void on_buttonReceive_clicked(); + void on_buttonLoad_clicked(); + void on_buttonSave_clicked(); + void on_buttonParse_clicked(); + //void on_buttonCalculate_clicked(); + +signals: + void addToLog(CDViewWidget::LogIcon icon, const QString & msg); + +}; + +#endif // CDVIEWWIDGET_H diff --git a/qcd_utils/pult/cdviewwidget.ui b/piqt/utils/cd_pult/cdviewwidget.ui similarity index 96% rename from qcd_utils/pult/cdviewwidget.ui rename to piqt/utils/cd_pult/cdviewwidget.ui index 5b0ff0b..eb2d44c 100644 --- a/qcd_utils/pult/cdviewwidget.ui +++ b/piqt/utils/cd_pult/cdviewwidget.ui @@ -1,176 +1,176 @@ - - - CDViewWidget - - - - 0 - 0 - 689 - 459 - - - - CD Pult - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - Send - - - - :/icons/flame.png:/icons/flame.png - - - - - - - Receive - - - - :/icons/document-revert.png:/icons/document-revert.png - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - Load - - - - :/icons/document-open.png:/icons/document-open.png - - - - - - - Save - - - - :/icons/document-save.png:/icons/document-save.png - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - Update description ... - - - - :/icons/view-refresh.png:/icons/view-refresh.png - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 1 - 20 - - - - - - - - - - - - Qt::CustomContextMenu - - - QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - - - true - - - QAbstractItemView::DragOnly - - - QAbstractItemView::ScrollPerPixel - - - QAbstractItemView::ScrollPerPixel - - - - - - - - CDView - QTreeView -
qcd_view.h
-
-
- - - - - -
+ + + CDViewWidget + + + + 0 + 0 + 689 + 459 + + + + CD Pult + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + Send + + + + :/icons/flame.png:/icons/flame.png + + + + + + + Receive + + + + :/icons/document-revert.png:/icons/document-revert.png + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 20 + 20 + + + + + + + + Load + + + + :/icons/document-open.png:/icons/document-open.png + + + + + + + Save + + + + :/icons/document-save.png:/icons/document-save.png + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 20 + 20 + + + + + + + + Update description ... + + + + :/icons/view-refresh.png:/icons/view-refresh.png + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 1 + 20 + + + + + + + + + + + + Qt::CustomContextMenu + + + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed + + + true + + + QAbstractItemView::DragOnly + + + QAbstractItemView::ScrollPerPixel + + + QAbstractItemView::ScrollPerPixel + + + + + + + + CDView + QTreeView +
qcd_view.h
+
+
+ + + + + +
diff --git a/piqt_utils/piconnedit/icons/Apps-accessories-calculator-icon.png b/piqt/utils/cd_pult/icons/Apps-accessories-calculator-icon.png similarity index 100% rename from piqt_utils/piconnedit/icons/Apps-accessories-calculator-icon.png rename to piqt/utils/cd_pult/icons/Apps-accessories-calculator-icon.png diff --git a/qcd_utils/pult/icons/accessories-text-editor.png b/piqt/utils/cd_pult/icons/accessories-text-editor.png similarity index 100% rename from qcd_utils/pult/icons/accessories-text-editor.png rename to piqt/utils/cd_pult/icons/accessories-text-editor.png diff --git a/qcd_utils/pult/icons/db-export.png b/piqt/utils/cd_pult/icons/db-export.png similarity index 100% rename from qcd_utils/pult/icons/db-export.png rename to piqt/utils/cd_pult/icons/db-export.png diff --git a/qcd_utils/pult/icons/db-import.png b/piqt/utils/cd_pult/icons/db-import.png similarity index 100% rename from qcd_utils/pult/icons/db-import.png rename to piqt/utils/cd_pult/icons/db-import.png diff --git a/qcd_utils/pult/icons/flame.png b/piqt/utils/cd_pult/icons/flame.png similarity index 100% rename from qcd_utils/pult/icons/flame.png rename to piqt/utils/cd_pult/icons/flame.png diff --git a/qcd_utils/pult/icons/timer.png b/piqt/utils/cd_pult/icons/timer.png similarity index 100% rename from qcd_utils/pult/icons/timer.png rename to piqt/utils/cd_pult/icons/timer.png diff --git a/qcd_utils/pult/main.cpp b/piqt/utils/cd_pult/main.cpp similarity index 97% rename from qcd_utils/pult/main.cpp rename to piqt/utils/cd_pult/main.cpp index e40a74c..505f4d0 100644 --- a/qcd_utils/pult/main.cpp +++ b/piqt/utils/cd_pult/main.cpp @@ -1,373 +1,373 @@ -#include -#include "cdpultwindow.h" - -template -class PIHash { - //template friend PIByteArray & operator >>(PIByteArray & s, PIHash & v); - //template friend PIByteArray & operator <<(PIByteArray & s, const PIHash & v); -public: - PIHash() {;} - PIHash(const PIHash & other) {*this = other;} - virtual ~PIHash() {;} - - PIHash & operator =(const PIHash & other) { - if (this == &other) return *this; - clear(); - pih_content = other.pih_content; - return *this; - } - - typedef T mapped_type; - typedef Key key_type; - typedef PIPair value_type; -/* - class iterator { - friend class PIHash; - private: - iterator(const PIHash * v, ssize_t p): parent(v), pos(p) {} - const PIHash * parent; - ssize_t pos; - public: - iterator(): parent(0), pos(0) {} - const Key & key() const {return const_cast * >(parent)->_key(pos);} - T & value() {return const_cast * >(parent)->_value(pos);} - void operator ++() {++pos;} - void operator ++(int) {++pos;} - void operator --() {--pos;} - void operator --(int) {--pos;} - bool operator ==(const iterator & it) const {return (pos == it.pos);} - bool operator !=(const iterator & it) const {return (pos != it.pos);} - }; - - class reverse_iterator { - friend class PIHash; - private: - reverse_iterator(const PIHash * v, ssize_t p): parent(v), pos(p) {} - const PIHash * parent; - ssize_t pos; - public: - reverse_iterator(): parent(0), pos(0) {} - const Key & key() const {return const_cast * >(parent)->_key(pos);} - T & value() const {return const_cast * >(parent)->_value(pos);} - void operator ++() {--pos;} - void operator ++(int) {--pos;} - void operator --() {++pos;} - void operator --(int) {++pos;} - bool operator ==(const reverse_iterator & it) const {return (pos == it.pos);} - bool operator !=(const reverse_iterator & it) const {return (pos != it.pos);} - }; -*/ - class const_iterator { - friend class PIHash; - private: - const_iterator(const PIHash * v, ssize_t p): parent(v), pos(p), bpos(0) { - if (pos == 0) { - pos = -1; - nextPos(); - } - } - void nextPos() { - while (++pos < parent->pih_content.size_s()) { - if (!parent->pih_content[pos].isEmpty()) - return; - } - } - const PIHash * parent; - ssize_t pos, bpos; - public: - const_iterator(): parent(0), pos(0) {} - //const value_type operator *() const {return parent->_pair(pos);} - //const value_type* operator ->() const {cval = parent->_pair(pos); return &cval;} - const Key & key() const {return const_cast * >(parent)->pih_content[pos][bpos].key;} - const T & value() const {return const_cast * >(parent)->pih_content[pos][bpos].value;} - void operator ++() { - if (pos < parent->pih_content.size_s()) { - if (bpos >= parent->pih_content[pos].size_s() - 1) { - bpos = 0; - nextPos(); - } else - ++bpos; - } else { - bpos = 0; - ++pos; - } - printf(" ++: %d %d\n", pos, bpos); - } - //void operator ++(int) {++pos;} - void operator --() { - --pos; - } - //void operator --(int) {--pos;} - bool operator ==(const const_iterator & it) const {return (pos == it.pos && bpos == it.bpos);} - bool operator !=(const const_iterator & it) const {return !(*this == it);} - mutable value_type cval; - }; -/* - class const_reverse_iterator { - friend class PIHash; - private: - const_reverse_iterator(const PIHash * v, ssize_t p): parent(v), pos(p) {} - const PIHash * parent; - ssize_t pos; - public: - const_reverse_iterator(): parent(0), pos(0) {} - const value_type operator *() const {return parent->_pair(pos);} - const value_type* operator ->() const {cval = parent->_pair(pos); return &cval;} - void operator ++() {--pos;} - void operator ++(int) {--pos;} - void operator --() {++pos;} - void operator --(int) {++pos;} - bool operator ==(const const_reverse_iterator & it) const {return (pos == it.pos);} - bool operator !=(const const_reverse_iterator & it) const {return (pos != it.pos);} - mutable value_type cval; - }; -*/ - //iterator begin() {return iterator(this, 0);} - //iterator end() {return iterator(this, size());} - const_iterator begin() const {return const_iterator(this, 0);} - const_iterator end() const {return const_iterator(this, size());} - const_iterator constBegin() const {return const_iterator(this, 0);} - const_iterator constEnd() const {return const_iterator(this, size());} - //reverse_iterator rbegin() {return reverse_iterator(this, size() - 1);} - //reverse_iterator rend() {return reverse_iterator(this, -1);} - //const_reverse_iterator rbegin() const {return const_reverse_iterator(this, size() - 1);} - //const_reverse_iterator rend() const {return const_reverse_iterator(this, -1);} - //const_reverse_iterator constRbegin() const {return const_reverse_iterator(this, size() - 1);} - //const_reverse_iterator constRend() const {return const_reverse_iterator(this, -1);} - - size_t size() const {return pih_content.size();} - int size_s() const {return pih_content.size_s();} - size_t length() const {return pih_content.size();} - size_t capacity() const {return pih_content.size();} - bool isEmpty() const {return (pih_content.size() == 0);} - - T & operator [](const Key & key) { - if (pih_content.isEmpty()) _rehash(1); - uint k = piHash(key); - int i = _index(k); - if (i < pih_content.size_s()) { - PIVector & hv(pih_content[i]); - if (hv.size_s() == 1) { - if (hv[0].key == k) - return hv[0].value; - } - for (int j = 0; j < hv.size_s(); ++j) - if (hv[j].key == k) - return hv[j].value; - } - if (pih_content[i].size_s() >= 4) - _rehash(pih_content.size_s() * 2); - i = _index(k); - pih_content[i] << HashEntry(k); - return pih_content[i].back().value; - } - const T operator [](const Key & key) const {return value(key);} - T & at(const Key & key) {return (*this)[key];} - const T at(const Key & key) const {return (*this)[key];} - - PIHash & operator <<(const PIHash & other) { - if (other.isEmpty()) return *this; - for (int i = 0; i < other.pih_content.size_s(); ++i) - for (int j = 0; j < other.pih_content[i].size_s(); ++j) - insert(other.pih_content[i][j].key, other.pih_content[i][j].value); - return *this; - } - - bool operator ==(const PIHash & t) const {return (pih_content == t.pih_content);} - bool operator !=(const PIHash & t) const {return (pih_content != t.pih_content);} - bool contains(const Key & key) const { - bool f(false); - _find(key, f); - return f; - } - - PIHash & reserve(size_t new_size) {_rehash(new_size); return *this;} - - PIHash & remove(const Key & key) { - uint k = piHash(key); - int i = _index(k); - if (i >= pih_content.size_s()) return *this; - PIVector & hv(pih_content[i]); - for (int j = 0; j < hv.size_s(); ++j) - if (hv[j].key == k) { - hv.remove(j); - --j; - } - return *this; - } - PIHash & erase(const Key & key) {return remove(key);} - PIHash & clear() {pih_content.clear(); return *this;} - - void swap(PIHash & other) { - pih_content.swap(other.pih_content); - } - - PIHash & insert(const Key & key, const T & value) { - (*this)[key] = value; - return *this; - } - const T value(const Key & key, const T & default_ = T()) const { - uint k = piHash(key); - int i = _index(k); - if (i >= pih_content.size_s()) return default_; - const PIVector & hv(pih_content[i]); - for (int j = 0; j < hv.size_s(); ++j) - if (hv[j].key == k) - return hv[j].value; - return default_; - } - PIVector values() const { - PIVector ret; - for (int i = 0; i < pih_content.size_s(); ++i) - for (int j = 0; j < pih_content[i].size_s(); ++j) - ret << pih_content[i][j].value; - return ret; - } - /*Key key(const T & value_, const Key & default_ = Key()) const { - for (int i = 0; i < pih_content.size_s(); ++i) - for (int j = 0; j < pih_content[i].size_s(); ++j) - if (pih_content[i][j].value == value_) - return pih_content[i][j].key; - return default_; - } - PIVector keys() const { - PIVector ret; - for (int i = 0; i < pih_content.size_s(); ++i) - for (int j = 0; j < pih_content[i].size_s(); ++j) - ret << pih_content[i][j].key; - return ret; - }*/ - - /*void dump() { - piCout << "PIHash" << size() << "entries" << PICoutManipulators::NewLine << "content:"; - for (size_t i = 0; i < pih_content.size(); ++i) - piCout << PICoutManipulators::Tab << i << ":" << pih_content[i]; - piCout << "index:"; - for (size_t i = 0; i < pim_index.size(); ++i) - piCout << PICoutManipulators::Tab << i << ":" << pim_index[i].key << "->" << pim_index[i].index; - }*/ - -protected: - struct HashEntry { - HashEntry(uint k = 0, const T & v = T()): key(k), value(v) {;} - uint key; - T value; - bool operator ==(const HashEntry & s) const {return key == s.key;} - bool operator !=(const HashEntry & s) const {return key != s.key;} - bool operator <(const HashEntry & s) const {return key < s.key;} - bool operator >(const HashEntry & s) const {return key > s.key;} - }; - /*template friend PIByteArray & operator >>(PIByteArray & s, PIDeque::HashEntry> & v); - template friend PIByteArray & operator <<(PIByteArray & s, const PIDeque::HashEntry> & v); - - const value_type _pair(ssize_t index) const { - if (index < 0 || index >= pim_index.size_s()) - return value_type(); - //piCout << "_pair" << index << pim_index[index].index; - return value_type(pim_index[index].key, pih_content[pim_index[index].index]); - } - Key & _key(ssize_t index) {return pim_index[index].key;} - T & _value(ssize_t index) {return pih_content[pim_index[index].index];}*/ - - inline size_t asize(size_t s) { - if (s == 0) return 0; - if (pih_content.size() + pih_content.size() >= s && pih_content.size() < s) - return pih_content.size() + pih_content.size(); - ssize_t t = 0, s_ = s - 1; - while (s_ >> t) ++t; - return (1 << t); - } - int _index(const uint & k) const { - return k % pih_content.size_s(); - } - void _rehash(int ns) { - ns = asize(ns); - if (pih_content.size_s() == ns) return; - PIVector > nhc; - nhc.resize(ns); - for (int i = 0; i < pih_content.size_s(); ++i) { - for (int j = 0; j < pih_content[i].size_s(); ++j) { - HashEntry & e(pih_content[i][j]); - int ni = e.key % ns; - nhc[ni] << e; - } - } - pih_content.swap(nhc); - } - - PIVector > pih_content; -}; - - -uint qHash(const PIString & v, uint seed = 0) {return piHash(v);} - - -#include "logview.h" -int main(int argc, char *argv[]) { - QApplication a(argc, argv); -#if QT_VERSION >= 0x050000 - a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); -#endif - //################################ - /*QHash h2; - QMap m2; - PIString prefix = "1234567890"; - PITimeMeasurer tm; - double el = 0.; - - tm.reset(); - for (int i=0; i<10000; ++i) { - h2[prefix + PIString::fromNumber(i)+"1234567890"] = PIString::fromNumber(randomi()); - } - el = tm.elapsed_m(); piCout << el << h2.capacity(); - - tm.reset(); - for (int i=0; i<10000; ++i) { - m2[prefix + PIString::fromNumber(i)+"1234567890"] = PIString::fromNumber(randomi()); - } - el = tm.elapsed_m(); piCout << el; - piCout << "*********"; - - PIString _s; - tm.reset(); - for (int i=0; i<10000; ++i) { - _s = h2.value(prefix + PIString::fromNumber(i)+"1234567890"); - } - el = tm.elapsed_m(); piCout << el << h2.capacity(); - - tm.reset(); - for (int i=0; i<10000; ++i) { - _s = m2.value(prefix + PIString::fromNumber(i)+"1234567890"); - } - el = tm.elapsed_m(); piCout << el; - - return 0;*/ - //################################ -//1245hghgfhfdgshrgnhdsgfhjshdszdgsdgnjedghrbnlcvleabjmbassfdggfhbnsjkgnfdvfdsdfojbwasv213443gr2t4sfth - /*LogView lw; - lw.setLogFont(QFont("dejavu sans mono", 9)); - lw.registerCategory("Warning", "Warning", QImage(":/icons/flame.png"), Qt::darkYellow); - lw.registerCategory("Error", "Error", QImage(":/icons/dialog-cancel.png"), Qt::darkRed, true); - //lw.setLinesLimit(12); - lw.show(); - piForTimes(100) - lw.addText(QString("row %1").arg(_i100)); - lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/scene_tree.h"); - lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/scene_tree.h"); - lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/view_editor.h"); - lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/material_map_editor.h\n" - "-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/materials_editor\n" - "-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/object_editor.h"); - lw.addText("[Warning] sdfkjhdfgj"); - lw.addText("[Error] gbflknwed"); - QLineEdit * le = new QLineEdit(); - QObject::connect(le, &QLineEdit::returnPressed, [&](){lw.addText(le->text());}); - le->show(); - return a.exec();*/ - - CDPultWindow w; - w.show(); - if (a.arguments().size() > 1) - w.loadFile(a.arguments()[1]); - return a.exec(); -} +#include +#include "cdpultwindow.h" + +template +class PIHash { + //template friend PIByteArray & operator >>(PIByteArray & s, PIHash & v); + //template friend PIByteArray & operator <<(PIByteArray & s, const PIHash & v); +public: + PIHash() {;} + PIHash(const PIHash & other) {*this = other;} + virtual ~PIHash() {;} + + PIHash & operator =(const PIHash & other) { + if (this == &other) return *this; + clear(); + pih_content = other.pih_content; + return *this; + } + + typedef T mapped_type; + typedef Key key_type; + typedef PIPair value_type; +/* + class iterator { + friend class PIHash; + private: + iterator(const PIHash * v, ssize_t p): parent(v), pos(p) {} + const PIHash * parent; + ssize_t pos; + public: + iterator(): parent(0), pos(0) {} + const Key & key() const {return const_cast * >(parent)->_key(pos);} + T & value() {return const_cast * >(parent)->_value(pos);} + void operator ++() {++pos;} + void operator ++(int) {++pos;} + void operator --() {--pos;} + void operator --(int) {--pos;} + bool operator ==(const iterator & it) const {return (pos == it.pos);} + bool operator !=(const iterator & it) const {return (pos != it.pos);} + }; + + class reverse_iterator { + friend class PIHash; + private: + reverse_iterator(const PIHash * v, ssize_t p): parent(v), pos(p) {} + const PIHash * parent; + ssize_t pos; + public: + reverse_iterator(): parent(0), pos(0) {} + const Key & key() const {return const_cast * >(parent)->_key(pos);} + T & value() const {return const_cast * >(parent)->_value(pos);} + void operator ++() {--pos;} + void operator ++(int) {--pos;} + void operator --() {++pos;} + void operator --(int) {++pos;} + bool operator ==(const reverse_iterator & it) const {return (pos == it.pos);} + bool operator !=(const reverse_iterator & it) const {return (pos != it.pos);} + }; +*/ + class const_iterator { + friend class PIHash; + private: + const_iterator(const PIHash * v, ssize_t p): parent(v), pos(p), bpos(0) { + if (pos == 0) { + pos = -1; + nextPos(); + } + } + void nextPos() { + while (++pos < parent->pih_content.size_s()) { + if (!parent->pih_content[pos].isEmpty()) + return; + } + } + const PIHash * parent; + ssize_t pos, bpos; + public: + const_iterator(): parent(0), pos(0) {} + //const value_type operator *() const {return parent->_pair(pos);} + //const value_type* operator ->() const {cval = parent->_pair(pos); return &cval;} + const Key & key() const {return const_cast * >(parent)->pih_content[pos][bpos].key;} + const T & value() const {return const_cast * >(parent)->pih_content[pos][bpos].value;} + void operator ++() { + if (pos < parent->pih_content.size_s()) { + if (bpos >= parent->pih_content[pos].size_s() - 1) { + bpos = 0; + nextPos(); + } else + ++bpos; + } else { + bpos = 0; + ++pos; + } + printf(" ++: %d %d\n", pos, bpos); + } + //void operator ++(int) {++pos;} + void operator --() { + --pos; + } + //void operator --(int) {--pos;} + bool operator ==(const const_iterator & it) const {return (pos == it.pos && bpos == it.bpos);} + bool operator !=(const const_iterator & it) const {return !(*this == it);} + mutable value_type cval; + }; +/* + class const_reverse_iterator { + friend class PIHash; + private: + const_reverse_iterator(const PIHash * v, ssize_t p): parent(v), pos(p) {} + const PIHash * parent; + ssize_t pos; + public: + const_reverse_iterator(): parent(0), pos(0) {} + const value_type operator *() const {return parent->_pair(pos);} + const value_type* operator ->() const {cval = parent->_pair(pos); return &cval;} + void operator ++() {--pos;} + void operator ++(int) {--pos;} + void operator --() {++pos;} + void operator --(int) {++pos;} + bool operator ==(const const_reverse_iterator & it) const {return (pos == it.pos);} + bool operator !=(const const_reverse_iterator & it) const {return (pos != it.pos);} + mutable value_type cval; + }; +*/ + //iterator begin() {return iterator(this, 0);} + //iterator end() {return iterator(this, size());} + const_iterator begin() const {return const_iterator(this, 0);} + const_iterator end() const {return const_iterator(this, size());} + const_iterator constBegin() const {return const_iterator(this, 0);} + const_iterator constEnd() const {return const_iterator(this, size());} + //reverse_iterator rbegin() {return reverse_iterator(this, size() - 1);} + //reverse_iterator rend() {return reverse_iterator(this, -1);} + //const_reverse_iterator rbegin() const {return const_reverse_iterator(this, size() - 1);} + //const_reverse_iterator rend() const {return const_reverse_iterator(this, -1);} + //const_reverse_iterator constRbegin() const {return const_reverse_iterator(this, size() - 1);} + //const_reverse_iterator constRend() const {return const_reverse_iterator(this, -1);} + + size_t size() const {return pih_content.size();} + int size_s() const {return pih_content.size_s();} + size_t length() const {return pih_content.size();} + size_t capacity() const {return pih_content.size();} + bool isEmpty() const {return (pih_content.size() == 0);} + + T & operator [](const Key & key) { + if (pih_content.isEmpty()) _rehash(1); + uint k = piHash(key); + int i = _index(k); + if (i < pih_content.size_s()) { + PIVector & hv(pih_content[i]); + if (hv.size_s() == 1) { + if (hv[0].key == k) + return hv[0].value; + } + for (int j = 0; j < hv.size_s(); ++j) + if (hv[j].key == k) + return hv[j].value; + } + if (pih_content[i].size_s() >= 4) + _rehash(pih_content.size_s() * 2); + i = _index(k); + pih_content[i] << HashEntry(k); + return pih_content[i].back().value; + } + const T operator [](const Key & key) const {return value(key);} + T & at(const Key & key) {return (*this)[key];} + const T at(const Key & key) const {return (*this)[key];} + + PIHash & operator <<(const PIHash & other) { + if (other.isEmpty()) return *this; + for (int i = 0; i < other.pih_content.size_s(); ++i) + for (int j = 0; j < other.pih_content[i].size_s(); ++j) + insert(other.pih_content[i][j].key, other.pih_content[i][j].value); + return *this; + } + + bool operator ==(const PIHash & t) const {return (pih_content == t.pih_content);} + bool operator !=(const PIHash & t) const {return (pih_content != t.pih_content);} + bool contains(const Key & key) const { + bool f(false); + _find(key, f); + return f; + } + + PIHash & reserve(size_t new_size) {_rehash(new_size); return *this;} + + PIHash & remove(const Key & key) { + uint k = piHash(key); + int i = _index(k); + if (i >= pih_content.size_s()) return *this; + PIVector & hv(pih_content[i]); + for (int j = 0; j < hv.size_s(); ++j) + if (hv[j].key == k) { + hv.remove(j); + --j; + } + return *this; + } + PIHash & erase(const Key & key) {return remove(key);} + PIHash & clear() {pih_content.clear(); return *this;} + + void swap(PIHash & other) { + pih_content.swap(other.pih_content); + } + + PIHash & insert(const Key & key, const T & value) { + (*this)[key] = value; + return *this; + } + const T value(const Key & key, const T & default_ = T()) const { + uint k = piHash(key); + int i = _index(k); + if (i >= pih_content.size_s()) return default_; + const PIVector & hv(pih_content[i]); + for (int j = 0; j < hv.size_s(); ++j) + if (hv[j].key == k) + return hv[j].value; + return default_; + } + PIVector values() const { + PIVector ret; + for (int i = 0; i < pih_content.size_s(); ++i) + for (int j = 0; j < pih_content[i].size_s(); ++j) + ret << pih_content[i][j].value; + return ret; + } + /*Key key(const T & value_, const Key & default_ = Key()) const { + for (int i = 0; i < pih_content.size_s(); ++i) + for (int j = 0; j < pih_content[i].size_s(); ++j) + if (pih_content[i][j].value == value_) + return pih_content[i][j].key; + return default_; + } + PIVector keys() const { + PIVector ret; + for (int i = 0; i < pih_content.size_s(); ++i) + for (int j = 0; j < pih_content[i].size_s(); ++j) + ret << pih_content[i][j].key; + return ret; + }*/ + + /*void dump() { + piCout << "PIHash" << size() << "entries" << PICoutManipulators::NewLine << "content:"; + for (size_t i = 0; i < pih_content.size(); ++i) + piCout << PICoutManipulators::Tab << i << ":" << pih_content[i]; + piCout << "index:"; + for (size_t i = 0; i < pim_index.size(); ++i) + piCout << PICoutManipulators::Tab << i << ":" << pim_index[i].key << "->" << pim_index[i].index; + }*/ + +protected: + struct HashEntry { + HashEntry(uint k = 0, const T & v = T()): key(k), value(v) {;} + uint key; + T value; + bool operator ==(const HashEntry & s) const {return key == s.key;} + bool operator !=(const HashEntry & s) const {return key != s.key;} + bool operator <(const HashEntry & s) const {return key < s.key;} + bool operator >(const HashEntry & s) const {return key > s.key;} + }; + /*template friend PIByteArray & operator >>(PIByteArray & s, PIDeque::HashEntry> & v); + template friend PIByteArray & operator <<(PIByteArray & s, const PIDeque::HashEntry> & v); + + const value_type _pair(ssize_t index) const { + if (index < 0 || index >= pim_index.size_s()) + return value_type(); + //piCout << "_pair" << index << pim_index[index].index; + return value_type(pim_index[index].key, pih_content[pim_index[index].index]); + } + Key & _key(ssize_t index) {return pim_index[index].key;} + T & _value(ssize_t index) {return pih_content[pim_index[index].index];}*/ + + inline size_t asize(size_t s) { + if (s == 0) return 0; + if (pih_content.size() + pih_content.size() >= s && pih_content.size() < s) + return pih_content.size() + pih_content.size(); + ssize_t t = 0, s_ = s - 1; + while (s_ >> t) ++t; + return (1 << t); + } + int _index(const uint & k) const { + return k % pih_content.size_s(); + } + void _rehash(int ns) { + ns = asize(ns); + if (pih_content.size_s() == ns) return; + PIVector > nhc; + nhc.resize(ns); + for (int i = 0; i < pih_content.size_s(); ++i) { + for (int j = 0; j < pih_content[i].size_s(); ++j) { + HashEntry & e(pih_content[i][j]); + int ni = e.key % ns; + nhc[ni] << e; + } + } + pih_content.swap(nhc); + } + + PIVector > pih_content; +}; + + +uint qHash(const PIString & v, uint seed = 0) {return piHash(v);} + + +#include "logview.h" +int main(int argc, char *argv[]) { + QApplication a(argc, argv); +#if QT_VERSION >= 0x050000 + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif + //################################ + /*QHash h2; + QMap m2; + PIString prefix = "1234567890"; + PITimeMeasurer tm; + double el = 0.; + + tm.reset(); + for (int i=0; i<10000; ++i) { + h2[prefix + PIString::fromNumber(i)+"1234567890"] = PIString::fromNumber(randomi()); + } + el = tm.elapsed_m(); piCout << el << h2.capacity(); + + tm.reset(); + for (int i=0; i<10000; ++i) { + m2[prefix + PIString::fromNumber(i)+"1234567890"] = PIString::fromNumber(randomi()); + } + el = tm.elapsed_m(); piCout << el; + piCout << "*********"; + + PIString _s; + tm.reset(); + for (int i=0; i<10000; ++i) { + _s = h2.value(prefix + PIString::fromNumber(i)+"1234567890"); + } + el = tm.elapsed_m(); piCout << el << h2.capacity(); + + tm.reset(); + for (int i=0; i<10000; ++i) { + _s = m2.value(prefix + PIString::fromNumber(i)+"1234567890"); + } + el = tm.elapsed_m(); piCout << el; + + return 0;*/ + //################################ +//1245hghgfhfdgshrgnhdsgfhjshdszdgsdgnjedghrbnlcvleabjmbassfdggfhbnsjkgnfdvfdsdfojbwasv213443gr2t4sfth + /*LogView lw; + lw.setLogFont(QFont("dejavu sans mono", 9)); + lw.registerCategory("Warning", "Warning", QImage(":/icons/flame.png"), Qt::darkYellow); + lw.registerCategory("Error", "Error", QImage(":/icons/dialog-cancel.png"), Qt::darkRed, true); + //lw.setLinesLimit(12); + lw.show(); + piForTimes(100) + lw.addText(QString("row %1").arg(_i100)); + lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/scene_tree.h"); + lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/scene_tree.h"); + lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/view_editor.h"); + lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/material_map_editor.h\n" + "-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/materials_editor\n" + "-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/object_editor.h"); + lw.addText("[Warning] sdfkjhdfgj"); + lw.addText("[Error] gbflknwed"); + QLineEdit * le = new QLineEdit(); + QObject::connect(le, &QLineEdit::returnPressed, [&](){lw.addText(le->text());}); + le->show(); + return a.exec();*/ + + CDPultWindow w; + w.show(); + if (a.arguments().size() > 1) + w.loadFile(a.arguments()[1]); + return a.exec(); +} diff --git a/piqt/utils/piconnedit/CMakeLists.txt b/piqt/utils/piconnedit/CMakeLists.txt new file mode 100644 index 0000000..7467cfa --- /dev/null +++ b/piqt/utils/piconnedit/CMakeLists.txt @@ -0,0 +1,10 @@ +project(piconnedit) +if(APPLE) + set(APP_ICON "") +elseif(WIN32) + set(APP_ICON "") +else() + set(APP_ICON "") +endif() +set(APP_INFO "PIConnection GUI editor") +piqt_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;qad_blockview;piqt_utils") diff --git a/piqt/utils/piconnedit/piconnedit.qrc b/piqt/utils/piconnedit/piconnedit.qrc new file mode 100644 index 0000000..d378e6b --- /dev/null +++ b/piqt/utils/piconnedit/piconnedit.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/piqt_utils/piconnedit/piconnedit_main.cpp b/piqt/utils/piconnedit/piconnedit_main.cpp similarity index 100% rename from piqt_utils/piconnedit/piconnedit_main.cpp rename to piqt/utils/piconnedit/piconnedit_main.cpp diff --git a/piqt/utils/pidumper/CMakeLists.txt b/piqt/utils/pidumper/CMakeLists.txt new file mode 100644 index 0000000..7383642 --- /dev/null +++ b/piqt/utils/pidumper/CMakeLists.txt @@ -0,0 +1,10 @@ +project(pidumper) +if(APPLE) + set(APP_ICON "") +elseif(WIN32) + set(APP_ICON "") +else() + set(APP_ICON "") +endif() +set(APP_INFO "PIConnection GUI editor") +piqt_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;piqt_utils") diff --git a/piqt_utils/pidumper/pidumper.cpp b/piqt/utils/pidumper/pidumper.cpp similarity index 100% rename from piqt_utils/pidumper/pidumper.cpp rename to piqt/utils/pidumper/pidumper.cpp diff --git a/piqt_utils/pidumper/pidumper.h b/piqt/utils/pidumper/pidumper.h similarity index 100% rename from piqt_utils/pidumper/pidumper.h rename to piqt/utils/pidumper/pidumper.h diff --git a/piqt_utils/pidumper/pidumper.ui b/piqt/utils/pidumper/pidumper.ui similarity index 100% rename from piqt_utils/pidumper/pidumper.ui rename to piqt/utils/pidumper/pidumper.ui diff --git a/piqt_utils/pidumper/pidumper_main.cpp b/piqt/utils/pidumper/pidumper_main.cpp similarity index 100% rename from piqt_utils/pidumper/pidumper_main.cpp rename to piqt/utils/pidumper/pidumper_main.cpp diff --git a/piqt/utils/piintrospector/CMakeLists.txt b/piqt/utils/piintrospector/CMakeLists.txt new file mode 100644 index 0000000..df74f4b --- /dev/null +++ b/piqt/utils/piintrospector/CMakeLists.txt @@ -0,0 +1,13 @@ +project(piintrospector) +if(APPLE) + set(APP_ICON "") +elseif(WIN32) + set(APP_ICON "") +else() + set(APP_ICON "") +endif() +set(APP_INFO "PIConnection GUI editor") +include(PIPMacros) +set(PII_ROOT "${ROOT_DIR}/pip/libs/main/introspection") +pip_code_model(CCM "${PII_ROOT}/piintrospection_server_p.h" "${PII_ROOT}/piintrospection_threads_p.h" OPTIONS "-DPIP_EXPORT" "-Es") +piqt_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;qad_application;piqt_utils" ${CCM}) diff --git a/piqt_utils/piintrospector/containers_view.cpp b/piqt/utils/piintrospector/containers_view.cpp similarity index 100% rename from piqt_utils/piintrospector/containers_view.cpp rename to piqt/utils/piintrospector/containers_view.cpp diff --git a/piqt_utils/piintrospector/containers_view.h b/piqt/utils/piintrospector/containers_view.h similarity index 100% rename from piqt_utils/piintrospector/containers_view.h rename to piqt/utils/piintrospector/containers_view.h diff --git a/piqt_utils/piintrospector/containers_view.ui b/piqt/utils/piintrospector/containers_view.ui similarity index 100% rename from piqt_utils/piintrospector/containers_view.ui rename to piqt/utils/piintrospector/containers_view.ui diff --git a/piqt_utils/piintrospector/objects_view.cpp b/piqt/utils/piintrospector/objects_view.cpp similarity index 100% rename from piqt_utils/piintrospector/objects_view.cpp rename to piqt/utils/piintrospector/objects_view.cpp diff --git a/piqt_utils/piintrospector/objects_view.h b/piqt/utils/piintrospector/objects_view.h similarity index 100% rename from piqt_utils/piintrospector/objects_view.h rename to piqt/utils/piintrospector/objects_view.h diff --git a/piqt_utils/piintrospector/objects_view.ui b/piqt/utils/piintrospector/objects_view.ui similarity index 100% rename from piqt_utils/piintrospector/objects_view.ui rename to piqt/utils/piintrospector/objects_view.ui diff --git a/piqt_utils/piintrospector/piintrospector.cpp b/piqt/utils/piintrospector/piintrospector.cpp similarity index 100% rename from piqt_utils/piintrospector/piintrospector.cpp rename to piqt/utils/piintrospector/piintrospector.cpp diff --git a/piqt_utils/piintrospector/piintrospector.h b/piqt/utils/piintrospector/piintrospector.h similarity index 100% rename from piqt_utils/piintrospector/piintrospector.h rename to piqt/utils/piintrospector/piintrospector.h diff --git a/piqt_utils/piintrospector/piintrospector.ui b/piqt/utils/piintrospector/piintrospector.ui similarity index 100% rename from piqt_utils/piintrospector/piintrospector.ui rename to piqt/utils/piintrospector/piintrospector.ui diff --git a/piqt_utils/piintrospector/piintrospector_main.cpp b/piqt/utils/piintrospector/piintrospector_main.cpp similarity index 100% rename from piqt_utils/piintrospector/piintrospector_main.cpp rename to piqt/utils/piintrospector/piintrospector_main.cpp diff --git a/piqt_utils/piintrospector/threads_view.cpp b/piqt/utils/piintrospector/threads_view.cpp similarity index 100% rename from piqt_utils/piintrospector/threads_view.cpp rename to piqt/utils/piintrospector/threads_view.cpp diff --git a/piqt_utils/piintrospector/threads_view.h b/piqt/utils/piintrospector/threads_view.h similarity index 100% rename from piqt_utils/piintrospector/threads_view.h rename to piqt/utils/piintrospector/threads_view.h diff --git a/piqt_utils/piintrospector/threads_view.ui b/piqt/utils/piintrospector/threads_view.ui similarity index 100% rename from piqt_utils/piintrospector/threads_view.ui rename to piqt/utils/piintrospector/threads_view.ui diff --git a/piqt_utils/CMakeLists.txt b/piqt_utils/CMakeLists.txt deleted file mode 100644 index 666672b..0000000 --- a/piqt_utils/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(piqt_utils) -set(PIQT_UTILS_UTILS 1) -if(LIBPROJECT) - include(PIPMacros) - include(SDKMacros) - set(PIQT_UTILS_UTILS ${UTILS}) -else() - find_package(PIP REQUIRED) - option(LIB "System install" 0) - option(DEBUG "Build with -g3" 0) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall") - if(DEBUG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") - endif() -endif() -set(LIBTYPE SHARED) -if(DEFINED ENV{QNX_HOST}) - set(LIBTYPE STATIC) -endif() -find_package(QAD REQUIRED) -list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME}) -set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) -include_directories(${PIP_INCLUDES} ${QAD_INCLUDES}) -file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") -pip_code_model(CCM "../pip/libs/main/io_devices/piiodevice.h" "../pip/libs/main/io_utils/pipacketextractor.h" OPTIONS "-DPIP_EXPORT" "-Es") -find_qt(${QtVersions} Core Gui) -qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) -qt_add_library(${PROJECT_NAME} ${LIBTYPE} out_CPP CCM) -qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets qad_blockview piqt) -message(STATUS "Building ${PROJECT_NAME}") - -if (LIBPROJECT) - foreach(_v ${_QT_VERSIONS_}) - if (LOCAL_FOUND${_v}) - add_dependencies(piqt_utils${_v} pip_cmg) - endif() - endforeach() -endif() - -if (NOT DEFINED ENV{QNX_HOST}) - if (PIQT_UTILS_UTILS) - add_subdirectory(piconnedit) - add_subdirectory(pidumper) - add_subdirectory(piintrospector) - endif() -endif() - -if(LIBPROJECT) - sdk_install("pip" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}") -else() - if(LIB) - if(WIN32) - install(FILES ${out_HDR} DESTINATION ${MINGW_INCLUDE}/pip) - qt_install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${MINGW_LIB}) - qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${MINGW_BIN}) - qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtBin) - else() - install(FILES ${out_HDR} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/pip) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) - endif() - message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") - else() - if(WIN32) - qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) - qt_install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib) - else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION lib) - endif() - install(FILES ${out_HDR} DESTINATION include/pip) - message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"") - endif() -endif() diff --git a/piqt_utils/LICENSE.txt b/piqt_utils/LICENSE.txt deleted file mode 100644 index 0a04128..0000000 --- a/piqt_utils/LICENSE.txt +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/piqt_utils/piconnedit/CMakeLists.txt b/piqt_utils/piconnedit/CMakeLists.txt deleted file mode 100644 index fd96b3d..0000000 --- a/piqt_utils/piconnedit/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -project(piconnedit) -file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") -find_qt(${QtVersions} Core Gui) -qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) -qt_add_executable(${PROJECT_NAME} WIN32 out_CPP) -qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets piqt_utils) -qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../") -message(STATUS "Building ${PROJECT_NAME}") -if(LIB) - if(WIN32) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN}) - else() - if (DEFINED ANDROID_PLATFORM) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${ANDROID_SYSTEM_LIBRARY_PATH}/usr/bin) - else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin) - endif() - endif() - #message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") -else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin) - #message(STATUS "Install ${PROJECT_NAME} to local \"bin\"") -endif() diff --git a/piqt_utils/piconnedit/icons/DALI-designer.png b/piqt_utils/piconnedit/icons/DALI-designer.png deleted file mode 100644 index 23b1946..0000000 Binary files a/piqt_utils/piconnedit/icons/DALI-designer.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/alpha.png b/piqt_utils/piconnedit/icons/alpha.png deleted file mode 100644 index 5435669..0000000 Binary files a/piqt_utils/piconnedit/icons/alpha.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/application-exit.png b/piqt_utils/piconnedit/icons/application-exit.png deleted file mode 100644 index ed5f8b2..0000000 Binary files a/piqt_utils/piconnedit/icons/application-exit.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/applications-engineering.png b/piqt_utils/piconnedit/icons/applications-engineering.png deleted file mode 100644 index 4721d8d..0000000 Binary files a/piqt_utils/piconnedit/icons/applications-engineering.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/archive-extract.png b/piqt_utils/piconnedit/icons/archive-extract.png deleted file mode 100644 index aa7b1fa..0000000 Binary files a/piqt_utils/piconnedit/icons/archive-extract.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/archive-insert-directory.png b/piqt_utils/piconnedit/icons/archive-insert-directory.png deleted file mode 100644 index 0672205..0000000 Binary files a/piqt_utils/piconnedit/icons/archive-insert-directory.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/archive-insert.png b/piqt_utils/piconnedit/icons/archive-insert.png deleted file mode 100644 index 193c25c..0000000 Binary files a/piqt_utils/piconnedit/icons/archive-insert.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/arrow-down.png b/piqt_utils/piconnedit/icons/arrow-down.png deleted file mode 100644 index 03f2014..0000000 Binary files a/piqt_utils/piconnedit/icons/arrow-down.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/arrow-up.png b/piqt_utils/piconnedit/icons/arrow-up.png deleted file mode 100644 index 5e42321..0000000 Binary files a/piqt_utils/piconnedit/icons/arrow-up.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/axis_x.png b/piqt_utils/piconnedit/icons/axis_x.png deleted file mode 100644 index 321899c..0000000 Binary files a/piqt_utils/piconnedit/icons/axis_x.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/axis_y.png b/piqt_utils/piconnedit/icons/axis_y.png deleted file mode 100644 index 7d4d9ec..0000000 Binary files a/piqt_utils/piconnedit/icons/axis_y.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/case-sensitive.png b/piqt_utils/piconnedit/icons/case-sensitive.png deleted file mode 100644 index 39c5c5a..0000000 Binary files a/piqt_utils/piconnedit/icons/case-sensitive.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/checkbox-unchecked.png b/piqt_utils/piconnedit/icons/checkbox-unchecked.png deleted file mode 100644 index 01a7307..0000000 Binary files a/piqt_utils/piconnedit/icons/checkbox-unchecked.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/checkbox.png b/piqt_utils/piconnedit/icons/checkbox.png deleted file mode 100644 index 1c311e2..0000000 Binary files a/piqt_utils/piconnedit/icons/checkbox.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/clients.png b/piqt_utils/piconnedit/icons/clients.png deleted file mode 100644 index 0ae949a..0000000 Binary files a/piqt_utils/piconnedit/icons/clients.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/close.png b/piqt_utils/piconnedit/icons/close.png deleted file mode 100644 index 5492295..0000000 Binary files a/piqt_utils/piconnedit/icons/close.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-error.png b/piqt_utils/piconnedit/icons/code-error.png deleted file mode 100644 index 5b4c488..0000000 Binary files a/piqt_utils/piconnedit/icons/code-error.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-function.png b/piqt_utils/piconnedit/icons/code-function.png deleted file mode 100644 index e5cea37..0000000 Binary files a/piqt_utils/piconnedit/icons/code-function.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-keyword.png b/piqt_utils/piconnedit/icons/code-keyword.png deleted file mode 100644 index 70dc5ef..0000000 Binary files a/piqt_utils/piconnedit/icons/code-keyword.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-parents.png b/piqt_utils/piconnedit/icons/code-parents.png deleted file mode 100644 index 7c14d40..0000000 Binary files a/piqt_utils/piconnedit/icons/code-parents.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-property.png b/piqt_utils/piconnedit/icons/code-property.png deleted file mode 100644 index d2af8a6..0000000 Binary files a/piqt_utils/piconnedit/icons/code-property.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-signal.png b/piqt_utils/piconnedit/icons/code-signal.png deleted file mode 100644 index 3415e62..0000000 Binary files a/piqt_utils/piconnedit/icons/code-signal.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-struct.png b/piqt_utils/piconnedit/icons/code-struct.png deleted file mode 100644 index 61544a8..0000000 Binary files a/piqt_utils/piconnedit/icons/code-struct.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-union.png b/piqt_utils/piconnedit/icons/code-union.png deleted file mode 100644 index 2f4567a..0000000 Binary files a/piqt_utils/piconnedit/icons/code-union.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-variable.png b/piqt_utils/piconnedit/icons/code-variable.png deleted file mode 100644 index d0ec29e..0000000 Binary files a/piqt_utils/piconnedit/icons/code-variable.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/code-word.png b/piqt_utils/piconnedit/icons/code-word.png deleted file mode 100644 index e61f08f..0000000 Binary files a/piqt_utils/piconnedit/icons/code-word.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/configure-.png b/piqt_utils/piconnedit/icons/configure-.png deleted file mode 100644 index 541c14e..0000000 Binary files a/piqt_utils/piconnedit/icons/configure-.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/configure.png b/piqt_utils/piconnedit/icons/configure.png deleted file mode 100644 index 5ce478b..0000000 Binary files a/piqt_utils/piconnedit/icons/configure.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/database.png b/piqt_utils/piconnedit/icons/database.png deleted file mode 100644 index 3041814..0000000 Binary files a/piqt_utils/piconnedit/icons/database.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/debug-run.png b/piqt_utils/piconnedit/icons/debug-run.png deleted file mode 100644 index 9bebb44..0000000 Binary files a/piqt_utils/piconnedit/icons/debug-run.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/designer-qt4.png b/piqt_utils/piconnedit/icons/designer-qt4.png deleted file mode 100644 index 8f699be..0000000 Binary files a/piqt_utils/piconnedit/icons/designer-qt4.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/dialog-close.png b/piqt_utils/piconnedit/icons/dialog-close.png deleted file mode 100644 index 2c2f99e..0000000 Binary files a/piqt_utils/piconnedit/icons/dialog-close.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/dialog-ok-apply.png b/piqt_utils/piconnedit/icons/dialog-ok-apply.png deleted file mode 100644 index f5feac0..0000000 Binary files a/piqt_utils/piconnedit/icons/dialog-ok-apply.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/dialog-warning.png b/piqt_utils/piconnedit/icons/dialog-warning.png deleted file mode 100644 index 80bd694..0000000 Binary files a/piqt_utils/piconnedit/icons/dialog-warning.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/disabled.png b/piqt_utils/piconnedit/icons/disabled.png deleted file mode 100644 index f20b8e0..0000000 Binary files a/piqt_utils/piconnedit/icons/disabled.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/distribute-horizontal-margin.png b/piqt_utils/piconnedit/icons/distribute-horizontal-margin.png deleted file mode 100644 index 3289190..0000000 Binary files a/piqt_utils/piconnedit/icons/distribute-horizontal-margin.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/document-edit.png b/piqt_utils/piconnedit/icons/document-edit.png deleted file mode 100644 index 84e345d..0000000 Binary files a/piqt_utils/piconnedit/icons/document-edit.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/document-new.png b/piqt_utils/piconnedit/icons/document-new.png deleted file mode 100644 index 3092571..0000000 Binary files a/piqt_utils/piconnedit/icons/document-new.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/document-open.png b/piqt_utils/piconnedit/icons/document-open.png deleted file mode 100644 index 8ba5441..0000000 Binary files a/piqt_utils/piconnedit/icons/document-open.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/document-print.png b/piqt_utils/piconnedit/icons/document-print.png deleted file mode 100644 index 8eb1c67..0000000 Binary files a/piqt_utils/piconnedit/icons/document-print.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/document-save-.png b/piqt_utils/piconnedit/icons/document-save-.png deleted file mode 100644 index 7fa489c..0000000 Binary files a/piqt_utils/piconnedit/icons/document-save-.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/document-save-all.png b/piqt_utils/piconnedit/icons/document-save-all.png deleted file mode 100644 index 159857f..0000000 Binary files a/piqt_utils/piconnedit/icons/document-save-all.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/document-save-as.png b/piqt_utils/piconnedit/icons/document-save-as.png deleted file mode 100644 index 9695a56..0000000 Binary files a/piqt_utils/piconnedit/icons/document-save-as.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/document-save.png b/piqt_utils/piconnedit/icons/document-save.png deleted file mode 100644 index 8072aea..0000000 Binary files a/piqt_utils/piconnedit/icons/document-save.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-clear-.png b/piqt_utils/piconnedit/icons/edit-clear-.png deleted file mode 100644 index cee7af6..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-clear-.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-clear-locationbar-rtl.png b/piqt_utils/piconnedit/icons/edit-clear-locationbar-rtl.png deleted file mode 100644 index 6c4b83b..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-clear-locationbar-rtl.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-clear.png b/piqt_utils/piconnedit/icons/edit-clear.png deleted file mode 100644 index 631ed44..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-clear.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-copy.png b/piqt_utils/piconnedit/icons/edit-copy.png deleted file mode 100644 index 477e83a..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-copy.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-cut.png b/piqt_utils/piconnedit/icons/edit-cut.png deleted file mode 100644 index 0732328..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-cut.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-delete.png b/piqt_utils/piconnedit/icons/edit-delete.png deleted file mode 100644 index cc6d2af..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-delete.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-find-.png b/piqt_utils/piconnedit/icons/edit-find-.png deleted file mode 100644 index 64a1e28..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-find-.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-find.png b/piqt_utils/piconnedit/icons/edit-find.png deleted file mode 100644 index 9a462c0..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-find.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-guides.png b/piqt_utils/piconnedit/icons/edit-guides.png deleted file mode 100644 index d264839..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-guides.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-paste.png b/piqt_utils/piconnedit/icons/edit-paste.png deleted file mode 100644 index 6788b02..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-paste.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-redo.png b/piqt_utils/piconnedit/icons/edit-redo.png deleted file mode 100644 index 8de333f..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-redo.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-table-insert-row-below.png b/piqt_utils/piconnedit/icons/edit-table-insert-row-below.png deleted file mode 100644 index a194a68..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-table-insert-row-below.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/edit-undo.png b/piqt_utils/piconnedit/icons/edit-undo.png deleted file mode 100644 index 5071aa1..0000000 Binary files a/piqt_utils/piconnedit/icons/edit-undo.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/employees.png b/piqt_utils/piconnedit/icons/employees.png deleted file mode 100644 index 7ae7383..0000000 Binary files a/piqt_utils/piconnedit/icons/employees.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/expand_s_x.png b/piqt_utils/piconnedit/icons/expand_s_x.png deleted file mode 100644 index b66cb40..0000000 Binary files a/piqt_utils/piconnedit/icons/expand_s_x.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/expand_s_y.png b/piqt_utils/piconnedit/icons/expand_s_y.png deleted file mode 100644 index c2e8f78..0000000 Binary files a/piqt_utils/piconnedit/icons/expand_s_y.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/expand_x.png b/piqt_utils/piconnedit/icons/expand_x.png deleted file mode 100644 index 217e3ea..0000000 Binary files a/piqt_utils/piconnedit/icons/expand_x.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/expand_y.png b/piqt_utils/piconnedit/icons/expand_y.png deleted file mode 100644 index fedf936..0000000 Binary files a/piqt_utils/piconnedit/icons/expand_y.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/format-text-subscript.png b/piqt_utils/piconnedit/icons/format-text-subscript.png deleted file mode 100644 index 206b147..0000000 Binary files a/piqt_utils/piconnedit/icons/format-text-subscript.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/games-solve.png b/piqt_utils/piconnedit/icons/games-solve.png deleted file mode 100644 index 47f11f7..0000000 Binary files a/piqt_utils/piconnedit/icons/games-solve.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/go-jump.png b/piqt_utils/piconnedit/icons/go-jump.png deleted file mode 100644 index 2cd4627..0000000 Binary files a/piqt_utils/piconnedit/icons/go-jump.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/go-next.png b/piqt_utils/piconnedit/icons/go-next.png deleted file mode 100644 index aa7cbb9..0000000 Binary files a/piqt_utils/piconnedit/icons/go-next.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/go-previous.png b/piqt_utils/piconnedit/icons/go-previous.png deleted file mode 100644 index 8230340..0000000 Binary files a/piqt_utils/piconnedit/icons/go-previous.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/graphics.png b/piqt_utils/piconnedit/icons/graphics.png deleted file mode 100644 index 64abcb5..0000000 Binary files a/piqt_utils/piconnedit/icons/graphics.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/groups-edit.png b/piqt_utils/piconnedit/icons/groups-edit.png deleted file mode 100644 index 278c4d6..0000000 Binary files a/piqt_utils/piconnedit/icons/groups-edit.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/item-add.png b/piqt_utils/piconnedit/icons/item-add.png deleted file mode 100644 index 8a422c7..0000000 Binary files a/piqt_utils/piconnedit/icons/item-add.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/item.png b/piqt_utils/piconnedit/icons/item.png deleted file mode 100644 index 50bfddb..0000000 Binary files a/piqt_utils/piconnedit/icons/item.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/lastmoves.png b/piqt_utils/piconnedit/icons/lastmoves.png deleted file mode 100644 index 4454bca..0000000 Binary files a/piqt_utils/piconnedit/icons/lastmoves.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/led_3.png b/piqt_utils/piconnedit/icons/led_3.png deleted file mode 100644 index 604c241..0000000 Binary files a/piqt_utils/piconnedit/icons/led_3.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/led_off.png b/piqt_utils/piconnedit/icons/led_off.png deleted file mode 100644 index fe60f36..0000000 Binary files a/piqt_utils/piconnedit/icons/led_off.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/led_on.png b/piqt_utils/piconnedit/icons/led_on.png deleted file mode 100644 index 946ba73..0000000 Binary files a/piqt_utils/piconnedit/icons/led_on.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-+.png b/piqt_utils/piconnedit/icons/light-+.png deleted file mode 100644 index e7d8d80..0000000 Binary files a/piqt_utils/piconnedit/icons/light-+.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light--.png b/piqt_utils/piconnedit/icons/light--.png deleted file mode 100644 index 9a4942b..0000000 Binary files a/piqt_utils/piconnedit/icons/light--.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-254.png b/piqt_utils/piconnedit/icons/light-254.png deleted file mode 100644 index ff6a171..0000000 Binary files a/piqt_utils/piconnedit/icons/light-254.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-disable-all.png b/piqt_utils/piconnedit/icons/light-disable-all.png deleted file mode 100644 index 68ee45c..0000000 Binary files a/piqt_utils/piconnedit/icons/light-disable-all.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-disable.png b/piqt_utils/piconnedit/icons/light-disable.png deleted file mode 100644 index 4755fd8..0000000 Binary files a/piqt_utils/piconnedit/icons/light-disable.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-down.png b/piqt_utils/piconnedit/icons/light-down.png deleted file mode 100644 index 52a577a..0000000 Binary files a/piqt_utils/piconnedit/icons/light-down.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-edit.png b/piqt_utils/piconnedit/icons/light-edit.png deleted file mode 100644 index 581a696..0000000 Binary files a/piqt_utils/piconnedit/icons/light-edit.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-max.png b/piqt_utils/piconnedit/icons/light-max.png deleted file mode 100644 index 692ce16..0000000 Binary files a/piqt_utils/piconnedit/icons/light-max.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-min.png b/piqt_utils/piconnedit/icons/light-min.png deleted file mode 100644 index 42e76b6..0000000 Binary files a/piqt_utils/piconnedit/icons/light-min.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-off.png b/piqt_utils/piconnedit/icons/light-off.png deleted file mode 100644 index 3763a5d..0000000 Binary files a/piqt_utils/piconnedit/icons/light-off.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-on.png b/piqt_utils/piconnedit/icons/light-on.png deleted file mode 100644 index 8db6a2d..0000000 Binary files a/piqt_utils/piconnedit/icons/light-on.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-step-down.png b/piqt_utils/piconnedit/icons/light-step-down.png deleted file mode 100644 index 64b405d..0000000 Binary files a/piqt_utils/piconnedit/icons/light-step-down.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-step-up.png b/piqt_utils/piconnedit/icons/light-step-up.png deleted file mode 100644 index 4aaf795..0000000 Binary files a/piqt_utils/piconnedit/icons/light-step-up.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/light-up.png b/piqt_utils/piconnedit/icons/light-up.png deleted file mode 100644 index ddc5eec..0000000 Binary files a/piqt_utils/piconnedit/icons/light-up.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/lights.png b/piqt_utils/piconnedit/icons/lights.png deleted file mode 100644 index 34d2541..0000000 Binary files a/piqt_utils/piconnedit/icons/lights.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/list-add.png b/piqt_utils/piconnedit/icons/list-add.png deleted file mode 100644 index 5724694..0000000 Binary files a/piqt_utils/piconnedit/icons/list-add.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/list-remove.png b/piqt_utils/piconnedit/icons/list-remove.png deleted file mode 100644 index 53506b0..0000000 Binary files a/piqt_utils/piconnedit/icons/list-remove.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/log_parser.png b/piqt_utils/piconnedit/icons/log_parser.png deleted file mode 100644 index cf0ca98..0000000 Binary files a/piqt_utils/piconnedit/icons/log_parser.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/mail.png b/piqt_utils/piconnedit/icons/mail.png deleted file mode 100644 index 81adbf9..0000000 Binary files a/piqt_utils/piconnedit/icons/mail.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/media-flash.png b/piqt_utils/piconnedit/icons/media-flash.png deleted file mode 100644 index d91845b..0000000 Binary files a/piqt_utils/piconnedit/icons/media-flash.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/media-playback-pause.png b/piqt_utils/piconnedit/icons/media-playback-pause.png deleted file mode 100644 index d133bdc..0000000 Binary files a/piqt_utils/piconnedit/icons/media-playback-pause.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/media-playback-stop.png b/piqt_utils/piconnedit/icons/media-playback-stop.png deleted file mode 100644 index 4ecbdf6..0000000 Binary files a/piqt_utils/piconnedit/icons/media-playback-stop.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/media-record.png b/piqt_utils/piconnedit/icons/media-record.png deleted file mode 100644 index 73688e8..0000000 Binary files a/piqt_utils/piconnedit/icons/media-record.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/node-add.png b/piqt_utils/piconnedit/icons/node-add.png deleted file mode 100644 index 80b5c61..0000000 Binary files a/piqt_utils/piconnedit/icons/node-add.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/node.png b/piqt_utils/piconnedit/icons/node.png deleted file mode 100644 index fc8194e..0000000 Binary files a/piqt_utils/piconnedit/icons/node.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/object-locked.png b/piqt_utils/piconnedit/icons/object-locked.png deleted file mode 100644 index 38dff01..0000000 Binary files a/piqt_utils/piconnedit/icons/object-locked.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/piconnection.png b/piqt_utils/piconnedit/icons/piconnection.png deleted file mode 100644 index 47d41d7..0000000 Binary files a/piqt_utils/piconnedit/icons/piconnection.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/piconnection.xcf b/piqt_utils/piconnedit/icons/piconnection.xcf deleted file mode 100644 index a5fdbee..0000000 Binary files a/piqt_utils/piconnedit/icons/piconnection.xcf and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/quickopen.png b/piqt_utils/piconnedit/icons/quickopen.png deleted file mode 100644 index 60cb838..0000000 Binary files a/piqt_utils/piconnedit/icons/quickopen.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/run-build-install-root.png b/piqt_utils/piconnedit/icons/run-build-install-root.png deleted file mode 100644 index 6c7a236..0000000 Binary files a/piqt_utils/piconnedit/icons/run-build-install-root.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/run-build.png b/piqt_utils/piconnedit/icons/run-build.png deleted file mode 100644 index 85a12e8..0000000 Binary files a/piqt_utils/piconnedit/icons/run-build.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/scenes-edit.png b/piqt_utils/piconnedit/icons/scenes-edit.png deleted file mode 100644 index d60c0f6..0000000 Binary files a/piqt_utils/piconnedit/icons/scenes-edit.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/select-add.png b/piqt_utils/piconnedit/icons/select-add.png deleted file mode 100644 index 084ab28..0000000 Binary files a/piqt_utils/piconnedit/icons/select-add.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/select-intersect.png b/piqt_utils/piconnedit/icons/select-intersect.png deleted file mode 100644 index e1b22cc..0000000 Binary files a/piqt_utils/piconnedit/icons/select-intersect.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/select-invert.png b/piqt_utils/piconnedit/icons/select-invert.png deleted file mode 100644 index 1c82ab4..0000000 Binary files a/piqt_utils/piconnedit/icons/select-invert.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/select-none.png b/piqt_utils/piconnedit/icons/select-none.png deleted file mode 100644 index 4f9bb5a..0000000 Binary files a/piqt_utils/piconnedit/icons/select-none.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/select-replace.png b/piqt_utils/piconnedit/icons/select-replace.png deleted file mode 100644 index 80ccde4..0000000 Binary files a/piqt_utils/piconnedit/icons/select-replace.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/select-subtract.png b/piqt_utils/piconnedit/icons/select-subtract.png deleted file mode 100644 index 26eccee..0000000 Binary files a/piqt_utils/piconnedit/icons/select-subtract.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/splash.png b/piqt_utils/piconnedit/icons/splash.png deleted file mode 100644 index 38921fc..0000000 Binary files a/piqt_utils/piconnedit/icons/splash.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/status-off.png b/piqt_utils/piconnedit/icons/status-off.png deleted file mode 100644 index b89267f..0000000 Binary files a/piqt_utils/piconnedit/icons/status-off.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/status-on.png b/piqt_utils/piconnedit/icons/status-on.png deleted file mode 100644 index bb62ff6..0000000 Binary files a/piqt_utils/piconnedit/icons/status-on.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/status-warn.png b/piqt_utils/piconnedit/icons/status-warn.png deleted file mode 100644 index 2afcc5e..0000000 Binary files a/piqt_utils/piconnedit/icons/status-warn.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/system-help.png b/piqt_utils/piconnedit/icons/system-help.png deleted file mode 100644 index 86b6407..0000000 Binary files a/piqt_utils/piconnedit/icons/system-help.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/tool-light-add.png b/piqt_utils/piconnedit/icons/tool-light-add.png deleted file mode 100644 index a16d5fa..0000000 Binary files a/piqt_utils/piconnedit/icons/tool-light-add.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/tool-selection.png b/piqt_utils/piconnedit/icons/tool-selection.png deleted file mode 100644 index 8ca8dbd..0000000 Binary files a/piqt_utils/piconnedit/icons/tool-selection.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/tools-wizard.png b/piqt_utils/piconnedit/icons/tools-wizard.png deleted file mode 100644 index f67fb4c..0000000 Binary files a/piqt_utils/piconnedit/icons/tools-wizard.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/transform-move.png b/piqt_utils/piconnedit/icons/transform-move.png deleted file mode 100644 index 0bd8d04..0000000 Binary files a/piqt_utils/piconnedit/icons/transform-move.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/variable-add.png b/piqt_utils/piconnedit/icons/variable-add.png deleted file mode 100644 index 0a551b1..0000000 Binary files a/piqt_utils/piconnedit/icons/variable-add.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/variable-copy.png b/piqt_utils/piconnedit/icons/variable-copy.png deleted file mode 100644 index 42d91c3..0000000 Binary files a/piqt_utils/piconnedit/icons/variable-copy.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/variable-edit.png b/piqt_utils/piconnedit/icons/variable-edit.png deleted file mode 100644 index 420ace3..0000000 Binary files a/piqt_utils/piconnedit/icons/variable-edit.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/variable-remove.png b/piqt_utils/piconnedit/icons/variable-remove.png deleted file mode 100644 index 0686e7c..0000000 Binary files a/piqt_utils/piconnedit/icons/variable-remove.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/view-grid.png b/piqt_utils/piconnedit/icons/view-grid.png deleted file mode 100644 index 0f1d70c..0000000 Binary files a/piqt_utils/piconnedit/icons/view-grid.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/view-refresh.png b/piqt_utils/piconnedit/icons/view-refresh.png deleted file mode 100644 index afa2a9d..0000000 Binary files a/piqt_utils/piconnedit/icons/view-refresh.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/warning-a.png b/piqt_utils/piconnedit/icons/warning-a.png deleted file mode 100644 index 95cb849..0000000 Binary files a/piqt_utils/piconnedit/icons/warning-a.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/warning-id.png b/piqt_utils/piconnedit/icons/warning-id.png deleted file mode 100644 index a8bc774..0000000 Binary files a/piqt_utils/piconnedit/icons/warning-id.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/window-close.png b/piqt_utils/piconnedit/icons/window-close.png deleted file mode 100644 index ea6b607..0000000 Binary files a/piqt_utils/piconnedit/icons/window-close.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/zoom-fit-best.png b/piqt_utils/piconnedit/icons/zoom-fit-best.png deleted file mode 100644 index 07cfc98..0000000 Binary files a/piqt_utils/piconnedit/icons/zoom-fit-best.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/zoom-in.png b/piqt_utils/piconnedit/icons/zoom-in.png deleted file mode 100644 index 8393e28..0000000 Binary files a/piqt_utils/piconnedit/icons/zoom-in.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/zoom-out.png b/piqt_utils/piconnedit/icons/zoom-out.png deleted file mode 100644 index f66575e..0000000 Binary files a/piqt_utils/piconnedit/icons/zoom-out.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/zoom-range.png b/piqt_utils/piconnedit/icons/zoom-range.png deleted file mode 100644 index c052512..0000000 Binary files a/piqt_utils/piconnedit/icons/zoom-range.png and /dev/null differ diff --git a/piqt_utils/piconnedit/icons/zoom-rect.png b/piqt_utils/piconnedit/icons/zoom-rect.png deleted file mode 100644 index da44fd5..0000000 Binary files a/piqt_utils/piconnedit/icons/zoom-rect.png and /dev/null differ diff --git a/piqt_utils/piconnedit/piconnedit.qrc b/piqt_utils/piconnedit/piconnedit.qrc deleted file mode 100644 index 6ea99d5..0000000 --- a/piqt_utils/piconnedit/piconnedit.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - icons/edit-clear-.png - icons/document-save-.png - - diff --git a/piqt_utils/pidumper/CMakeLists.txt b/piqt_utils/pidumper/CMakeLists.txt deleted file mode 100644 index 464d84d..0000000 --- a/piqt_utils/pidumper/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -project(pidumper) -file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") -find_qt(${QtVersions} Core Gui) -qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) -qt_add_executable(${PROJECT_NAME} WIN32 out_CPP) -qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets piqt_utils) -qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../") -message(STATUS "Building ${PROJECT_NAME}") -if(LIB) - if(WIN32) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN}) - else() - if (DEFINED ANDROID_PLATFORM) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${ANDROID_SYSTEM_LIBRARY_PATH}/usr/bin) - else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin) - endif() - endif() - #message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") -else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin) - #message(STATUS "Install ${PROJECT_NAME} to local \"bin\"") -endif() diff --git a/piqt_utils/piintrospector/CMakeLists.txt b/piqt_utils/piintrospector/CMakeLists.txt deleted file mode 100644 index 315beff..0000000 --- a/piqt_utils/piintrospector/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -project(piintrospector) -file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") -set(PII_ROOT "../../pip/libs/main/introspection") -pip_code_model(PII_CCM "${PII_ROOT}/piintrospection_server_p.h" "${PII_ROOT}/piintrospection_threads_p.h" OPTIONS "-DPIP_EXPORT" "-Es") -find_qt(${QtVersions} Core Gui) -qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) -qt_add_executable(${PROJECT_NAME} WIN32 out_CPP PII_CCM) -qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets qad_application piqt_utils) -qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../") -message(STATUS "Building ${PROJECT_NAME}") -if(LIB) - if(WIN32) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN}) - else() - if (DEFINED ANDROID_PLATFORM) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${ANDROID_SYSTEM_LIBRARY_PATH}/usr/bin) - else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin) - endif() - endif() - #message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") -else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin) - #message(STATUS "Install ${PROJECT_NAME} to local \"bin\"") -endif() diff --git a/qad/CMakeLists.txt b/qad/CMakeLists.txt index d73518c..adb5be9 100644 --- a/qad/CMakeLists.txt +++ b/qad/CMakeLists.txt @@ -26,6 +26,7 @@ if (NOT LIBPROJECT) endif () endif() +include(QADMacros) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) set(EXPORT_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/qad_export.h") @@ -59,6 +60,9 @@ set_version(QAD BUILD "${BUILD_NUMBER}" SUFFIX "${_QAD_SUFFIX}" OUTPUT "${QAD_VERSION_FILE}") +set_deploy_property(QAD ${QAD_LIB_TYPE} + FULLNAME "${_QAD_DOMAIN}.*" + COMPANY "${_QAD_COMPANY}") message(STATUS "Building QAD version ${QAD_VERSION} (${QAD_LIB_TYPE})") @@ -94,103 +98,6 @@ else() install(FILES ${EXPORT_HEADER} DESTINATION include/qad) endif() -macro(qad_install _TARGET _HDR_VAR _QM_FILES) - if ("${_TARGET}" STREQUAL "qad_utils") - list(APPEND ${_HDR_VAR} "${QAD_VERSION_FILE}") - endif() - if (LIBPROJECT) - sdk_install("qad" "${_TARGET}" "${${_HDR_VAR}}" "${_QM_FILES}") - else() - if (LIB) - if (WIN32) - if(NOT "x${${_HDR_VAR}}" STREQUAL "x") - install(FILES ${${_HDR_VAR}} DESTINATION ${MINGW_INCLUDE}/qad) - endif() - qt_install(TARGETS ${_TARGET} ARCHIVE DESTINATION ${MINGW_LIB}) - qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION ${MINGW_BIN}) - qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION QtBin) - else() - if(NOT "x${${_HDR_VAR}}" STREQUAL "x") - install(FILES ${${_HDR_VAR}} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/qad) - endif() - qt_install(TARGETS ${_TARGET} ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) - endif() - if(NOT "x${_QM_FILES}" STREQUAL "x") - qt_install(LANG ${_QM_FILES} DESTINATION QtLang) - endif() - else() - if(WIN32) - qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION bin) - qt_install(TARGETS ${_TARGET} ARCHIVE DESTINATION lib) - else() - qt_install(TARGETS ${_TARGET} DESTINATION lib) - endif() - if(NOT "x${${_HDR_VAR}}" STREQUAL "x") - install(FILES ${${_HDR_VAR}} DESTINATION include/qad) - endif() - if(NOT "x${_QM_FILES}" STREQUAL "x") - qt_install(LANG ${_QM_FILES} DESTINATION lang) - endif() - endif() - endif() -endmacro() - -macro(qad_plugin NAME _MODULES _LIBS) - if (NOT STATIC_LIB) - if(DESIGNER_PLUGINS) - set(PROJ_NAME qad_${NAME}_plugin) - include_directories("..") - add_definitions(-DQT_PLUGIN) - add_definitions(-DQT_NO_DEBUG) - add_definitions(-DQT_SHARED) - add_definitions(-DQDESIGNER_EXPORT_WIDGETS) - find_qt(${QtVersions} Core Designer ${_MODULES}) - qt_sources(SRC) - qt_wrap(${SRC} CPPS out_CPP QMS out_QM) - qt_add_library(${PROJ_NAME} SHARED out_CPP) - qt_target_link_libraries(${PROJ_NAME} ${_LIBS} qad_${NAME} ${_${NAME}_PLUGIN_LIBS}) - if (WIN32) - qt_install(TARGETS ${PROJ_NAME} RUNTIME DESTINATION QtPlugins/designer) - else() - qt_install(TARGETS ${PROJ_NAME} DESTINATION QtPlugins/designer) - endif() - endif() - endif() -endmacro() - -macro(qad_project NAME _MODULES _LIBS) - set(PROJ_NAME qad_${NAME}) - find_qt(${QtVersions} Core ${_MODULES}) - qt_sources(SRC) - import_version(${PROJ_NAME} QAD) - if(NOT STATIC_LIB) - set_deploy_property(${PROJ_NAME} SHARED - LABEL ${PROJ_NAME} - FULLNAME "${_QAD_DOMAIN}.${PROJ_NAME}" - COMPANY ${_QAD_COMPANY} - INFO "QAD ${NAME} library") - else() - set_deploy_property(${PROJ_NAME} STATIC - LABEL ${PROJ_NAME} - FULLNAME "${_QAD_DOMAIN}.${PROJ_NAME}" - COMPANY ${_QAD_COMPANY} - INFO "QAD ${NAME} library") - endif() - make_rc(${PROJ_NAME} out_RC) - qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM ${out_RC}) - qt_add_library(${PROJ_NAME} ${QAD_LIB_TYPE} out_CPP ${EXPORT_HEADER}) - if(NOT STATIC_LIB) - qt_target_compile_definitions(${PROJ_NAME} PRIVATE QAD_SHARED_DEFINE) - endif() - qt_target_link_libraries(${PROJ_NAME} ${_LIBS}) - qad_install(${PROJ_NAME} "out_HDR" "out_QM") - message(STATUS "Building ${PROJ_NAME}") - if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin") - set(_${NAME}_PLUGIN_LIBS "${_LIBS}") - add_subdirectory(plugin) - endif() -endmacro() - add_subdirectory(libs) if (UTILS) add_subdirectory(utils) diff --git a/qad/cmake/QADMacros.cmake b/qad/cmake/QADMacros.cmake new file mode 100644 index 0000000..7c473f2 --- /dev/null +++ b/qad/cmake/QADMacros.cmake @@ -0,0 +1,82 @@ + +macro(_qt_install _TARGET IS_APP _DIR _HDR_VAR _QM_FILES) + if ("${_TARGET}" STREQUAL "qad_utils") + list(APPEND ${_HDR_VAR} "${QAD_VERSION_FILE}") + endif() + sdk_install("${_DIR}" ${IS_APP} "${_TARGET}" "${${_HDR_VAR}}" "${_QM_FILES}") +endmacro() + + +macro(qad_plugin NAME _MODULES _LIBS) + if (NOT STATIC_LIB) + if(DESIGNER_PLUGINS) + set(PROJ_NAME qad_${NAME}_plugin) + include_directories("..") + add_definitions(-DQT_PLUGIN) + add_definitions(-DQT_NO_DEBUG) + add_definitions(-DQT_SHARED) + add_definitions(-DQDESIGNER_EXPORT_WIDGETS) + find_qt(${QtVersions} Core Designer ${_MODULES}) + qt_sources(SRC) + qt_wrap(${SRC} CPPS out_CPP QMS out_QM) + qt_add_library(${PROJ_NAME} SHARED out_CPP) + qt_target_link_libraries(${PROJ_NAME} ${_LIBS} qad_${NAME} ${_${NAME}_PLUGIN_LIBS}) + if (WIN32) + qt_install(TARGETS ${PROJ_NAME} RUNTIME DESTINATION QtPlugins/designer) + else() + qt_install(TARGETS ${PROJ_NAME} DESTINATION QtPlugins/designer) + endif() + endif() + endif() +endmacro() + + +macro(_qt_project NAME IS_APP DOMAIN _MODULES _LIBS) + set(PROJ_NAME ${NAME}) + find_qt(${QtVersions} Core ${_MODULES}) + qt_sources(SRC) + import_version(${PROJ_NAME} ${DOMAIN}) + import_deploy_properties(${PROJ_NAME} ${DOMAIN}) + if (${IS_APP}) + set_deploy_property(${PROJ_NAME} + LABEL ${PROJ_NAME} + FULLNAME "${_${DOMAIN}_DOMAIN}.${PROJ_NAME}" + INFO "${APP_INFO}" + ICON "${APP_ICON}") + else() + set_deploy_property(${PROJ_NAME} SHARED + LABEL ${PROJ_NAME} + FULLNAME "${_${DOMAIN}_DOMAIN}.${PROJ_NAME}" + INFO "${DOMAIN} ${NAME} library") + endif() + make_rc(${PROJ_NAME} out_RC) + qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM ${out_RC}) + if (${IS_APP}) + qt_add_executable(${PROJ_NAME} WIN32 out_CPP ${${DOMAIN}_EXPORT_HEADER} ${ARGN}) + else() + qt_add_library(${PROJ_NAME} ${${DOMAIN}_LIB_TYPE} out_CPP ${${DOMAIN}_EXPORT_HEADER} ${ARGN}) + if(NOT STATIC_LIB) + qt_target_compile_definitions(${PROJ_NAME} PRIVATE ${DOMAIN}_SHARED_DEFINE) + endif() + endif() + qt_target_link_libraries(${PROJ_NAME} ${_LIBS}) + list(APPEND QT_MULTILIB_LIST ${PROJ_NAME}) + set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) + message(STATUS "Building ${PROJ_NAME}") + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin") + set(_${NAME}_PLUGIN_LIBS "${_LIBS}") + add_subdirectory(plugin) + endif() +endmacro() + + +macro(qad_library NAME _MODULES _LIBS) + _qt_project(qad_${NAME} FALSE "QAD" "${_MODULES}" "${_LIBS}") + _qt_install(qad_${NAME} FALSE "qad" "out_HDR" "out_QM") +endmacro() + + +macro(qad_application NAME _MODULES _LIBS) + _qt_project(${NAME} TRUE "QAD" "${_MODULES}" "${_LIBS}") + _qt_install(${NAME} TRUE "qad" "" "out_QM") +endmacro() diff --git a/qcd_utils/pult/icons/dialog-information.png b/qad/icons/dialog-information.png similarity index 100% rename from qcd_utils/pult/icons/dialog-information.png rename to qad/icons/dialog-information.png diff --git a/qad/icons/document-revert.png b/qad/icons/document-revert.png new file mode 100644 index 0000000..70202e2 Binary files /dev/null and b/qad/icons/document-revert.png differ diff --git a/qad/libs/CMakeLists.txt b/qad/libs/CMakeLists.txt index 1d6cfb3..0d911f8 100644 --- a/qad/libs/CMakeLists.txt +++ b/qad/libs/CMakeLists.txt @@ -1,26 +1 @@ -set(DIRS) -file(GLOB _dl "[^.]*") -foreach(_D ${_dl}) - if(IS_DIRECTORY ${_D}) - list(APPEND DIRS ${_D}) - endif() -endforeach() - -set(qad_includes) -foreach(_D ${DIRS}) - get_filename_component(_dname "${_D}" NAME) - list(APPEND QT_MULTILIB_LIST qad_${_dname}) - list(APPEND qad_includes "${_D}") -endforeach() -set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) -set(qad_includes ${qad_includes} PARENT_SCOPE) -foreach(_D ${DIRS}) - include_directories(${_D}) -endforeach() -foreach(_D ${DIRS}) - add_subdirectory(${_D}) -endforeach() - -if (LIB) - set(_ALL_TARGETS ${_ALL_TARGETS} PARENT_SCOPE) -endif() +add_directories_with_include("qad_") diff --git a/qad/libs/application/CMakeLists.txt b/qad/libs/application/CMakeLists.txt index fc08834..dc107e3 100644 --- a/qad/libs/application/CMakeLists.txt +++ b/qad/libs/application/CMakeLists.txt @@ -1 +1 @@ -qad_project(application "Gui;Widgets" "qad_widgets") +qad_library(application "Gui;Widgets" "qad_widgets") diff --git a/qad/libs/blockview/CMakeLists.txt b/qad/libs/blockview/CMakeLists.txt index 3d72fb5..764dba9 100644 --- a/qad/libs/blockview/CMakeLists.txt +++ b/qad/libs/blockview/CMakeLists.txt @@ -1 +1 @@ -qad_project(blockview "Gui;Widgets" "qad_utils;qad_widgets") +qad_library(blockview "Gui;Widgets" "qad_utils;qad_widgets") diff --git a/qad/libs/doc/CMakeLists.txt b/qad/libs/doc/CMakeLists.txt index d1daf7d..9b9aab6 100644 --- a/qad/libs/doc/CMakeLists.txt +++ b/qad/libs/doc/CMakeLists.txt @@ -18,7 +18,7 @@ endif() find_library(MARKDOWN_LIBRARY markdown) if (MARKDOWN_LIBRARY) if(_mkd_header_found) - qad_project(doc "Core" "${MARKDOWN_LIBRARY}") + qad_library(doc "Core" "${MARKDOWN_LIBRARY}") else() message(STATUS "Found markdown library, but *.h missing!") endif() diff --git a/qad/libs/graphic/CMakeLists.txt b/qad/libs/graphic/CMakeLists.txt index 9460cd5..3222da4 100644 --- a/qad/libs/graphic/CMakeLists.txt +++ b/qad/libs/graphic/CMakeLists.txt @@ -1 +1 @@ -qad_project(graphic "Gui;Widgets;OpenGL" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}") +qad_library(graphic "Gui;Widgets;OpenGL" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}") diff --git a/qad/libs/sql_table/CMakeLists.txt b/qad/libs/sql_table/CMakeLists.txt index dc33f9b..c8df55f 100644 --- a/qad/libs/sql_table/CMakeLists.txt +++ b/qad/libs/sql_table/CMakeLists.txt @@ -1 +1 @@ -qad_project(sql_table "Gui;Widgets;Sql" "qad_utils;qad_widgets") +qad_library(sql_table "Gui;Widgets;Sql" "qad_utils;qad_widgets") diff --git a/qad/libs/touch_widgets/CMakeLists.txt b/qad/libs/touch_widgets/CMakeLists.txt index b90c979..e6b86ef 100644 --- a/qad/libs/touch_widgets/CMakeLists.txt +++ b/qad/libs/touch_widgets/CMakeLists.txt @@ -1 +1 @@ -qad_project(touch_widgets "Gui;Widgets" "") +qad_library(touch_widgets "Gui;Widgets" "") diff --git a/qad/libs/utils/CMakeLists.txt b/qad/libs/utils/CMakeLists.txt index d463392..9c23d41 100644 --- a/qad/libs/utils/CMakeLists.txt +++ b/qad/libs/utils/CMakeLists.txt @@ -1 +1 @@ -qad_project(utils "Gui;Widgets" "") +qad_library(utils "Gui;Widgets" "") diff --git a/qad/libs/widgets/CMakeLists.txt b/qad/libs/widgets/CMakeLists.txt index cec548c..cc21a27 100644 --- a/qad/libs/widgets/CMakeLists.txt +++ b/qad/libs/widgets/CMakeLists.txt @@ -1 +1 @@ -qad_project(widgets "Gui;Widgets" "qad_utils") +qad_library(widgets "Gui;Widgets" "qad_utils") diff --git a/qad/utils/CMakeLists.txt b/qad/utils/CMakeLists.txt index f2cede5..dc9a712 100644 --- a/qad/utils/CMakeLists.txt +++ b/qad/utils/CMakeLists.txt @@ -1,11 +1 @@ -include_directories(${qad_includes}) -file(GLOB _dl "[^.]*") -foreach(_D ${_dl}) - if(IS_DIRECTORY ${_D}) - add_subdirectory(${_D}) - endif() -endforeach() - -if (LIB) - set(_ALL_TARGETS ${_ALL_TARGETS} PARENT_SCOPE) -endif() +add_directories("qad_") diff --git a/qad/utils/blockeditor/CMakeLists.txt b/qad/utils/blockeditor/CMakeLists.txt index dd271c4..5b2a417 100644 --- a/qad/utils/blockeditor/CMakeLists.txt +++ b/qad/utils/blockeditor/CMakeLists.txt @@ -1,42 +1,14 @@ project(blockeditor) -import_version(${PROJECT_NAME} QAD) -find_qt(${QtVersions} Core Gui Widgets) -if (Qt5_FOUND) - import_version(${PROJECT_NAME}5 ${PROJECT_NAME}) - import_deploy_properties(${PROJECT_NAME}5 ${PROJECT_NAME}) -endif() -set_deploy_property(${PROJECT_NAME} - LABEL ${PROJECT_NAME} - FULLNAME "${_QAD_DOMAIN}.${PROJECT_NAME}" - COMPANY ${_QAD_COMPANY} - INFO "Editor for BlockView Blocks") if(APPLE) - #set_deploy_property(${PROJECT_NAME} ICON "icons/blockview.icns") + set(APP_ICON "") elseif(WIN32) - set_deploy_property(${PROJECT_NAME} ICON "icons/blockview.ico") + set(APP_ICON "icons/blockview.ico") else() - set_deploy_property(${PROJECT_NAME} ICON "icons/blockview.png") -endif() -make_rc(${PROJECT_NAME} out_RC) -qt_sources(SRC) -qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) -qt_add_executable(${PROJECT_NAME} WIN32 out_CPP ${out_RC}) -qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_blockview) -message(STATUS "Building ${PROJECT_NAME}") -if(LIB) - if(WIN32) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN}) - else() - if (DEFINED ANDROID_PLATFORM) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${ANDROID_SYSTEM_LIBRARY_PATH}/usr/bin) - else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin) - endif() - endif() - #message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") -else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin) + set(APP_ICON "icons/blockview.png") endif() +set(APP_INFO "Editor for BlockView Blocks") +qad_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;qad_blockview") if (Qt5_FOUND) - deploy_target(${PROJECT_NAME}5 VERBOSE DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../release) + import_version(${PROJ_NAME}5 ${PROJECT_NAME}) + deploy_target(${PROJECT_NAME}5 DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${ROOT_DIR}/release) endif() diff --git a/qad/utils/qpicalculator/CMakeLists.txt b/qad/utils/qpicalculator/CMakeLists.txt index 34db325..27ecf2c 100644 --- a/qad/utils/qpicalculator/CMakeLists.txt +++ b/qad/utils/qpicalculator/CMakeLists.txt @@ -1,23 +1,14 @@ project(qpicalc) -find_qt(${QtVersions} Core Gui Widgets) -qt_sources(SRC) -qt_wrap(${SRC} CPPS out_CPP QMS out_QM) -qt_add_executable(${PROJECT_NAME} WIN32 out_CPP) -qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_graphic) -message(STATUS "Building ${PROJECT_NAME}") -if(LIB) - if(WIN32) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN}) - else() - if (DEFINED ANDROID_PLATFORM) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${ANDROID_SYSTEM_LIBRARY_PATH}/usr/bin) - else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin) - endif() - endif() - #message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") +if(APPLE) + set(APP_ICON "") +elseif(WIN32) + set(APP_ICON "icons/qpicalculator.ico") else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin) - #message(STATUS "Install ${PROJECT_NAME} to local \"bin\"") + set(APP_ICON "icons/qpicalculator.png") +endif() +set(APP_INFO "Small calculator ang grapher") +qad_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;qad_graphic") +if (Qt5_FOUND) + import_version(${PROJ_NAME}5 ${PROJECT_NAME}) + deploy_target(${PROJECT_NAME}5 DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${ROOT_DIR}/release) endif() - diff --git a/qad/utils/qpicalculator/icons/Apps-accessories-calculator-icon.png b/qad/utils/qpicalculator/icons/Apps-accessories-calculator-icon.png deleted file mode 100644 index 37a3035..0000000 Binary files a/qad/utils/qpicalculator/icons/Apps-accessories-calculator-icon.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/application-exit.png b/qad/utils/qpicalculator/icons/application-exit.png deleted file mode 100644 index 4839c61..0000000 Binary files a/qad/utils/qpicalculator/icons/application-exit.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/arrow-left.png b/qad/utils/qpicalculator/icons/arrow-left.png deleted file mode 100644 index 0a74ecf..0000000 Binary files a/qad/utils/qpicalculator/icons/arrow-left.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/arrow-right.png b/qad/utils/qpicalculator/icons/arrow-right.png deleted file mode 100644 index 0a8a69e..0000000 Binary files a/qad/utils/qpicalculator/icons/arrow-right.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/axes.png b/qad/utils/qpicalculator/icons/axes.png deleted file mode 100644 index 11a059d..0000000 Binary files a/qad/utils/qpicalculator/icons/axes.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/axes_1.png b/qad/utils/qpicalculator/icons/axes_1.png deleted file mode 100644 index cb54382..0000000 Binary files a/qad/utils/qpicalculator/icons/axes_1.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/character-set.png b/qad/utils/qpicalculator/icons/character-set.png deleted file mode 100644 index 9be1a10..0000000 Binary files a/qad/utils/qpicalculator/icons/character-set.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/configure.png b/qad/utils/qpicalculator/icons/configure.png deleted file mode 100644 index 5ce478b..0000000 Binary files a/qad/utils/qpicalculator/icons/configure.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/dialog-close.png b/qad/utils/qpicalculator/icons/dialog-close.png deleted file mode 100644 index 2c2f99e..0000000 Binary files a/qad/utils/qpicalculator/icons/dialog-close.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/document-close.png b/qad/utils/qpicalculator/icons/document-close.png deleted file mode 100644 index d3937b9..0000000 Binary files a/qad/utils/qpicalculator/icons/document-close.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/document-edit.png b/qad/utils/qpicalculator/icons/document-edit.png deleted file mode 100644 index 84e345d..0000000 Binary files a/qad/utils/qpicalculator/icons/document-edit.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/document-open.png b/qad/utils/qpicalculator/icons/document-open.png deleted file mode 100644 index b225e9a..0000000 Binary files a/qad/utils/qpicalculator/icons/document-open.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/document-revert.png b/qad/utils/qpicalculator/icons/document-revert.png deleted file mode 100644 index b224e05..0000000 Binary files a/qad/utils/qpicalculator/icons/document-revert.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/document-save-as.png b/qad/utils/qpicalculator/icons/document-save-as.png deleted file mode 100644 index 821ca12..0000000 Binary files a/qad/utils/qpicalculator/icons/document-save-as.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/document-save.png b/qad/utils/qpicalculator/icons/document-save.png deleted file mode 100644 index 8072aea..0000000 Binary files a/qad/utils/qpicalculator/icons/document-save.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-clear-locationbar-rtl.png b/qad/utils/qpicalculator/icons/edit-clear-locationbar-rtl.png deleted file mode 100644 index 6c4b83b..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-clear-locationbar-rtl.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-clear.png b/qad/utils/qpicalculator/icons/edit-clear.png deleted file mode 100644 index 19a1665..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-clear.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-copy.png b/qad/utils/qpicalculator/icons/edit-copy.png deleted file mode 100644 index 5cdeb5f..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-copy.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-cut.png b/qad/utils/qpicalculator/icons/edit-cut.png deleted file mode 100644 index f4a55e3..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-cut.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-delete.png b/qad/utils/qpicalculator/icons/edit-delete.png deleted file mode 100644 index 87cd0b0..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-delete.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-find.png b/qad/utils/qpicalculator/icons/edit-find.png deleted file mode 100644 index 9a462c0..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-find.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-guides.png b/qad/utils/qpicalculator/icons/edit-guides.png deleted file mode 100644 index d264839..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-guides.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-paste.png b/qad/utils/qpicalculator/icons/edit-paste.png deleted file mode 100644 index a4e0a02..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-paste.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-redo.png b/qad/utils/qpicalculator/icons/edit-redo.png deleted file mode 100644 index 9bfee2d..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-redo.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/edit-undo.png b/qad/utils/qpicalculator/icons/edit-undo.png deleted file mode 100644 index 83e41dc..0000000 Binary files a/qad/utils/qpicalculator/icons/edit-undo.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/empty_brick.png b/qad/utils/qpicalculator/icons/empty_brick.png deleted file mode 100644 index b09680b..0000000 Binary files a/qad/utils/qpicalculator/icons/empty_brick.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/format-fill-color.png b/qad/utils/qpicalculator/icons/format-fill-color.png deleted file mode 100644 index 6601f53..0000000 Binary files a/qad/utils/qpicalculator/icons/format-fill-color.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/format-text-bold.png b/qad/utils/qpicalculator/icons/format-text-bold.png deleted file mode 100644 index 3abb164..0000000 Binary files a/qad/utils/qpicalculator/icons/format-text-bold.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/format-text-color.png b/qad/utils/qpicalculator/icons/format-text-color.png deleted file mode 100644 index 9e86afc..0000000 Binary files a/qad/utils/qpicalculator/icons/format-text-color.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/format-text-italic.png b/qad/utils/qpicalculator/icons/format-text-italic.png deleted file mode 100644 index 93ec082..0000000 Binary files a/qad/utils/qpicalculator/icons/format-text-italic.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/format-text-overline.png b/qad/utils/qpicalculator/icons/format-text-overline.png deleted file mode 100644 index e49a11c..0000000 Binary files a/qad/utils/qpicalculator/icons/format-text-overline.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/format-text-strikethrough.png b/qad/utils/qpicalculator/icons/format-text-strikethrough.png deleted file mode 100644 index f248ce0..0000000 Binary files a/qad/utils/qpicalculator/icons/format-text-strikethrough.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/format-text-underline.png b/qad/utils/qpicalculator/icons/format-text-underline.png deleted file mode 100644 index 7e47fb8..0000000 Binary files a/qad/utils/qpicalculator/icons/format-text-underline.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/go-home.png b/qad/utils/qpicalculator/icons/go-home.png deleted file mode 100644 index aab6a88..0000000 Binary files a/qad/utils/qpicalculator/icons/go-home.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/go-next.png b/qad/utils/qpicalculator/icons/go-next.png deleted file mode 100644 index aa7cbb9..0000000 Binary files a/qad/utils/qpicalculator/icons/go-next.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/go-previous.png b/qad/utils/qpicalculator/icons/go-previous.png deleted file mode 100644 index 8230340..0000000 Binary files a/qad/utils/qpicalculator/icons/go-previous.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/graphic_add.png b/qad/utils/qpicalculator/icons/graphic_add.png deleted file mode 100644 index a002a95..0000000 Binary files a/qad/utils/qpicalculator/icons/graphic_add.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/graphics.png b/qad/utils/qpicalculator/icons/graphics.png deleted file mode 100644 index 8cd2359..0000000 Binary files a/qad/utils/qpicalculator/icons/graphics.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/help-contents.png b/qad/utils/qpicalculator/icons/help-contents.png deleted file mode 100644 index b3fbea8..0000000 Binary files a/qad/utils/qpicalculator/icons/help-contents.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_brick_add.png b/qad/utils/qpicalculator/icons/history_brick_add.png deleted file mode 100644 index 808b43d..0000000 Binary files a/qad/utils/qpicalculator/icons/history_brick_add.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_brick_del.png b/qad/utils/qpicalculator/icons/history_brick_del.png deleted file mode 100644 index da48458..0000000 Binary files a/qad/utils/qpicalculator/icons/history_brick_del.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_brick_move.png b/qad/utils/qpicalculator/icons/history_brick_move.png deleted file mode 100644 index 7d42f91..0000000 Binary files a/qad/utils/qpicalculator/icons/history_brick_move.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_conn_add.png b/qad/utils/qpicalculator/icons/history_conn_add.png deleted file mode 100644 index 1f2839f..0000000 Binary files a/qad/utils/qpicalculator/icons/history_conn_add.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_conn_del.png b/qad/utils/qpicalculator/icons/history_conn_del.png deleted file mode 100644 index 48284dc..0000000 Binary files a/qad/utils/qpicalculator/icons/history_conn_del.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_conn_edit.png b/qad/utils/qpicalculator/icons/history_conn_edit.png deleted file mode 100644 index 74ecd00..0000000 Binary files a/qad/utils/qpicalculator/icons/history_conn_edit.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_conn_retrace.png b/qad/utils/qpicalculator/icons/history_conn_retrace.png deleted file mode 100644 index 427f1ce..0000000 Binary files a/qad/utils/qpicalculator/icons/history_conn_retrace.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_convert.png b/qad/utils/qpicalculator/icons/history_convert.png deleted file mode 100644 index b84e2b7..0000000 Binary files a/qad/utils/qpicalculator/icons/history_convert.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_freq.png b/qad/utils/qpicalculator/icons/history_freq.png deleted file mode 100644 index 2b68fac..0000000 Binary files a/qad/utils/qpicalculator/icons/history_freq.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_point.xcf b/qad/utils/qpicalculator/icons/history_point.xcf deleted file mode 100644 index 6c08963..0000000 Binary files a/qad/utils/qpicalculator/icons/history_point.xcf and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_point_add.png b/qad/utils/qpicalculator/icons/history_point_add.png deleted file mode 100644 index 89f738b..0000000 Binary files a/qad/utils/qpicalculator/icons/history_point_add.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_point_del.png b/qad/utils/qpicalculator/icons/history_point_del.png deleted file mode 100644 index 970d0d7..0000000 Binary files a/qad/utils/qpicalculator/icons/history_point_del.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_point_move.png b/qad/utils/qpicalculator/icons/history_point_move.png deleted file mode 100644 index 9a1f895..0000000 Binary files a/qad/utils/qpicalculator/icons/history_point_move.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_seg_add.png b/qad/utils/qpicalculator/icons/history_seg_add.png deleted file mode 100644 index 2862e21..0000000 Binary files a/qad/utils/qpicalculator/icons/history_seg_add.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_seg_del.png b/qad/utils/qpicalculator/icons/history_seg_del.png deleted file mode 100644 index 3b8ebaa..0000000 Binary files a/qad/utils/qpicalculator/icons/history_seg_del.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_seg_move.png b/qad/utils/qpicalculator/icons/history_seg_move.png deleted file mode 100644 index 594711e..0000000 Binary files a/qad/utils/qpicalculator/icons/history_seg_move.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_text_add.png b/qad/utils/qpicalculator/icons/history_text_add.png deleted file mode 100644 index be78f1e..0000000 Binary files a/qad/utils/qpicalculator/icons/history_text_add.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_text_del.png b/qad/utils/qpicalculator/icons/history_text_del.png deleted file mode 100644 index 7f6eb67..0000000 Binary files a/qad/utils/qpicalculator/icons/history_text_del.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_text_edit.png b/qad/utils/qpicalculator/icons/history_text_edit.png deleted file mode 100644 index b2c973e..0000000 Binary files a/qad/utils/qpicalculator/icons/history_text_edit.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/history_text_move.png b/qad/utils/qpicalculator/icons/history_text_move.png deleted file mode 100644 index 141876a..0000000 Binary files a/qad/utils/qpicalculator/icons/history_text_move.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/initial.png b/qad/utils/qpicalculator/icons/initial.png deleted file mode 100644 index b889071..0000000 Binary files a/qad/utils/qpicalculator/icons/initial.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/insert-image.png b/qad/utils/qpicalculator/icons/insert-image.png deleted file mode 100644 index 9a1b321..0000000 Binary files a/qad/utils/qpicalculator/icons/insert-image.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/insert-text.png b/qad/utils/qpicalculator/icons/insert-text.png deleted file mode 100644 index 65d645d..0000000 Binary files a/qad/utils/qpicalculator/icons/insert-text.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/layer-visible-off.png b/qad/utils/qpicalculator/icons/layer-visible-off.png deleted file mode 100644 index 24277f6..0000000 Binary files a/qad/utils/qpicalculator/icons/layer-visible-off.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/layer-visible-on.png b/qad/utils/qpicalculator/icons/layer-visible-on.png deleted file mode 100644 index ea53bd1..0000000 Binary files a/qad/utils/qpicalculator/icons/layer-visible-on.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/list-add.png b/qad/utils/qpicalculator/icons/list-add.png deleted file mode 100644 index 1e03be9..0000000 Binary files a/qad/utils/qpicalculator/icons/list-add.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/mbricks.svg b/qad/utils/qpicalculator/icons/mbricks.svg deleted file mode 100644 index 38ed473..0000000 --- a/qad/utils/qpicalculator/icons/mbricks.svg +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - MB - diff --git a/qad/utils/qpicalculator/icons/mbricks_128.png b/qad/utils/qpicalculator/icons/mbricks_128.png deleted file mode 100644 index 7eb729b..0000000 Binary files a/qad/utils/qpicalculator/icons/mbricks_128.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/mbricks_22.png b/qad/utils/qpicalculator/icons/mbricks_22.png deleted file mode 100644 index cc19f2f..0000000 Binary files a/qad/utils/qpicalculator/icons/mbricks_22.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/mbricks_256.png b/qad/utils/qpicalculator/icons/mbricks_256.png deleted file mode 100644 index 22c4f53..0000000 Binary files a/qad/utils/qpicalculator/icons/mbricks_256.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/mbricks_64.png b/qad/utils/qpicalculator/icons/mbricks_64.png deleted file mode 100644 index 11fbb75..0000000 Binary files a/qad/utils/qpicalculator/icons/mbricks_64.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/media-playback-pause.png b/qad/utils/qpicalculator/icons/media-playback-pause.png deleted file mode 100644 index a9b3113..0000000 Binary files a/qad/utils/qpicalculator/icons/media-playback-pause.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/media-playback-start.png b/qad/utils/qpicalculator/icons/media-playback-start.png deleted file mode 100644 index 80ff3a1..0000000 Binary files a/qad/utils/qpicalculator/icons/media-playback-start.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/media-playback-stop.png b/qad/utils/qpicalculator/icons/media-playback-stop.png deleted file mode 100644 index 180280e..0000000 Binary files a/qad/utils/qpicalculator/icons/media-playback-stop.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/media-skip-forward.png b/qad/utils/qpicalculator/icons/media-skip-forward.png deleted file mode 100644 index 0d22924..0000000 Binary files a/qad/utils/qpicalculator/icons/media-skip-forward.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/object-flip-horizontal.png b/qad/utils/qpicalculator/icons/object-flip-horizontal.png deleted file mode 100644 index 6b428d0..0000000 Binary files a/qad/utils/qpicalculator/icons/object-flip-horizontal.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/player-time.png b/qad/utils/qpicalculator/icons/player-time.png deleted file mode 100644 index 77ba33c..0000000 Binary files a/qad/utils/qpicalculator/icons/player-time.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/preferences-desktop-display.png b/qad/utils/qpicalculator/icons/preferences-desktop-display.png deleted file mode 100644 index bd64701..0000000 Binary files a/qad/utils/qpicalculator/icons/preferences-desktop-display.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/preferences-desktop-keyboard.png b/qad/utils/qpicalculator/icons/preferences-desktop-keyboard.png deleted file mode 100644 index d13683f..0000000 Binary files a/qad/utils/qpicalculator/icons/preferences-desktop-keyboard.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/qpicalculator.ico b/qad/utils/qpicalculator/icons/qpicalculator.ico new file mode 100644 index 0000000..99388c5 Binary files /dev/null and b/qad/utils/qpicalculator/icons/qpicalculator.ico differ diff --git a/qad/utils/qpicalculator/icons/qpicalculator.png b/qad/utils/qpicalculator/icons/qpicalculator.png new file mode 100644 index 0000000..dad22b7 Binary files /dev/null and b/qad/utils/qpicalculator/icons/qpicalculator.png differ diff --git a/qad/utils/qpicalculator/icons/run-build.png b/qad/utils/qpicalculator/icons/run-build.png deleted file mode 100644 index d5fa88f..0000000 Binary files a/qad/utils/qpicalculator/icons/run-build.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/tree.png b/qad/utils/qpicalculator/icons/tree.png deleted file mode 100644 index 592446a..0000000 Binary files a/qad/utils/qpicalculator/icons/tree.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/view-center.png b/qad/utils/qpicalculator/icons/view-center.png deleted file mode 100644 index 8de1c9b..0000000 Binary files a/qad/utils/qpicalculator/icons/view-center.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/view-fullscreen.png b/qad/utils/qpicalculator/icons/view-fullscreen.png deleted file mode 100644 index d41fc7e..0000000 Binary files a/qad/utils/qpicalculator/icons/view-fullscreen.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/view-grid.png b/qad/utils/qpicalculator/icons/view-grid.png deleted file mode 100644 index 0f1d70c..0000000 Binary files a/qad/utils/qpicalculator/icons/view-grid.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/view-mode-compact.png b/qad/utils/qpicalculator/icons/view-mode-compact.png deleted file mode 100644 index d02228c..0000000 Binary files a/qad/utils/qpicalculator/icons/view-mode-compact.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/view-mode-expanded.png b/qad/utils/qpicalculator/icons/view-mode-expanded.png deleted file mode 100644 index 59a82d2..0000000 Binary files a/qad/utils/qpicalculator/icons/view-mode-expanded.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/view-mode-icon.png b/qad/utils/qpicalculator/icons/view-mode-icon.png deleted file mode 100644 index 78f9f85..0000000 Binary files a/qad/utils/qpicalculator/icons/view-mode-icon.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/view-refresh.png b/qad/utils/qpicalculator/icons/view-refresh.png deleted file mode 100644 index 86b6f82..0000000 Binary files a/qad/utils/qpicalculator/icons/view-refresh.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/view-restore.png b/qad/utils/qpicalculator/icons/view-restore.png deleted file mode 100644 index 7726c35..0000000 Binary files a/qad/utils/qpicalculator/icons/view-restore.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/view-tooltips.png b/qad/utils/qpicalculator/icons/view-tooltips.png deleted file mode 100644 index ca5652c..0000000 Binary files a/qad/utils/qpicalculator/icons/view-tooltips.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/window-new.png b/qad/utils/qpicalculator/icons/window-new.png deleted file mode 100644 index 4268189..0000000 Binary files a/qad/utils/qpicalculator/icons/window-new.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/zoom-fit-best.png b/qad/utils/qpicalculator/icons/zoom-fit-best.png deleted file mode 100644 index 07cfc98..0000000 Binary files a/qad/utils/qpicalculator/icons/zoom-fit-best.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/zoom-in.png b/qad/utils/qpicalculator/icons/zoom-in.png deleted file mode 100644 index 6b7a682..0000000 Binary files a/qad/utils/qpicalculator/icons/zoom-in.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/zoom-original.png b/qad/utils/qpicalculator/icons/zoom-original.png deleted file mode 100644 index c894400..0000000 Binary files a/qad/utils/qpicalculator/icons/zoom-original.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/zoom-out.png b/qad/utils/qpicalculator/icons/zoom-out.png deleted file mode 100644 index 0ee8c6f..0000000 Binary files a/qad/utils/qpicalculator/icons/zoom-out.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/zoom-range.png b/qad/utils/qpicalculator/icons/zoom-range.png deleted file mode 100644 index c052512..0000000 Binary files a/qad/utils/qpicalculator/icons/zoom-range.png and /dev/null differ diff --git a/qad/utils/qpicalculator/icons/zoom-rect.png b/qad/utils/qpicalculator/icons/zoom-rect.png deleted file mode 100644 index da44fd5..0000000 Binary files a/qad/utils/qpicalculator/icons/zoom-rect.png and /dev/null differ diff --git a/qad/utils/qpicalculator/mainwindow.ui b/qad/utils/qpicalculator/mainwindow.ui index 234fed7..dae08e6 100644 --- a/qad/utils/qpicalculator/mainwindow.ui +++ b/qad/utils/qpicalculator/mainwindow.ui @@ -15,7 +15,7 @@ - :/icons/Apps-accessories-calculator-icon.png:/icons/Apps-accessories-calculator-icon.png + :/icons/qpicalculator.png:/icons/qpicalculator.png diff --git a/qad/utils/qpicalculator/qpicalculator.qrc b/qad/utils/qpicalculator/qpicalculator.qrc index 823218d..1a48626 100644 --- a/qad/utils/qpicalculator/qpicalculator.qrc +++ b/qad/utils/qpicalculator/qpicalculator.qrc @@ -1,9 +1,5 @@ - icons/edit-clear.png - icons/edit-delete.png - icons/list-add.png - icons/application-exit.png - icons/Apps-accessories-calculator-icon.png + icons/qpicalculator.png diff --git a/qcd_utils/CMakeLists.txt b/qcd_utils/CMakeLists.txt deleted file mode 100644 index 913edec..0000000 --- a/qcd_utils/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(qcd_utils) -set(_QCD_MAJOR 1) -set(_QCD_MINOR 0) -set(_QCD_REVISION 0) -set(_QCD_SUFFIX "") -set(_QCD_COMPANY SHS) -set(_QCD_DOMAIN org.SHS) -if(NOT DEFINED BUILD_NUMBER) - set(BUILD_NUMBER 9999) -endif() -if (NOT LIBPROJECT) - find_package(PIP REQUIRED) - option(LIB "System install" 0) - if (CMAKE_BUILD_TYPE MATCHES Debug) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -Wall") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3 -Wall") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall") - endif() - include(DeployMacros) -endif() -set_version(${PROJECT_NAME} - MAJOR ${_QCD_MAJOR} - MINOR ${_QCD_MINOR} - REVISION ${_QCD_REVISION} - BUILD "${BUILD_NUMBER}" - SUFFIX "${_QCD_SUFFIX}") - -find_package(QAD REQUIRED) -list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME}) -set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) -include_directories(${PIP_INCLUDES} ${QAD_INCLUDES}) -file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") -find_qt(${QtVersions} Core Gui) -set_deploy_property(${PROJECT_NAME} SHARED - LABEL ${PROJECT_NAME} - FULLNAME "${_QCD_DOMAIN}.${PROJECT_NAME}" - COMPANY ${_QCD_COMPANY} - INFO "QCD library") -make_rc(${PROJECT_NAME} out_RC) -qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) -qt_add_library(${PROJECT_NAME} SHARED out_CPP ${out_RC}) -qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets qad_graphic cd_utils piqt) -message(STATUS "Building ${PROJECT_NAME}") - -set(QCD_UTILS_UTILS 1) -if(LIBPROJECT) - sdk_install("" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}") - set(QCD_UTILS_UTILS ${UTILS}) -else() - if(LIB) - if(WIN32) - install(FILES ${out_HDR} DESTINATION ${MINGW_INCLUDE}) - qt_install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${MINGW_LIB}) - qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${MINGW_BIN}) - qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtBin) - else() - install(FILES ${out_HDR} DESTINATION ${CMAKE_INSTALL_PREFIX}/include) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) - endif() - message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") - else() - if(WIN32) - qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) - qt_install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib) - else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION lib) - endif() - install(FILES ${out_HDR} DESTINATION include) - message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"") - endif() -endif() - -if(QCD_UTILS_UTILS) - add_subdirectory(pult) -endif() diff --git a/qcd_utils/LICENSE.txt b/qcd_utils/LICENSE.txt deleted file mode 100644 index 0a04128..0000000 --- a/qcd_utils/LICENSE.txt +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/qcd_utils/pult/CMakeLists.txt b/qcd_utils/pult/CMakeLists.txt deleted file mode 100644 index b7f80cb..0000000 --- a/qcd_utils/pult/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -project(cd_pult) -import_version(${PROJECT_NAME} qcd_utils) -find_qt(${QtVersions} Core Gui OpenGL) -set_deploy_property(${PROJECT_NAME} - LABEL ${PROJECT_NAME} - FULLNAME "${_QCD_DOMAIN}.${PROJECT_NAME}" - COMPANY ${_QCD_COMPANY} - INFO "CD Pult") -if (Qt5_FOUND) - import_version(${PROJECT_NAME}5 ${PROJECT_NAME}) - import_deploy_properties(${PROJECT_NAME}5 ${PROJECT_NAME}) -endif() -make_rc(${PROJECT_NAME} out_RC) -qt_sources(SRC) -qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) -qt_add_executable(${PROJECT_NAME} WIN32 out_CPP ${out_RC}) -qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_graphic qad_application qcd_utils piqt_utils) -qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../../piqt_utils" ${QAD_INCLUDES}) -message(STATUS "Building ${PROJECT_NAME}") -if(LIB) - if(WIN32) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN}) - else() - if (DEFINED ANDROID_PLATFORM) - qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${ANDROID_SYSTEM_LIBRARY_PATH}/usr/bin) - else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin) - endif() - endif() - #message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") -else() - qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin) -endif() -if (Qt5_FOUND) - deploy_target(${PROJECT_NAME}5 VERBOSE DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../release) -endif() diff --git a/qcd_utils/pult/cdpult.qrc b/qcd_utils/pult/cdpult.qrc deleted file mode 100644 index 76a8d63..0000000 --- a/qcd_utils/pult/cdpult.qrc +++ /dev/null @@ -1,16 +0,0 @@ - - - icons/db-export.png - icons/db-import.png - icons/Apps-accessories-calculator-icon.png - icons/dialog-information.png - icons/dialog-cancel.png - icons/dialog-ok-apply.png - icons/timer.png - icons/document-revert.png - icons/flame.png - icons/view-refresh.png - icons/format-stroke-color.png - icons/accessories-text-editor.png - - diff --git a/qcd_utils/pult/icons/Apps-accessories-calculator-icon.png b/qcd_utils/pult/icons/Apps-accessories-calculator-icon.png deleted file mode 100644 index 37a3035..0000000 Binary files a/qcd_utils/pult/icons/Apps-accessories-calculator-icon.png and /dev/null differ diff --git a/qcd_utils/pult/icons/dialog-cancel.png b/qcd_utils/pult/icons/dialog-cancel.png deleted file mode 100644 index ace88ab..0000000 Binary files a/qcd_utils/pult/icons/dialog-cancel.png and /dev/null differ diff --git a/qcd_utils/pult/icons/dialog-ok-apply.png b/qcd_utils/pult/icons/dialog-ok-apply.png deleted file mode 100644 index 3260f60..0000000 Binary files a/qcd_utils/pult/icons/dialog-ok-apply.png and /dev/null differ diff --git a/qcd_utils/pult/icons/document-revert.png b/qcd_utils/pult/icons/document-revert.png deleted file mode 100644 index e04514b..0000000 Binary files a/qcd_utils/pult/icons/document-revert.png and /dev/null differ diff --git a/qcd_utils/pult/icons/format-stroke-color.png b/qcd_utils/pult/icons/format-stroke-color.png deleted file mode 100644 index 4c4d290..0000000 Binary files a/qcd_utils/pult/icons/format-stroke-color.png and /dev/null differ diff --git a/qcd_utils/pult/icons/view-refresh.png b/qcd_utils/pult/icons/view-refresh.png deleted file mode 100644 index 66f0ceb..0000000 Binary files a/qcd_utils/pult/icons/view-refresh.png and /dev/null differ diff --git a/qglengine/CMakeLists.txt b/qglengine/CMakeLists.txt index 92f4339..f5ad510 100644 --- a/qglengine/CMakeLists.txt +++ b/qglengine/CMakeLists.txt @@ -52,7 +52,7 @@ else() add_subdirectory(widgets) set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) if (LIBPROJECT) - sdk_install("qglengine" "qglengine_core" "${out_HDR}" "${out_QM}") + sdk_install("qglengine" FALSE "qglengine_core" "${out_HDR}" "${out_QM}") else() if (LIB) if (WIN32) diff --git a/qglengine/widgets/CMakeLists.txt b/qglengine/widgets/CMakeLists.txt index f650aaa..4cf64b1 100644 --- a/qglengine/widgets/CMakeLists.txt +++ b/qglengine/widgets/CMakeLists.txt @@ -22,7 +22,7 @@ list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME}) set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) #message(STATUS "Building ${PROJECT_NAME}") if (LIBPROJECT) - sdk_install("qglengine" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}") + sdk_install("qglengine" FALSE "${PROJECT_NAME}" "${out_HDR}" "${out_QM}") else() if (LIB) if (WIN32) diff --git a/qglview/CMakeLists.txt b/qglview/CMakeLists.txt index 31aa195..86e1110 100644 --- a/qglview/CMakeLists.txt +++ b/qglview/CMakeLists.txt @@ -28,7 +28,7 @@ else() qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") message(STATUS "Building ${PROJECT_NAME}") if (LIBPROJECT) - sdk_install("qad" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}") + sdk_install("qad" FALSE "${PROJECT_NAME}" "${out_HDR}" "${out_QM}") else() if (LIB) if (WIN32)