diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c526d6..5b57c6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,17 +9,15 @@ project(libs) set(PIP_CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pip/cmake") set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" "${PIP_CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/qad/cmake") set(LIBPROJECT 1) +include(GenerateExportHeader) include(SDKMacros) include(DeployMacros) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) if(NOT DEFINED BUILD_NUMBER) set(BUILD_NUMBER 9999) endif() if("x${BUILD_NUMBER}" STREQUAL "x") set(BUILD_NUMBER 0) 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) @@ -47,21 +45,22 @@ if (DEFINED ANDROID_PLATFORM) #message("${ANDROID_NDK}/sysroot/usr/include") endif() set(INSTALL_PREFIX "") -set(_plugins_default_ 1) +set(_plugins_default_ ON) if(CMAKE_CROSSCOMPILING) if (DEFINED ANDROID_PLATFORM) - set(_plugins_default_ 0) + set(_plugins_default_ OFF) set(INSTALL_PREFIX "${CMAKE_FIND_ROOT_PATH}/") else() set(INSTALL_PREFIX "${CMAKE_STAGING_PREFIX}") endif() endif() -option(CROSSTOOLS "Crosstools minimal build" 0) -option(LIB "System install" 1) -option(QGLVIEW "Build QGLview library and utils" 0) -option(QGLENGINE "Build QGLENGINE library and utils" 0) +option(CROSSTOOLS "Crosstools minimal build" OFF) +option(LIB "System install" ON) +option(QGLVIEW "Build QGLview library and utils" OFF) +option(QGLENGINE "Build QGLENGINE library and utils" OFF) option(UTILS "Build various utils" ${_plugins_default_}) option(DESIGNER_PLUGINS "Build qt designer plugins" ${_plugins_default_}) +option(STATIC_LIB OFF) if (CROSSTOOLS) set(LIB 1) set(QGLVIEW 0) @@ -153,6 +152,7 @@ else() list(APPEND PIP_INCLUDES "${F}") endforeach(F) add_subdirectory(cd_utils) + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/cd_utils" "${CMAKE_CURRENT_BINARY_DIR}/cd_utils") set(_DIRS) if (SomeQtFound) message(STATUS "Building Qt-derived targets for ${QtVersions}") diff --git a/SDKMacros.cmake b/SDKMacros.cmake index 2e933e0..73f89a7 100644 --- a/SDKMacros.cmake +++ b/SDKMacros.cmake @@ -1,48 +1,52 @@ macro(sdk_install _DIR IS_APP _TARGET _H_FILES _QM_FILES) #message("QM=${_QM_FILES}") - if(LIB) - if(WIN32) - 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() - else() - 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() - endif() - if(NOT "x${_QM_FILES}" STREQUAL "x") - qt_install(LANG ${_QM_FILES} DESTINATION QtLang) - endif() - else() - if(${IS_APP}) - qt_install(TARGETS ${_TARGET} DESTINATION bin) - else() - if(NOT "x${_H_FILES}" STREQUAL "x") - install(FILES ${_H_FILES} DESTINATION include/${_DIR}) - endif() + if((NOT ${IS_APP}) AND (NOT "${_H_FILES}" STREQUAL "")) + if(LIB) if(WIN32) - qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION bin) - qt_install(TARGETS ${_TARGET} ARCHIVE DESTINATION lib) + install(FILES ${_H_FILES} DESTINATION ${MINGW_INCLUDE}/${_DIR}) else() - qt_install(TARGETS ${_TARGET} DESTINATION lib) + install(FILES ${_H_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${_DIR}) endif() + else() + install(FILES ${_H_FILES} DESTINATION include/${_DIR}) endif() - if(NOT "x${_QM_FILES}" STREQUAL "x") - qt_install(LANG ${_QM_FILES} DESTINATION lang) + endif() + if (NOT "${_TARGET}" STREQUAL "") + if(LIB) + if(WIN32) + if (${IS_APP}) + qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_BIN}) + qt_install(TARGETS ${_TARGET} DESTINATION QtBin) + else() + qt_install(TARGETS ${_TARGET} ARCHIVE DESTINATION ${MINGW_LIB}) + qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION ${MINGW_BIN}) + qt_install(TARGETS ${_TARGET} RUNTIME DESTINATION QtBin) + endif() + else() + if (${IS_APP}) + qt_install(TARGETS ${_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + else() + qt_install(TARGETS ${_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + endif() + endif() + if(NOT "x${_QM_FILES}" STREQUAL "x") + qt_install(LANG ${_QM_FILES} DESTINATION QtLang) + endif() + else() + if(${IS_APP}) + qt_install(TARGETS ${_TARGET} DESTINATION bin) + 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() + endif() + if(NOT "x${_QM_FILES}" STREQUAL "x") + qt_install(LANG ${_QM_FILES} DESTINATION lang) + endif() endif() endif() endmacro() @@ -63,11 +67,10 @@ macro(add_directories_with_include multilib_prefix) get_filename_component(_dname "${_d}" NAME) list(APPEND QT_MULTILIB_LIST ${multilib_prefix}${_dname}) list(APPEND ${inc_var} "${_d}") + list(APPEND ${inc_var} "${CMAKE_CURRENT_BINARY_DIR}/${_dname}") endforeach() - foreach(_d ${DIRS}) - include_directories(${_d}) - endforeach() + include_directories(${${inc_var}}) foreach(_d ${DIRS}) add_subdirectory(${_d}) endforeach() diff --git a/cd_utils/CMakeLists.txt b/cd_utils/CMakeLists.txt index 9ac1c9b..f1c6a5d 100644 --- a/cd_utils/CMakeLists.txt +++ b/cd_utils/CMakeLists.txt @@ -6,6 +6,8 @@ file(GLOB CPPS_UTILS "cdutils_*.cpp") file(GLOB HDRS_UTILS "cdutils_*.h") add_library(${PROJECT_NAME} SHARED ${CPPS_UTILS} ${HDRS_UTILS}) target_link_libraries(${PROJECT_NAME} ${PIP_LIBRARY}) +generate_export_header(${PROJECT_NAME}) +list(APPEND HDRS_UTILS "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_export.h") add_executable(cdutilstest "cdutilstest.cpp" "cdtest.h") target_link_libraries(cdutilstest ${PIP_LIBRARY} ${PROJECT_NAME}) diff --git a/cd_utils/cdutils_c.h b/cd_utils/cdutils_c.h index 543f58c..a517e8c 100644 --- a/cd_utils/cdutils_c.h +++ b/cd_utils/cdutils_c.h @@ -21,12 +21,13 @@ #define CDUTILS_C_H #include "cdutils_interface.h" +#include "cd_utils_export.h" namespace CDUtils { -class CInterface: public Interface +class CD_UTILS_EXPORT CInterface: public Interface { PIOBJECT_SUBCLASS(CInterface, Interface) public: @@ -40,6 +41,6 @@ public: } -extern CDUtils::CInterface C; +extern CD_UTILS_EXPORT CDUtils::CInterface C; #endif // CDUTILS_C_H diff --git a/cd_utils/cdutils_core.h b/cd_utils/cdutils_core.h index ad1a780..a0d4e79 100644 --- a/cd_utils/cdutils_core.h +++ b/cd_utils/cdutils_core.h @@ -24,6 +24,7 @@ #include "cdutils_protocol.h" #include "piconnection.h" #include "pidatatransfer.h" +#include "cd_utils_export.h" namespace CDUtils { @@ -31,7 +32,7 @@ namespace CDUtils { class CDCore; -class __Core_Initializer__ { +class CD_UTILS_EXPORT __Core_Initializer__ { public: __Core_Initializer__(); ~__Core_Initializer__(); @@ -40,7 +41,7 @@ public: }; -class CDCore: public PIObject +class CD_UTILS_EXPORT CDCore: public PIObject { PIOBJECT(CDUtils::CDCore) friend class __Core_Initializer__; diff --git a/cd_utils/cdutils_interface.h b/cd_utils/cdutils_interface.h index 7465e05..635ed1d 100644 --- a/cd_utils/cdutils_interface.h +++ b/cd_utils/cdutils_interface.h @@ -22,6 +22,7 @@ #include "cdutils_types.h" #include "piobject.h" +#include "cd_utils_export.h" namespace CDUtils { @@ -29,7 +30,7 @@ namespace CDUtils { class CDCore; -class Interface: public PIObject +class CD_UTILS_EXPORT Interface: public PIObject { PIOBJECT(CDUtils::Interface) public: diff --git a/cd_utils/cdutils_k.h b/cd_utils/cdutils_k.h index 49bb247..a3190f1 100644 --- a/cd_utils/cdutils_k.h +++ b/cd_utils/cdutils_k.h @@ -21,12 +21,13 @@ #define CDUTILS_K_H #include "cdutils_interface.h" +#include "cd_utils_export.h" namespace CDUtils { -class KInterface: public Interface +class CD_UTILS_EXPORT KInterface: public Interface { PIOBJECT_SUBCLASS(KInterface, Interface) public: @@ -41,6 +42,6 @@ public: } -extern CDUtils::KInterface K; +extern CD_UTILS_EXPORT CDUtils::KInterface K; #endif // CDUTILS_K_H diff --git a/cd_utils/cdutils_m.h b/cd_utils/cdutils_m.h index 0e809d3..2585b66 100644 --- a/cd_utils/cdutils_m.h +++ b/cd_utils/cdutils_m.h @@ -21,12 +21,13 @@ #define CDUTILS_M_H #include "cdutils_interface.h" +#include "cd_utils_export.h" namespace CDUtils { -class MInterface: public Interface +class CD_UTILS_EXPORT MInterface: public Interface { PIOBJECT_SUBCLASS(MInterface, Interface) public: @@ -50,6 +51,6 @@ private: } -extern CDUtils::MInterface M; +extern CD_UTILS_EXPORT CDUtils::MInterface M; #endif // CDUTILS_M_H diff --git a/cd_utils/cdutils_parser.h b/cd_utils/cdutils_parser.h index deee7ae..4b23fa3 100644 --- a/cd_utils/cdutils_parser.h +++ b/cd_utils/cdutils_parser.h @@ -20,6 +20,7 @@ #ifndef CDUTILS_PARSER_H #define CDUTILS_PARSER_H +#include "cd_utils_export.h" class PIIODevice; @@ -29,7 +30,7 @@ class CDSection; namespace CDParser { -CDSection parse(PIIODevice * d, int cdsection_type); +CD_UTILS_EXPORT CDSection parse(PIIODevice * d, int cdsection_type); } diff --git a/cd_utils/cdutils_protocol.h b/cd_utils/cdutils_protocol.h index f47cf97..c9b541c 100644 --- a/cd_utils/cdutils_protocol.h +++ b/cd_utils/cdutils_protocol.h @@ -20,7 +20,8 @@ #ifndef CDUTILS_PROTOCOL_H #define CDUTILS_PROTOCOL_H -#include "pibytearray.h" +#include "pistring.h" +#include "cd_utils_export.h" namespace CDUtils { @@ -48,12 +49,12 @@ namespace CDUtils { # pragma pack(push,1) - struct PacketHeader { + struct CD_UTILS_EXPORT PacketHeader { int type; // CDPacketType int session_id; }; - struct PacketKDirectChange { + struct CD_UTILS_EXPORT PacketKDirectChange { PIDeque path; PIString value; }; diff --git a/cd_utils/cdutils_types.h b/cd_utils/cdutils_types.h index 7f1c4a1..299e4a9 100644 --- a/cd_utils/cdutils_types.h +++ b/cd_utils/cdutils_types.h @@ -23,6 +23,7 @@ #include "pistring.h" #include "pimap.h" #include "pivariant.h" +#include "cd_utils_export.h" class PIIODevice; class PIEvaluator; @@ -47,7 +48,7 @@ enum MessageType { typedef PIFlags UpdateModeFlags; -class CDType { +class CD_UTILS_EXPORT CDType { friend class CDSection; friend class CDCore; friend class Interface; @@ -112,7 +113,7 @@ protected: }; -class CDSection { +class CD_UTILS_EXPORT CDSection { friend class CDCore; friend class Interface; friend class XInterface; diff --git a/cd_utils/cdutils_x.h b/cd_utils/cdutils_x.h index f53fc67..b0a8e3c 100644 --- a/cd_utils/cdutils_x.h +++ b/cd_utils/cdutils_x.h @@ -21,12 +21,13 @@ #define CDUTILS_X_H #include "cdutils_interface.h" +#include "cd_utils_export.h" namespace CDUtils { -class XInterface: public Interface +class CD_UTILS_EXPORT XInterface: public Interface { PIOBJECT_SUBCLASS(XInterface, Interface) public: @@ -51,6 +52,6 @@ public: } -extern CDUtils::XInterface X; +extern CD_UTILS_EXPORT CDUtils::XInterface X; #endif // CDUTILS_X_H diff --git a/piqt/CMakeLists.txt b/piqt/CMakeLists.txt index 27028b2..9366a34 100644 --- a/piqt/CMakeLists.txt +++ b/piqt/CMakeLists.txt @@ -9,9 +9,17 @@ set(_PIQt_DOMAIN org.SHS) if(NOT DEFINED BUILD_NUMBER) set(BUILD_NUMBER 9999) endif() -set(PIQt_LIB_TYPE SHARED) -set(QAD_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/piqt_version.h") +include(QADMacros) + +if(STATIC_LIB) + set(PIQt_LIB_TYPE STATIC) + add_definitions(-DPIQt_STATIC_DEFINE) +else() + set(PIQt_LIB_TYPE SHARED) +endif() + +set(PIQt_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/piqt_version.h") set_version(PIQt MAJOR "${_PIQt_MAJOR}" MINOR "${_PIQt_MINOR}" @@ -23,8 +31,6 @@ 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") @@ -42,6 +48,7 @@ if (UTILS) add_subdirectory(utils) endif() + set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) set(piqt_includes ${piqt_includes} PARENT_SCOPE) if (LIB) diff --git a/piqt/libs/core/piqt.h b/piqt/libs/core/piqt.h index 002b9e0..b30171f 100644 --- a/piqt/libs/core/piqt.h +++ b/piqt/libs/core/piqt.h @@ -29,13 +29,14 @@ #if QT_VERSION >= 0x050200 # include "pigeoposition.h" #endif +#include "piqt_export.h" class QGeoCoordinate; -const QVariant PI2QVariant(const PIVariant & v); -const PIVariant Q2PIVariant(const QVariant & v); +PIQT_EXPORT const QVariant PI2QVariant(const PIVariant & v); +PIQT_EXPORT const PIVariant Q2PIVariant(const QVariant & v); //inline const QString PI2QString(const PIString & v) {return QString::fromLocal8Bit(v.data());} inline const QString PI2QString(const PIString & v) {return QString::fromUtf8(v.dataUTF8());} @@ -124,20 +125,20 @@ inline PropertyStorage PI2QPropertyStorage(const PIPropertyStorage & props) { } -const QAD::Enum PI2QADEnum(const PIVariantTypes::Enum & el); -const QAD::File PI2QADFile(const PIVariantTypes::File & v); -const QAD::Dir PI2QADDir(const PIVariantTypes::Dir & v); -const QAD::IODevice PI2QADIODevice(const PIVariantTypes::IODevice & v); -const PIVariantTypes::Enum QAD2PIEnum(const QAD::Enum & el); -const PIVariantTypes::File QAD2PIFile(const QAD::File & v); -const PIVariantTypes::Dir QAD2PIDir(const QAD::Dir & v); -const PIVariantTypes::IODevice QAD2PIIODevice(const QAD::IODevice & v); +PIQT_EXPORT const QAD::Enum PI2QADEnum(const PIVariantTypes::Enum & el); +PIQT_EXPORT const QAD::File PI2QADFile(const PIVariantTypes::File & v); +PIQT_EXPORT const QAD::Dir PI2QADDir(const PIVariantTypes::Dir & v); +PIQT_EXPORT const QAD::IODevice PI2QADIODevice(const PIVariantTypes::IODevice & v); +PIQT_EXPORT const PIVariantTypes::Enum QAD2PIEnum(const QAD::Enum & el); +PIQT_EXPORT const PIVariantTypes::File QAD2PIFile(const QAD::File & v); +PIQT_EXPORT const PIVariantTypes::Dir QAD2PIDir(const QAD::Dir & v); +PIQT_EXPORT const PIVariantTypes::IODevice QAD2PIIODevice(const QAD::IODevice & v); //inline const PIVariant QString2PIVariant(const QString & v) {return PIVariant::readFromString(QString2PIString(v));} #if QT_VERSION >= 0x050200 -const QGeoCoordinate PI2QGeoPosition(const PIGeoPosition & v); -const PIGeoPosition Q2PIGeoPosition(const QGeoCoordinate & v); +PIQT_EXPORT const QGeoCoordinate PI2QGeoPosition(const PIGeoPosition & v); +PIQT_EXPORT const PIGeoPosition Q2PIGeoPosition(const QGeoCoordinate & v); #endif template diff --git a/piqt/libs/core/qpiconnection.h b/piqt/libs/core/qpiconnection.h index 3eba8b5..7061724 100644 --- a/piqt/libs/core/qpiconnection.h +++ b/piqt/libs/core/qpiconnection.h @@ -25,8 +25,10 @@ #include "piconnection.h" #include "qpiconfig.h" #include "piqt.h" +#include "piqt_export.h" -class QPIConnection: public QObject, public PIConnection { + +class PIQT_EXPORT QPIConnection: public QObject, public PIConnection { Q_OBJECT PIOBJECT_SUBCLASS(QPIConnection, PIConnection) public: diff --git a/piqt/libs/qcd/qcd_core.h b/piqt/libs/qcd/qcd_core.h index e29d1ee..64695ff 100644 --- a/piqt/libs/qcd/qcd_core.h +++ b/piqt/libs/qcd/qcd_core.h @@ -25,12 +25,13 @@ #include #include "piobject.h" #include "cdutils_types.h" +#include "qcd_utils_export.h" class QCDCore; -class __QCore_Initializer__ { +class QCD_UTILS_EXPORT __QCore_Initializer__ { public: __QCore_Initializer__(); ~__QCore_Initializer__(); @@ -39,7 +40,7 @@ public: }; -class QCDCore: public QObject, public PIObject +class QCD_UTILS_EXPORT QCDCore: public QObject, public PIObject { Q_OBJECT PIOBJECT(QCDCore) diff --git a/piqt/libs/qcd/qcd_graphic.h b/piqt/libs/qcd/qcd_graphic.h index cc876e4..68b7fd8 100644 --- a/piqt/libs/qcd/qcd_graphic.h +++ b/piqt/libs/qcd/qcd_graphic.h @@ -23,6 +23,7 @@ #include #include #include +#include "qcd_utils_export.h" namespace CDUtils { class CDType; @@ -37,7 +38,7 @@ class Graphic; class Graphic; -class CDGraphicWidget: public QWidget { +class QCD_UTILS_EXPORT CDGraphicWidget: public QWidget { Q_OBJECT friend class CDGraphics; friend class GDockWidget; diff --git a/piqt/libs/qcd/qcd_modedialog.h b/piqt/libs/qcd/qcd_modedialog.h index c9e478b..dc57713 100644 --- a/piqt/libs/qcd/qcd_modedialog.h +++ b/piqt/libs/qcd/qcd_modedialog.h @@ -22,12 +22,13 @@ #include #include +#include "qcd_utils_export.h" namespace Ui { class QCDModeDialog; } -class QCDModeDialog: public QDialog +class QCD_UTILS_EXPORT QCDModeDialog: public QDialog { Q_OBJECT public: diff --git a/piqt/libs/qcd/qcd_model.cpp b/piqt/libs/qcd/qcd_model.cpp index d6ee620..2b1f203 100644 --- a/piqt/libs/qcd/qcd_model.cpp +++ b/piqt/libs/qcd/qcd_model.cpp @@ -309,10 +309,10 @@ int CDItemModel::columnCount(const QModelIndex &parent) const { Qt::ItemFlags CDItemModel::flags(const QModelIndex & index) const { - if (!index.isValid()) return 0; + if (!index.isValid()) return Qt::ItemFlags(); Qt::ItemFlags f = Qt::ItemIsEnabled | Qt::ItemIsSelectable; CDItem * item = getItem(index); - if (!item) return 0; + if (!item) return Qt::ItemFlags(); if (item->type_ == CDItem::ItemCDType) { CDType & t(interface->section(item->buildPath())[item->index_]); if (t.cd_type() == CDType::cdK) { diff --git a/piqt/libs/qcd/qcd_model.h b/piqt/libs/qcd/qcd_model.h index 30cc734..506f0f0 100644 --- a/piqt/libs/qcd/qcd_model.h +++ b/piqt/libs/qcd/qcd_model.h @@ -24,6 +24,7 @@ #include #include #include "pistring.h" +#include "qcd_utils_export.h" namespace CDUtils { class CDType; @@ -50,7 +51,7 @@ namespace QAD { class CDItemModel; -class CDItem { +class QCD_UTILS_EXPORT CDItem { friend class CDItemModel; friend class CDView; public: @@ -78,7 +79,7 @@ private: }; -class CDDelegate : public QStyledItemDelegate +class QCD_UTILS_EXPORT CDDelegate : public QStyledItemDelegate { Q_OBJECT public: @@ -94,7 +95,7 @@ public: }; -class CDItemModel : public QAbstractItemModel { +class QCD_UTILS_EXPORT CDItemModel : public QAbstractItemModel { Q_OBJECT friend class CDView; public: diff --git a/piqt/libs/qcd/qcd_view.h b/piqt/libs/qcd/qcd_view.h index 50faaa5..ff3d68a 100644 --- a/piqt/libs/qcd/qcd_view.h +++ b/piqt/libs/qcd/qcd_view.h @@ -20,8 +20,9 @@ #ifndef QCD_VIEW_H #define QCD_VIEW_H -#include "piobject.h" #include +#include "piobject.h" +#include "qcd_utils_export.h" namespace CDUtils { class CDType; @@ -31,7 +32,7 @@ namespace CDUtils { class CDItemModel; class QSortFilterProxyModel; -class CDView: public QTreeView, public PIObject +class QCD_UTILS_EXPORT CDView: public QTreeView, public PIObject { Q_OBJECT PIOBJECT(CDView) diff --git a/piqt/libs/widgets/piqt_connection_edit.h b/piqt/libs/widgets/piqt_connection_edit.h index 007eeea..72f198b 100644 --- a/piqt/libs/widgets/piqt_connection_edit.h +++ b/piqt/libs/widgets/piqt_connection_edit.h @@ -22,6 +22,8 @@ #include #include "piconnection.h" +#include "piqt_utils_export.h" + namespace Ui { class ConnectionEdit; @@ -31,7 +33,7 @@ class FilterItem; class DeviceItem; class SenderItem; -class ConnectionEdit: public QDialog { +class PIQT_UTILS_EXPORT ConnectionEdit: public QDialog { Q_OBJECT public: explicit ConnectionEdit(QWidget * parent = 0); diff --git a/piqt/libs/widgets/piqt_connection_edit.ui b/piqt/libs/widgets/piqt_connection_edit.ui index eb99380..afc8fb5 100644 --- a/piqt/libs/widgets/piqt_connection_edit.ui +++ b/piqt/libs/widgets/piqt_connection_edit.ui @@ -22,14 +22,20 @@ - - - QFrame::StyledPanel - - - QFrame::Raised - + + + 0 + + + 0 + + + 0 + + + 0 + @@ -268,7 +274,7 @@ Add - + :/icons/list-add.png:/icons/list-add.png @@ -282,8 +288,8 @@ Modify - - :/icons/document-save-.png:/icons/document-save-.png + + :/icons/document-save.png:/icons/document-save.png @@ -330,7 +336,16 @@ false - + + 0 + + + 0 + + + 0 + + 0 @@ -371,7 +386,16 @@ false - + + 0 + + + 0 + + + 0 + + 0 @@ -400,7 +424,16 @@ false - + + 0 + + + 0 + + + 0 + + 0 @@ -451,7 +484,16 @@ false - + + 0 + + + 0 + + + 0 + + 0 @@ -500,7 +542,16 @@ - + + 0 + + + 0 + + + 0 + + 0 @@ -535,7 +586,16 @@ false - + + 0 + + + 0 + + + 0 + + 0 @@ -622,7 +682,7 @@ Add - + :/icons/list-add.png:/icons/list-add.png @@ -636,7 +696,7 @@ Modify - + :/icons/document-save-.png:/icons/document-save-.png @@ -727,7 +787,7 @@ Add - + :/icons/list-add.png:/icons/list-add.png @@ -741,7 +801,7 @@ Modify - + :/icons/document-save-.png:/icons/document-save-.png @@ -764,7 +824,7 @@ Remove - + :/icons/edit-delete.png:/icons/edit-delete.png @@ -775,8 +835,8 @@ Clear - - :/icons/edit-clear-.png:/icons/edit-clear-.png + + :/icons/edit-clear.png:/icons/edit-clear.png @@ -840,7 +900,7 @@ - + @@ -875,22 +935,6 @@ - - lineName - editingFinished() - ConnectionEdit - recreateConnection() - - - 644 - 29 - - - 662 - -5 - - - recreateConnection() diff --git a/piqt/libs/widgets/piqt_connection_view.h b/piqt/libs/widgets/piqt_connection_view.h index 8889c78..0e6730f 100644 --- a/piqt/libs/widgets/piqt_connection_view.h +++ b/piqt/libs/widgets/piqt_connection_view.h @@ -22,13 +22,14 @@ #include "blockview.h" #include "piconnection.h" +#include "piqt_utils_export.h" const int __CV_Device = 1; const int __CV_Filter = 2; const int __CV_Sender = 3; -class DeviceItem: public BlockItem { +class PIQT_UTILS_EXPORT DeviceItem: public BlockItem { public: DeviceItem(); @@ -54,7 +55,7 @@ protected: }; -class FilterItem: public BlockItem { +class PIQT_UTILS_EXPORT FilterItem: public BlockItem { public: FilterItem(); @@ -84,7 +85,7 @@ protected: }; -class SenderItem: public BlockItem { +class PIQT_UTILS_EXPORT SenderItem: public BlockItem { public: SenderItem(); @@ -104,7 +105,7 @@ protected: }; -class ConnectionView: public BlockView { +class PIQT_UTILS_EXPORT ConnectionView: public BlockView { Q_OBJECT public: explicit ConnectionView(QWidget * parent = 0); diff --git a/piqt/libs/widgets/piqt_highlighter.h b/piqt/libs/widgets/piqt_highlighter.h index 9140c2a..67899cf 100644 --- a/piqt/libs/widgets/piqt_highlighter.h +++ b/piqt/libs/widgets/piqt_highlighter.h @@ -23,10 +23,11 @@ #include #include #include +#include "piqt_utils_export.h" class QTextDocument; -class ConfigHighlighter : public QSyntaxHighlighter +class PIQT_UTILS_EXPORT ConfigHighlighter : public QSyntaxHighlighter { Q_OBJECT public: @@ -37,7 +38,7 @@ public: private: void highlightBlock(const QString &text); - struct HighlightingRule { + struct PIQT_UTILS_EXPORT HighlightingRule { QRegExp pattern; QTextCharFormat format; }; diff --git a/piqt/libs/widgets/piqt_iodevice_edit.h b/piqt/libs/widgets/piqt_iodevice_edit.h index d9770fb..764cd6b 100644 --- a/piqt/libs/widgets/piqt_iodevice_edit.h +++ b/piqt/libs/widgets/piqt_iodevice_edit.h @@ -22,13 +22,14 @@ #include #include "qad_types.h" +#include "piqt_utils_export.h" class QLineEdit; class QToolButton; class IODeviceEditDialog; -class IODeviceEdit: public QWidget { +class PIQT_UTILS_EXPORT IODeviceEdit: public QWidget { Q_OBJECT Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) @@ -60,12 +61,14 @@ signals: }; -class __IODeviceEditRegistrator__ { +class PIQT_UTILS_EXPORT __IODeviceEditRegistrator__ { public: __IODeviceEditRegistrator__(); }; static __IODeviceEditRegistrator__ __iodeviceeditregistrator__; -void QAD_IODevice_toString(const QVariant & v, QString & r); +PIQT_UTILS_EXPORT void QAD_IODevice_toString(const QVariant & v, QString & r); + + #endif // PIQT_IODEVICE_EDIT_H diff --git a/piqt/libs/widgets/piqt_iodevice_edit_dialog.h b/piqt/libs/widgets/piqt_iodevice_edit_dialog.h index 0c846cd..0ccfa5f 100644 --- a/piqt/libs/widgets/piqt_iodevice_edit_dialog.h +++ b/piqt/libs/widgets/piqt_iodevice_edit_dialog.h @@ -23,12 +23,13 @@ #include #include "qad_types.h" #include "propertystorage.h" +#include "piqt_utils_export.h" namespace Ui { class IODeviceEditDialog; } -class IODeviceEditDialog: public QDialog { +class PIQT_UTILS_EXPORT IODeviceEditDialog: public QDialog { Q_OBJECT public: explicit IODeviceEditDialog(QWidget * parent = 0); diff --git a/qad/CMakeLists.txt b/qad/CMakeLists.txt index adb5be9..e23b647 100644 --- a/qad/CMakeLists.txt +++ b/qad/CMakeLists.txt @@ -8,36 +8,14 @@ set(_QAD_SUFFIX ) set(_QAD_COMPANY SHS) set(_QAD_DOMAIN org.SHS) -if ("x${CMAKE_MODULE_PATH}" STREQUAL "x") - set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -endif() -if (NOT LIBPROJECT) - set(_plugins_default_ 1) - if (DEFINED ANDROID_PLATFORM) - set(_plugins_default_ 0) - endif() - option(LIB "System install" 1) - option(DEBUG "Build with -g3" 0) - option(DESIGNER_PLUGINS "Build qt designer plugins" ${_plugins_default_}) - option(STATIC_LIB OFF) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall") - if (DEBUG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") - endif () -endif() - include(QADMacros) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -set(EXPORT_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/qad_export.h") - if(STATIC_LIB) set(QAD_LIB_TYPE STATIC) add_definitions(-DQAD_STATIC_DEFINE) - #message(STATUS "Building QAD static libraries") else() set(QAD_LIB_TYPE SHARED) - #message(STATUS "Building QAD shared libraries") endif() if (NOT DEFINED ANDROID_PLATFORM) @@ -90,12 +68,12 @@ file(GLOB CMAKES "cmake/*.cmake" "cmake/*.in") if (LIB) install(FILES ${CMAKES} DESTINATION ${CMAKE_ROOT}/Modules) if (WIN32) - install(FILES ${EXPORT_HEADER} DESTINATION ${MINGW_INCLUDE}/qad) + install(FILES ${QAD_VERSION_FILE} DESTINATION ${MINGW_INCLUDE}/qad) else() - install(FILES ${EXPORT_HEADER} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/qad) + install(FILES ${QAD_VERSION_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/qad) endif() else() - install(FILES ${EXPORT_HEADER} DESTINATION include/qad) + install(FILES ${QAD_VERSION_FILE} DESTINATION include/qad) endif() add_subdirectory(libs) diff --git a/qad/cmake/QADMacros.cmake b/qad/cmake/QADMacros.cmake index 7c473f2..63eb900 100644 --- a/qad/cmake/QADMacros.cmake +++ b/qad/cmake/QADMacros.cmake @@ -1,8 +1,5 @@ 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() @@ -58,6 +55,14 @@ macro(_qt_project NAME IS_APP DOMAIN _MODULES _LIBS) if(NOT STATIC_LIB) qt_target_compile_definitions(${PROJ_NAME} PRIVATE ${DOMAIN}_SHARED_DEFINE) endif() + qt_get_target(${PROJ_NAME} _some_target) + qt_get_target(${PROJ_NAME} _targets) + foreach(_t ${_targets}) + set_target_properties(${_t} PROPERTIES DEFINE_SYMBOL ${PROJ_NAME}_EXPORTS) + endforeach() + set_target_properties(${_some_target} PROPERTIES DEFINE_SYMBOL ${PROJ_NAME}_EXPORTS) + generate_export_header(${_some_target} BASE_NAME "${PROJ_NAME}") + list(APPEND out_HDR "${CMAKE_CURRENT_BINARY_DIR}/${PROJ_NAME}_export.h") endif() qt_target_link_libraries(${PROJ_NAME} ${_LIBS}) list(APPEND QT_MULTILIB_LIST ${PROJ_NAME}) diff --git a/qad/cmake/QtWraps.cmake b/qad/cmake/QtWraps.cmake index 936a8ab..b25b04d 100644 --- a/qad/cmake/QtWraps.cmake +++ b/qad/cmake/QtWraps.cmake @@ -101,6 +101,23 @@ in Qt_LANG_DIR for _LANG languages and install them to . PATH are additional search paths. You should use "set_lang()" macro before this action + + + +qt_get_target( [Qt4 | Qt5]) + +Write real Qt target name to +If Qt4 or Qt5 specified, search for this version, +otherwise returns greatest version + + + + +qt_get_targets( ) + +Write all real Qt target names to + + ]] @@ -742,3 +759,35 @@ macro(qt_install_lang _NAME) endif() endforeach() endmacro() + + +macro(qt_get_target _NAME _OUT) + set(${_OUT}) + set(_ver) + foreach(_i ${ARGN}) + foreach(_v ${_QT_VERSIONS_}) + if ("x${_i}" STREQUAL "xQt${_v}") + set(_ver ${_v}) + break() + endif() + endforeach() + if (NOT "x${_ver}" STREQUAL "x") + break() + endif() + endforeach() + foreach(_v ${_QT_VERSIONS_}) + if (LOCAL_FOUND${_v} AND (("x${_ver}" STREQUAL "x") OR ((NOT "x${_ver}" STREQUAL "x") AND ("x${_ver}" STREQUAL "x${_v}")))) + set(${_OUT} ${_NAME}${TARGET_SUFFIX_Qt${_v}}) + endif() + endforeach() +endmacro() + + +macro(qt_get_targets _NAME _OUT) + set(${_OUT}) + foreach(_v ${_QT_VERSIONS_}) + if (LOCAL_FOUND${_v}) + list(APPEND ${_OUT} ${_NAME}${TARGET_SUFFIX_Qt${_v}}) + endif() + endforeach() +endmacro() diff --git a/qad/libs/application/aboutwindow.h b/qad/libs/application/aboutwindow.h index 39e2346..7837cf7 100644 --- a/qad/libs/application/aboutwindow.h +++ b/qad/libs/application/aboutwindow.h @@ -20,8 +20,9 @@ #ifndef ABOUTWINDOW_H #define ABOUTWINDOW_H -#include "qad_export.h" #include +#include "qad_application_export.h" + #define ADD_ABOUT_VERSION(lib) \ { \ @@ -47,7 +48,7 @@ namespace Ui { class AboutWindow; } -class QAD_EXPORT AboutWindow: public QDialog +class QAD_APPLICATION_EXPORT AboutWindow: public QDialog { Q_OBJECT typedef QPair SSPair; diff --git a/qad/libs/application/edockwidget.h b/qad/libs/application/edockwidget.h index 87dc2fe..5c5807c 100644 --- a/qad/libs/application/edockwidget.h +++ b/qad/libs/application/edockwidget.h @@ -27,10 +27,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_application_export.h" -class QAD_EXPORT EDockWidget: public QDockWidget +class QAD_APPLICATION_EXPORT EDockWidget: public QDockWidget { Q_OBJECT public: diff --git a/qad/libs/application/emainwindow.h b/qad/libs/application/emainwindow.h index 87faa61..2d17ae8 100644 --- a/qad/libs/application/emainwindow.h +++ b/qad/libs/application/emainwindow.h @@ -32,9 +32,10 @@ #include #include "session_manager.h" #include "ribbon.h" +#include "qad_application_export.h" -class QAD_EXPORT UAction: public QAction { +class QAD_APPLICATION_EXPORT UAction: public QAction { Q_OBJECT public: UAction(int ind,const QString & text, QObject * parent): QAction(text, parent) { @@ -67,7 +68,7 @@ signals: }; -class QAD_EXPORT EMainWindow: public QMainWindow +class QAD_APPLICATION_EXPORT EMainWindow: public QMainWindow { Q_OBJECT Q_PROPERTY(int maxRecentItems READ maxRecentItems WRITE setMaxRecentItems) diff --git a/qad/libs/application/etabwidget.h b/qad/libs/application/etabwidget.h index bf0346d..f1d8aeb 100644 --- a/qad/libs/application/etabwidget.h +++ b/qad/libs/application/etabwidget.h @@ -30,10 +30,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_application_export.h" -class QAD_EXPORT ETabWidget: public QTabWidget +class QAD_APPLICATION_EXPORT ETabWidget: public QTabWidget { Q_OBJECT public: @@ -51,7 +51,7 @@ private: void tabRemoved(int) {emit countChanged();} void changeEvent(QEvent * e); - struct TabButton { + struct QAD_APPLICATION_EXPORT TabButton { TabButton(int r, const QIcon & i, const QString & t) {role = r; icon = i; visible = true; srcToolTip = t; toolTip = QApplication::translate("MainWindow", t.toUtf8(), 0/*, QCoreApplication::UnicodeUTF8*/);} int role; bool visible; diff --git a/qad/libs/application/historyview.h b/qad/libs/application/historyview.h index f46d0a4..5c04c17 100644 --- a/qad/libs/application/historyview.h +++ b/qad/libs/application/historyview.h @@ -22,10 +22,10 @@ #include #include -#include "qad_export.h" +#include "qad_application_export.h" -class QAD_EXPORT HistoryView: public QListWidget +class QAD_APPLICATION_EXPORT HistoryView: public QListWidget { Q_OBJECT Q_PROPERTY(bool active READ isActive WRITE setActive) @@ -46,7 +46,7 @@ public: void registerAction(int action, const QString & text, const QImage & icon = QImage()); private: - struct Action { + struct QAD_APPLICATION_EXPORT Action { Action(int i = -1, const QString & t = QString(), const QImage & c = QImage()): id(i), text(t) { QPixmap px = QPixmap::fromImage(c); icon.addPixmap(px, QIcon::Active); @@ -58,7 +58,7 @@ private: QString text; QIcon icon; }; - struct Entry { + struct QAD_APPLICATION_EXPORT Entry { Entry(int a = -1, const QByteArray & c = QByteArray()): action(a), command(c) {} int action; QByteArray command; diff --git a/qad/libs/application/logview.h b/qad/libs/application/logview.h index 82880cd..b882c0a 100644 --- a/qad/libs/application/logview.h +++ b/qad/libs/application/logview.h @@ -30,7 +30,7 @@ # include typedef QRegExp QRegularExpression; #endif -#include "qad_export.h" +#include "qad_application_export.h" class QTextEdit; class QTextBlock; @@ -40,7 +40,7 @@ namespace Ui { class LogView; } -class QAD_EXPORT LogView: public QWidget +class QAD_APPLICATION_EXPORT LogView: public QWidget { Q_OBJECT Q_PROPERTY(bool filterVisible READ isFilterVisible WRITE setFilterVisible) @@ -75,7 +75,7 @@ public: void addText(const QString & text, bool insert_newline = true); private: - struct Category { + struct QAD_APPLICATION_EXPORT Category { Category(); void makeIcon(QSize size, QSize size_icon); QString label; diff --git a/qad/libs/application/qsingleapplication.h b/qad/libs/application/qsingleapplication.h index c52ea95..3c6163b 100644 --- a/qad/libs/application/qsingleapplication.h +++ b/qad/libs/application/qsingleapplication.h @@ -22,10 +22,10 @@ #include #include -#include "qad_export.h" +#include "qad_application_export.h" -class QAD_EXPORT QSingleApplication: public QThread +class QAD_APPLICATION_EXPORT QSingleApplication: public QThread { Q_OBJECT public: diff --git a/qad/libs/application/ribbon.h b/qad/libs/application/ribbon.h index d189e72..669f8b5 100644 --- a/qad/libs/application/ribbon.h +++ b/qad/libs/application/ribbon.h @@ -31,9 +31,10 @@ #include #include #include "etabwidget.h" +#include "qad_application_export.h" -class QAD_EXPORT Ribbon: public QToolBar +class QAD_APPLICATION_EXPORT Ribbon: public QToolBar { Q_OBJECT public: diff --git a/qad/libs/blockview/alignedtextitem.h b/qad/libs/blockview/alignedtextitem.h index 54c846c..0dbf156 100644 --- a/qad/libs/blockview/alignedtextitem.h +++ b/qad/libs/blockview/alignedtextitem.h @@ -24,10 +24,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_blockview_export.h" -class QAD_EXPORT AlignedTextItem: public QGraphicsItem { +class QAD_BLOCKVIEW_EXPORT AlignedTextItem: public QGraphicsItem { public: AlignedTextItem(QGraphicsItem * parent = 0); AlignedTextItem(const QString & text, QGraphicsItem * parent = 0); diff --git a/qad/libs/blockview/blockbase.h b/qad/libs/blockview/blockbase.h index a92472e..0d13ea4 100644 --- a/qad/libs/blockview/blockbase.h +++ b/qad/libs/blockview/blockbase.h @@ -29,6 +29,7 @@ #include #include #include "qad_types.h" +#include "qad_blockview_export.h" /// data: @@ -69,11 +70,11 @@ enum BlockviewItemType { bvitItemText, }; -QAD_EXPORT QDataStream & operator <<(QDataStream & s, const QGraphicsItem * item); -QAD_EXPORT QDataStream & operator >>(QDataStream & s, QGraphicsItem *& item); +QAD_BLOCKVIEW_EXPORT QDataStream & operator <<(QDataStream & s, const QGraphicsItem * item); +QAD_BLOCKVIEW_EXPORT QDataStream & operator >>(QDataStream & s, QGraphicsItem *& item); -class QAD_EXPORT BlockItemBase: public QObject +class QAD_BLOCKVIEW_EXPORT BlockItemBase: public QObject { Q_OBJECT Q_ENUMS(Action) diff --git a/qad/libs/blockview/blockbusitem.h b/qad/libs/blockview/blockbusitem.h index 54a5e45..773874a 100644 --- a/qad/libs/blockview/blockbusitem.h +++ b/qad/libs/blockview/blockbusitem.h @@ -21,9 +21,10 @@ #define BLOCKBUSITEM_H #include "blockitem.h" +#include "qad_blockview_export.h" -class QAD_EXPORT BlockBusItem: public QGraphicsObject, public PropertyStorage { +class QAD_BLOCKVIEW_EXPORT BlockBusItem: public QGraphicsObject, public PropertyStorage { Q_OBJECT Q_INTERFACES(QGraphicsItem) Q_PROPERTY(double pointSize READ pointSize WRITE setPointSize DESIGNABLE false SCRIPTABLE false) diff --git a/qad/libs/blockview/blockeditor.h b/qad/libs/blockview/blockeditor.h index 5957102..2707df4 100644 --- a/qad/libs/blockview/blockeditor.h +++ b/qad/libs/blockview/blockeditor.h @@ -24,6 +24,7 @@ #include #include #include "blockitem.h" +#include "qad_blockview_export.h" namespace Ui { @@ -31,7 +32,7 @@ namespace Ui { } -class QAD_EXPORT BlockEditor : public QWidget +class QAD_BLOCKVIEW_EXPORT BlockEditor : public QWidget { Q_OBJECT Q_PROPERTY(bool editorMode READ editorMode WRITE setEditorMode) @@ -84,7 +85,7 @@ private: -class QAD_EXPORT PinAlignDelegate: public QStyledItemDelegate { +class QAD_BLOCKVIEW_EXPORT PinAlignDelegate: public QStyledItemDelegate { Q_OBJECT public: PinAlignDelegate(QObject * parent = 0): QStyledItemDelegate(parent) {} @@ -95,7 +96,7 @@ public: }; -class QAD_EXPORT PinBusDelegate: public QStyledItemDelegate { +class QAD_BLOCKVIEW_EXPORT PinBusDelegate: public QStyledItemDelegate { Q_OBJECT public: PinBusDelegate(QObject * parent = 0): QStyledItemDelegate(parent) {} diff --git a/qad/libs/blockview/blockitem.h b/qad/libs/blockview/blockitem.h index 53d16b8..685ef39 100644 --- a/qad/libs/blockview/blockitem.h +++ b/qad/libs/blockview/blockitem.h @@ -20,11 +20,12 @@ #ifndef BLOCKITEM_H #define BLOCKITEM_H -#include "blockitempin.h" #include +#include "blockitempin.h" +#include "qad_blockview_export.h" -class QAD_EXPORT BlockItem: public QGraphicsObject, public PropertyStorage +class QAD_BLOCKVIEW_EXPORT BlockItem: public QGraphicsObject, public PropertyStorage { friend class BlockView; friend class BlockItemPin; diff --git a/qad/libs/blockview/blockitempin.h b/qad/libs/blockview/blockitempin.h index 29e99d9..e358e73 100644 --- a/qad/libs/blockview/blockitempin.h +++ b/qad/libs/blockview/blockitempin.h @@ -32,13 +32,14 @@ #include #include "blockbase.h" #include "alignedtextitem.h" +#include "qad_blockview_export.h" class BlockItem; class BlockBusItem; -class QAD_EXPORT BlockItemPin: public QGraphicsObject, public PropertyStorage +class QAD_BLOCKVIEW_EXPORT BlockItemPin: public QGraphicsObject, public PropertyStorage { friend class BlockView; friend class BlockItem; diff --git a/qad/libs/blockview/blockview.h b/qad/libs/blockview/blockview.h index 0602ced..0f7c4f5 100644 --- a/qad/libs/blockview/blockview.h +++ b/qad/libs/blockview/blockview.h @@ -30,6 +30,7 @@ #include #include "blockviewwavetrace.h" #include "blockbusitem.h" +#include "qad_blockview_export.h" Q_DECLARE_METATYPE(BlockItem*) @@ -37,7 +38,7 @@ Q_DECLARE_METATYPE(BlockItemPin*) Q_DECLARE_METATYPE(BlockBusItem*) -class QAD_EXPORT BlockView: public QGraphicsView +class QAD_BLOCKVIEW_EXPORT BlockView: public QGraphicsView { Q_OBJECT Q_ENUMS(SelectionMode) diff --git a/qad/libs/blockview/blockviewwavetrace.h b/qad/libs/blockview/blockviewwavetrace.h index c8d0f90..c7c48cb 100644 --- a/qad/libs/blockview/blockviewwavetrace.h +++ b/qad/libs/blockview/blockviewwavetrace.h @@ -21,9 +21,10 @@ #define BLOCKVIEWWAVETRACE_H #include "blockitem.h" +#include "qad_blockview_export.h" -class QAD_EXPORT BlockViewWavetrace { +class QAD_BLOCKVIEW_EXPORT BlockViewWavetrace { public: BlockViewWavetrace(int width = 1, int height = 1); @@ -52,7 +53,7 @@ public: const QVector & path() const; private: - struct Cell { + struct QAD_BLOCKVIEW_EXPORT Cell { Cell(short v = Empty): value(v), direction(0) {} short value; short direction; diff --git a/qad/libs/blockview/drawtools.h b/qad/libs/blockview/drawtools.h index 51e8db9..2746aaf 100644 --- a/qad/libs/blockview/drawtools.h +++ b/qad/libs/blockview/drawtools.h @@ -27,12 +27,13 @@ #include #include #include "blockview.h" +#include "qad_blockview_export.h" class QComboBox; -class QAD_EXPORT _DTSizeItem: public QGraphicsObject +class QAD_BLOCKVIEW_EXPORT _DTSizeItem: public QGraphicsObject { Q_OBJECT public: @@ -72,7 +73,7 @@ namespace Ui { } -class QAD_EXPORT DrawTools: public QWidget +class QAD_BLOCKVIEW_EXPORT DrawTools: public QWidget { Q_OBJECT Q_PROPERTY(bool resizeHandlesEnabled READ isResizeHandlesEnabled WRITE setResizeHandlesEnabled) diff --git a/qad/libs/doc/markdown.h b/qad/libs/doc/markdown.h index 2fde74c..5d48ed5 100644 --- a/qad/libs/doc/markdown.h +++ b/qad/libs/doc/markdown.h @@ -21,10 +21,10 @@ #define QAD_MARKDOWN_H #include -#include "qad_export.h" +#include "qad_doc_export.h" -QAD_EXPORT QString md2html(const QByteArray & src); +QAD_DOC_EXPORT QString md2html(const QByteArray & src); #endif // QAD_MARKDOWN_H diff --git a/qad/libs/graphic/graphic.h b/qad/libs/graphic/graphic.h index 125758c..199cf54 100644 --- a/qad/libs/graphic/graphic.h +++ b/qad/libs/graphic/graphic.h @@ -35,6 +35,7 @@ #include #include "graphic_conf.h" #include "evalspinbox.h" +#include "qad_graphic_export.h" namespace Ui { @@ -48,7 +49,7 @@ class UGLWidget; Q_DECLARE_METATYPE(QVector) -class QAD_EXPORT Graphic: public QFrame +class QAD_GRAPHIC_EXPORT Graphic: public QFrame { Q_OBJECT Q_FLAGS(Buttons) @@ -448,7 +449,7 @@ inline QDataStream & operator <<(QDataStream & s, const Graphic::Graduation & v) inline QDataStream & operator >>(QDataStream & s, Graphic::Graduation & v) {s >> *((int*)(&v)); return s;} -class __GraphicRegistrator__ { +class QAD_GRAPHIC_EXPORT __GraphicRegistrator__ { public: __GraphicRegistrator__() { qRegisterMetaType >("QVector"); diff --git a/qad/libs/graphic/graphic_conf.h b/qad/libs/graphic/graphic_conf.h index 5a36486..b88b3a7 100644 --- a/qad/libs/graphic/graphic_conf.h +++ b/qad/libs/graphic/graphic_conf.h @@ -24,7 +24,7 @@ #include #include #include -#include "qad_export.h" +#include "qad_graphic_export.h" namespace Ui { @@ -32,7 +32,7 @@ namespace Ui { } -struct QAD_EXPORT GraphicType { +struct QAD_GRAPHIC_EXPORT GraphicType { GraphicType(QString name_ = "y(x)", QColor color = Qt::red, Qt::PenStyle style = Qt::SolidLine, double width = 0., bool visible_ = true) { pen.setColor(color); pen.setStyle(style); @@ -73,14 +73,14 @@ inline QDataStream & operator <<(QDataStream & s, const GraphicType & v) {s << v inline QDataStream & operator >>(QDataStream & s, GraphicType & v) {s >> v.name >> v.pen >> v.fill_color >> v.lines >> v.points >> v.fill >> v.pointWidth >> v.visible; return s;} -class QAD_EXPORT GraphicConf: public QDialog +class QAD_GRAPHIC_EXPORT GraphicConf: public QDialog { Q_OBJECT friend class Graphic; public: explicit GraphicConf(QVector & graphics_, QWidget * parent = 0); - struct GraphicItem { + struct QAD_GRAPHIC_EXPORT GraphicItem { QString name; QIcon icon; }; diff --git a/qad/libs/graphic/uglwidget.h b/qad/libs/graphic/uglwidget.h index 859070b..9a20903 100644 --- a/qad/libs/graphic/uglwidget.h +++ b/qad/libs/graphic/uglwidget.h @@ -13,9 +13,10 @@ typedef QGLWidget __GLWidget__; # define GL_MULTISAMPLE 0x809D # endif #endif +#include "qad_graphic_export.h" -class UGLWidget: public __GLWidget__ +class QAD_GRAPHIC_EXPORT UGLWidget: public __GLWidget__ { Q_OBJECT public: diff --git a/qad/libs/graphic/uwidget.h b/qad/libs/graphic/uwidget.h index e7f4151..1c61ad2 100644 --- a/qad/libs/graphic/uwidget.h +++ b/qad/libs/graphic/uwidget.h @@ -6,9 +6,10 @@ #include #include #include +#include "qad_graphic_export.h" -class UWidget: public QWidget +class QAD_GRAPHIC_EXPORT UWidget: public QWidget { Q_OBJECT public: diff --git a/qad/libs/sql_table/sql_record_widget.h b/qad/libs/sql_table/sql_record_widget.h index 4c28b55..1e0eb91 100644 --- a/qad/libs/sql_table/sql_record_widget.h +++ b/qad/libs/sql_table/sql_record_widget.h @@ -26,10 +26,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_sql_table_export.h" -class QAD_EXPORT SQLRecordWidget: public QWidget { +class QAD_SQL_TABLE_EXPORT SQLRecordWidget: public QWidget { Q_OBJECT public: SQLRecordWidget(QWidget * parent = 0); @@ -64,7 +64,7 @@ protected: void updateWidgets(); QVariant::Type fieldType(const QSqlField & f); - struct RelationSrc { + struct QAD_SQL_TABLE_EXPORT RelationSrc { RelationSrc(const QString & v0 = QString(), const QString & v1 = QString(), const QString & v2 = QString(), const QString & v3 = QString()): tcol(v0), table(v1), diff --git a/qad/libs/sql_table/sql_table_widget.h b/qad/libs/sql_table/sql_table_widget.h index 1bf1ced..d01cf10 100644 --- a/qad/libs/sql_table/sql_table_widget.h +++ b/qad/libs/sql_table/sql_table_widget.h @@ -45,9 +45,10 @@ #include #include #include "qpiconfig.h" +#include "qad_sql_table_export.h" -struct QAD_EXPORT ColumnProperties { +struct QAD_SQL_TABLE_EXPORT ColumnProperties { enum DataType {Unknown, Int, Float, Chars, Text, Binary, Date, Time, DateTime}; ColumnProperties(const QString & table_, const QString & type_, const QString & name_, const QString & def_, bool auto_, bool prim_, bool option_); bool isRelation() const {return (!relation_key.isEmpty() && !relation_column.isEmpty());} @@ -77,7 +78,7 @@ struct QAD_EXPORT ColumnProperties { -struct QAD_EXPORT TableColumns { +struct QAD_SQL_TABLE_EXPORT TableColumns { int mapColumn(int abs_ind) const {if (abs_ind <= 0 || abs_ind >= column_indexes.size() + 1) return 0; return column_indexes[abs_ind - 1];} QVector column_indexes; QList columns; @@ -86,7 +87,7 @@ struct QAD_EXPORT TableColumns { -class QAD_EXPORT SQLQueryModel: public QSqlQueryModel { +class QAD_SQL_TABLE_EXPORT SQLQueryModel: public QSqlQueryModel { Q_OBJECT public: explicit SQLQueryModel(QString & t, QString & conn, QList & cp, QVector & ci, QObject* parent = 0): QSqlQueryModel(parent), table_(t), column_props(cp), column_indexes(ci), conn_name(conn) {;} @@ -107,7 +108,7 @@ signals: -class QAD_EXPORT SQLUniEdit: public QWidget { +class QAD_SQL_TABLE_EXPORT SQLUniEdit: public QWidget { Q_OBJECT public: explicit SQLUniEdit(const ColumnProperties & prop, const QString & conn_name, QWidget * parent = 0); @@ -147,7 +148,7 @@ signals: -class QAD_EXPORT SQLNewEdit: public QWidget { +class QAD_SQL_TABLE_EXPORT SQLNewEdit: public QWidget { Q_OBJECT friend class SQLTableWidget; public: @@ -166,7 +167,7 @@ private: -class QAD_EXPORT SQLFilterEdit: public QWidget { +class QAD_SQL_TABLE_EXPORT SQLFilterEdit: public QWidget { Q_OBJECT friend class SQLTableWidget; public: @@ -190,7 +191,7 @@ signals: -class QAD_EXPORT SQLItemDelegate: public QStyledItemDelegate { +class QAD_SQL_TABLE_EXPORT SQLItemDelegate: public QStyledItemDelegate { Q_OBJECT public: explicit SQLItemDelegate(QList & cp, QVector & ci, bool & ro, const QString & conn_name, QObject * parent = 0); @@ -216,7 +217,7 @@ namespace Ui { } -class QAD_EXPORT SQLTableWidget: public QWidget +class QAD_SQL_TABLE_EXPORT SQLTableWidget: public QWidget { Q_OBJECT Q_PROPERTY(QString tableName READ tableName WRITE setTableName) diff --git a/qad/libs/touch_widgets/touchbuttframe.h b/qad/libs/touch_widgets/touchbuttframe.h index 32c8ca3..9f52eac 100644 --- a/qad/libs/touch_widgets/touchbuttframe.h +++ b/qad/libs/touch_widgets/touchbuttframe.h @@ -24,9 +24,10 @@ #include #include #include "touchbutton.h" +#include "qad_touch_widgets_export.h" -class QAD_EXPORT TouchButtFrame: public QFrame +class QAD_TOUCH_WIDGETS_EXPORT TouchButtFrame: public QFrame { Q_OBJECT Q_PROPERTY(QColor colorYes READ colorYes WRITE setColorYes) diff --git a/qad/libs/touch_widgets/touchbutton.h b/qad/libs/touch_widgets/touchbutton.h index 3308894..56bd0fd 100644 --- a/qad/libs/touch_widgets/touchbutton.h +++ b/qad/libs/touch_widgets/touchbutton.h @@ -25,10 +25,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_touch_widgets_export.h" -class QAD_EXPORT TouchButton: public QToolButton +class QAD_TOUCH_WIDGETS_EXPORT TouchButton: public QToolButton { Q_OBJECT Q_ENUMS(State) @@ -53,7 +53,7 @@ public: TouchButton(int id, const QString & text = QString()); ~TouchButton(); - enum State {Gray, Yes, No}; + enum State {Gray, Yes, No}; int clickID() const {return id_click;} int yesID() const {return id_yes;} @@ -77,7 +77,7 @@ public: private: void timerEvent(QTimerEvent * e); void mousePressEvent(QMouseEvent * e); - void mouseReleaseEvent(QMouseEvent * e); + void mouseReleaseEvent(QMouseEvent * e); void init(); void animateColor(const QColor & tc); diff --git a/qad/libs/touch_widgets/touchslider.h b/qad/libs/touch_widgets/touchslider.h index a55bb8d..29ab8c3 100644 --- a/qad/libs/touch_widgets/touchslider.h +++ b/qad/libs/touch_widgets/touchslider.h @@ -22,7 +22,7 @@ #include #include -#include "qad_export.h" +#include "qad_touch_widgets_export.h" namespace Ui { @@ -30,7 +30,7 @@ namespace Ui { } -class QAD_EXPORT TouchSlider: public QGroupBox +class QAD_TOUCH_WIDGETS_EXPORT TouchSlider: public QGroupBox { Q_OBJECT Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly) diff --git a/qad/libs/utils/chunkstream.h b/qad/libs/utils/chunkstream.h index 0ade48f..0572e9f 100644 --- a/qad/libs/utils/chunkstream.h +++ b/qad/libs/utils/chunkstream.h @@ -24,10 +24,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_utils_export.h" -class QAD_EXPORT ChunkStream +class QAD_UTILS_EXPORT ChunkStream { public: enum Version { diff --git a/qad/libs/utils/propertystorage.h b/qad/libs/utils/propertystorage.h index d301dc9..99d5cf6 100644 --- a/qad/libs/utils/propertystorage.h +++ b/qad/libs/utils/propertystorage.h @@ -29,11 +29,11 @@ #include "chunkstream.h" -class QAD_EXPORT PropertyStorage { +class QAD_UTILS_EXPORT PropertyStorage { public: PropertyStorage() {} - struct Property { + struct QAD_UTILS_EXPORT Property { Property(const QString & n = QString(), const QString & c = QString(), const QVariant & v = QVariant(), int f = 0): name(n), comment(c), value(v), flags(f) {} bool toBool() const {return value.toBool();} diff --git a/qad/libs/utils/qad_locations.h b/qad/libs/utils/qad_locations.h index 3168b18..3367e99 100644 --- a/qad/libs/utils/qad_locations.h +++ b/qad/libs/utils/qad_locations.h @@ -20,8 +20,8 @@ #ifndef QAD_LOCATIONS_H #define QAD_LOCATIONS_H -#include "qad_export.h" #include +#include "qad_utils_export.h" namespace QAD { @@ -36,7 +36,7 @@ namespace QAD { //! Extension is selected by "loc": //! * ltConfig - "conf" //! * ltCache - "cache" - QAD_EXPORT QString userPath(LocationType loc, QString name = QString()); + QAD_UTILS_EXPORT QString userPath(LocationType loc, QString name = QString()); //! Returns search directories for resource "type" @@ -44,13 +44,13 @@ namespace QAD { //! * :/ on mobile platforms //! * <.app>/Resources/ on MacOS //! * /usr/share/[organizationName/]/ on Linux - QAD_EXPORT QStringList resourcePaths(QString type); + QAD_UTILS_EXPORT QStringList resourcePaths(QString type); - QAD_EXPORT void loadTranslations(QString lang = QString()); + QAD_UTILS_EXPORT void loadTranslations(QString lang = QString()); - QAD_EXPORT QStringList availableTranslations(); + QAD_UTILS_EXPORT QStringList availableTranslations(); } diff --git a/qad/libs/utils/qad_types.h b/qad/libs/utils/qad_types.h index 06f35ab..9de13b4 100644 --- a/qad/libs/utils/qad_types.h +++ b/qad/libs/utils/qad_types.h @@ -20,9 +20,9 @@ #ifndef QAD_TYPES_H #define QAD_TYPES_H -#include "propertystorage.h" -#include "qad_export.h" #include +#include "propertystorage.h" +#include "qad_utils_export.h" //! Set QCoreApplication properties from CMake "deploy_properties" //! Affect applicationName, organizationName and applicationVersion @@ -36,13 +36,13 @@ class QMetaEnum; namespace QAD { - struct QAD_EXPORT Enumerator { + struct QAD_UTILS_EXPORT Enumerator { Enumerator(int v = 0, const QString & n = QString()): value(v), name(n) {} int value; QString name; }; - struct QAD_EXPORT Enum { + struct QAD_UTILS_EXPORT Enum { Enum(const QString & n = QString()): enum_name(n) {} Enum(const QMetaEnum & meta, int selected = 0); int selectedValue() const; @@ -62,7 +62,7 @@ namespace QAD { Enum & operator <<(const QStringList & v); }; - struct QAD_EXPORT File { + struct QAD_UTILS_EXPORT File { File(const QString & p = QString(), const QString & f = QString(), bool abs = false, bool save_mode = false): file(p), filter(f), is_abs(abs), is_save(save_mode) {} QString toString() const {return file;} @@ -72,7 +72,7 @@ namespace QAD { bool is_save; }; - struct QAD_EXPORT Dir { + struct QAD_UTILS_EXPORT Dir { Dir(const QString & d = QString(), bool abs = false): dir(d), is_abs(abs) {} QString toString() const {return dir;} @@ -80,7 +80,7 @@ namespace QAD { bool is_abs; }; - struct QAD_EXPORT IODevice { + struct QAD_UTILS_EXPORT IODevice { IODevice(const QString & device_prefix = QString(), const PropertyStorage & device_properties = PropertyStorage(), int open_mode = QIODevice::ReadWrite, int device_options = 0) : prefix(device_prefix), mode(open_mode), options(device_options), props(device_properties) {} @@ -92,12 +92,12 @@ namespace QAD { PropertyStorage props; }; - struct QAD_EXPORT MathVector { + struct QAD_UTILS_EXPORT MathVector { MathVector(const QVector & vec = QVector()) {v = vec;} QVector v; }; - struct QAD_EXPORT MathMatrix { + struct QAD_UTILS_EXPORT MathMatrix { MathMatrix(const QVector > & mat = QVector > ()) {m = mat;} QVector > m; // [Row][Column] }; @@ -140,7 +140,7 @@ inline QDataStream & operator >>(QDataStream & s, QAD::MathMatrix & v) {s >> v.m inline QDebug operator <<(QDebug s, const QAD::MathMatrix & v) {s.nospace() << "Matrix " << v.m; return s.space();} -class QAD_EXPORT __QADTypesRegistrator__ { +class QAD_UTILS_EXPORT __QADTypesRegistrator__ { public: __QADTypesRegistrator__(int); static __QADTypesRegistrator__ * instance(); @@ -167,13 +167,13 @@ inline QRectF enlargedRect(const QRectF & r, qreal dx, qreal dy, qreal v) { return QRectF(r.left() - v + dx, r.top() - v + dy, r.width() + v+v, r.height() + v+v); } -QAD_EXPORT QVariant::Type typeFromLetter(const QString & l); -QAD_EXPORT QString uniqueName(QString n, const QStringList & names); +QAD_UTILS_EXPORT QVariant::Type typeFromLetter(const QString & l); +QAD_UTILS_EXPORT QString uniqueName(QString n, const QStringList & names); -QAD_EXPORT int fontHeight(const QWidget * w = 0); -QAD_EXPORT int lineThickness(const QWidget * w = 0); -QAD_EXPORT QSize preferredIconSize(float x = 1.f, const QWidget * w = 0); -QAD_EXPORT double appScale(const QWidget * w = 0); +QAD_UTILS_EXPORT int fontHeight(const QWidget * w = 0); +QAD_UTILS_EXPORT int lineThickness(const QWidget * w = 0); +QAD_UTILS_EXPORT QSize preferredIconSize(float x = 1.f, const QWidget * w = 0); +QAD_UTILS_EXPORT double appScale(const QWidget * w = 0); #endif // QAD_TYPES_H diff --git a/qad/libs/utils/qpiconfig.h b/qad/libs/utils/qpiconfig.h index 66540a8..816a482 100644 --- a/qad/libs/utils/qpiconfig.h +++ b/qad/libs/utils/qpiconfig.h @@ -20,33 +20,33 @@ #ifndef QPICONFIG_H #define QPICONFIG_H -#include "QFile" -#include "QVector" -#include "QStringList" -#include "QTextStream" +#include +#include +#include +#include #include #include #include #include #include -#include "qad_export.h" +#include "qad_utils_export.h" inline QByteArray QString2QByteArray(const QString & string) {return string.isEmpty() ? QByteArray() : qUncompress(QByteArray::fromBase64(string.toLatin1()));} -QAD_EXPORT int QString2int(const QString & string); +QAD_UTILS_EXPORT int QString2int(const QString & string); inline QColor QString2QColor(const QString & string) {return (string.left(1) == "#" ? QColor(string.right(string.length() - 1).toInt(0, 16)) : QColor(QString2int(string)));} -QAD_EXPORT QRect QString2QRect(const QString & string); -QAD_EXPORT QRectF QString2QRectF(const QString & string); -QAD_EXPORT QPoint QString2QPoint(const QString & string); -QAD_EXPORT QPointF QString2QPointF(const QString & string); +QAD_UTILS_EXPORT QRect QString2QRect(const QString & string); +QAD_UTILS_EXPORT QRectF QString2QRectF(const QString & string); +QAD_UTILS_EXPORT QPoint QString2QPoint(const QString & string); +QAD_UTILS_EXPORT QPointF QString2QPointF(const QString & string); inline QString QColor2QString(const QColor & color) {QString s = color.name(); return "0x" + QString::number(color.alpha(), 16).rightJustified(2, '0') + s.right(s.length() - 1);} inline QString QPoint2QString(const QPoint & point) {return QString::number(point.x()) + ";" + QString::number(point.y());} inline QString QPointF2QString(const QPointF & point) {return QString::number(point.x()) + ";" + QString::number(point.y());} inline QString QByteArray2QString(const QByteArray & array) {return array.isEmpty() ? QString() : QString(qCompress(array, 9).toBase64());} -QAD_EXPORT QString QRect2QString(const QRect & rect); -QAD_EXPORT QString QRectF2QString(const QRectF & rect); +QAD_UTILS_EXPORT QString QRect2QString(const QRect & rect); +QAD_UTILS_EXPORT QString QRectF2QString(const QRectF & rect); #define QPICONFIG_GET_VALUE \ Entry & getValue(const QString & vname, const char * def, bool * exist = 0) {return getValue(vname, QString(def), exist);} \ @@ -69,7 +69,7 @@ QAD_EXPORT QString QRectF2QString(const QRectF & rect); Entry & getValue(const QString & vname, const QPointF & def, bool * exist = 0) {return getValue(vname, QPointF2QString(def), exist);} \ Entry & getValue(const QString & vname, const QByteArray & def, bool * exist = 0) {return getValue(vname, QByteArray2QString(def), exist);} -class QAD_EXPORT QPIConfig: public QFile +class QAD_UTILS_EXPORT QPIConfig: public QFile { friend class Entry; friend class Branch; @@ -90,7 +90,7 @@ public: class Entry; - class QAD_EXPORT Branch: public QVector { + class QAD_UTILS_EXPORT Branch: public QVector { friend class QPIConfig; friend class Entry; public: @@ -116,7 +116,7 @@ public: }; - class QAD_EXPORT Entry { + class QAD_UTILS_EXPORT Entry { friend class QPIConfig; friend class Branch; friend class QPIConfigWidget; diff --git a/qad/libs/utils/qpievaluator.h b/qad/libs/utils/qpievaluator.h index 070a225..5a5ba11 100644 --- a/qad/libs/utils/qpievaluator.h +++ b/qad/libs/utils/qpievaluator.h @@ -26,7 +26,7 @@ #include #include #include -#include "qad_export.h" +#include "qad_utils_export.h" #ifndef PIP_MATH_COMPLEX @@ -67,7 +67,7 @@ namespace QPIEvaluatorTypes { bfIm, bfRe, bfArg, bfLen, bfConj, bfRad, bfDeg}; - struct QAD_EXPORT Instruction { + struct QAD_UTILS_EXPORT Instruction { Instruction() {;} Instruction(Operation oper, QVector opers, int out_ind, int func = -1) { operation = oper; operators = opers; out = out_ind; function = func;} @@ -75,20 +75,20 @@ namespace QPIEvaluatorTypes { QVector operators; int out; int function;}; - struct QAD_EXPORT Element { + struct QAD_UTILS_EXPORT Element { Element() {;} Element(eType new_type, int new_num, int new_var_num = -1) {set(new_type, new_num, new_var_num);} void set(eType new_type, int new_num, int new_var_num = -1) {type = new_type; num = new_num; var_num = new_var_num;} eType type; int num; int var_num;}; - struct QAD_EXPORT Function { + struct QAD_UTILS_EXPORT Function { Function() {arguments = 0; type = bfUnknown;} Function(const QString & name, int args, BaseFunctions ftype) {identifier = name; arguments = args; type = ftype;} QString identifier; BaseFunctions type; int arguments;}; - struct QAD_EXPORT Variable { + struct QAD_UTILS_EXPORT Variable { Variable() {value = 0.;} Variable(const QString & var_name, complexd val) {name = var_name; value = val;} QString name; @@ -108,7 +108,7 @@ namespace QPIEvaluatorTypes { ⋀ & ⋁ | */ -class QAD_EXPORT QPIEvaluatorContent +class QAD_UTILS_EXPORT QPIEvaluatorContent { friend class QPIEvaluator; public: @@ -146,7 +146,7 @@ private: }; -class QAD_EXPORT QPIEvaluator +class QAD_UTILS_EXPORT QPIEvaluator { public: QPIEvaluator() {correct = false ;} diff --git a/qad/libs/widgets/chardialog.h b/qad/libs/widgets/chardialog.h index 714372d..b9a28da 100644 --- a/qad/libs/widgets/chardialog.h +++ b/qad/libs/widgets/chardialog.h @@ -23,7 +23,7 @@ #include #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" namespace Ui { @@ -31,7 +31,7 @@ namespace Ui { } -class QAD_EXPORT CharDialog: public QDialog +class QAD_WIDGETS_EXPORT CharDialog: public QDialog { Q_OBJECT public: diff --git a/qad/libs/widgets/clineedit.h b/qad/libs/widgets/clineedit.h index e0faa89..9424a74 100644 --- a/qad/libs/widgets/clineedit.h +++ b/qad/libs/widgets/clineedit.h @@ -24,10 +24,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" -class QAD_EXPORT CLineEdit: public QLineEdit +class QAD_WIDGETS_EXPORT CLineEdit: public QLineEdit { Q_OBJECT Q_PROPERTY(QString defaultText READ defaultText WRITE setDefaultText) diff --git a/qad/libs/widgets/colorbutton.h b/qad/libs/widgets/colorbutton.h index 1b73324..5987b06 100644 --- a/qad/libs/widgets/colorbutton.h +++ b/qad/libs/widgets/colorbutton.h @@ -28,10 +28,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" -class QAD_EXPORT ColorButton: public QPushButton +class QAD_WIDGETS_EXPORT ColorButton: public QPushButton { Q_OBJECT Q_PROPERTY(QColor color READ color WRITE setColor) diff --git a/qad/libs/widgets/ecombobox.h b/qad/libs/widgets/ecombobox.h index 7f5c6e6..4d1c88e 100644 --- a/qad/libs/widgets/ecombobox.h +++ b/qad/libs/widgets/ecombobox.h @@ -25,9 +25,10 @@ #include #include #include "clineedit.h" +#include "qad_widgets_export.h" -class QAD_EXPORT EComboBox: public QComboBox +class QAD_WIDGETS_EXPORT EComboBox: public QComboBox { Q_OBJECT public: diff --git a/qad/libs/widgets/evalspinbox.h b/qad/libs/widgets/evalspinbox.h index 7b1de2f..81d98d0 100644 --- a/qad/libs/widgets/evalspinbox.h +++ b/qad/libs/widgets/evalspinbox.h @@ -23,11 +23,12 @@ #include #include #include "qpievaluator.h" +#include "qad_widgets_export.h" class QLabel; -class QAD_EXPORT EvalSpinBox: public QAbstractSpinBox +class QAD_WIDGETS_EXPORT EvalSpinBox: public QAbstractSpinBox { Q_OBJECT Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged USER true) diff --git a/qad/libs/widgets/iconedlabel.h b/qad/libs/widgets/iconedlabel.h index 472aa6c..3572e66 100644 --- a/qad/libs/widgets/iconedlabel.h +++ b/qad/libs/widgets/iconedlabel.h @@ -23,9 +23,10 @@ #include #include #include "qad_types.h" +#include "qad_widgets_export.h" -class QAD_EXPORT IconedLabel: public QFrame +class QAD_WIDGETS_EXPORT IconedLabel: public QFrame { Q_OBJECT Q_ENUMS(Direction) diff --git a/qad/libs/widgets/image_view.h b/qad/libs/widgets/image_view.h index 00fe200..5598a1b 100644 --- a/qad/libs/widgets/image_view.h +++ b/qad/libs/widgets/image_view.h @@ -22,10 +22,10 @@ #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" -class QAD_EXPORT ImageView: public QGraphicsView +class QAD_WIDGETS_EXPORT ImageView: public QGraphicsView { Q_OBJECT Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap) diff --git a/qad/libs/widgets/mathmatrixedit.h b/qad/libs/widgets/mathmatrixedit.h index c465573..f01cff4 100644 --- a/qad/libs/widgets/mathmatrixedit.h +++ b/qad/libs/widgets/mathmatrixedit.h @@ -22,12 +22,13 @@ #include #include "qad_types.h" +#include "qad_widgets_export.h" class MatrixEdit; -class QAD_EXPORT MathMatrixEdit: public QWidget { +class QAD_WIDGETS_EXPORT MathMatrixEdit: public QWidget { Q_OBJECT Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) @@ -51,7 +52,7 @@ signals: }; -class __MathMatrixEditRegistrator__ { +class QAD_WIDGETS_EXPORT __MathMatrixEditRegistrator__ { public: __MathMatrixEditRegistrator__(); }; diff --git a/qad/libs/widgets/mathvectoredit.h b/qad/libs/widgets/mathvectoredit.h index ca965f2..3997b31 100644 --- a/qad/libs/widgets/mathvectoredit.h +++ b/qad/libs/widgets/mathvectoredit.h @@ -22,12 +22,13 @@ #include #include "qad_types.h" +#include "qad_widgets_export.h" class MatrixEdit; -class QAD_EXPORT MathVectorEdit: public QWidget { +class QAD_WIDGETS_EXPORT MathVectorEdit: public QWidget { Q_OBJECT Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) @@ -51,7 +52,7 @@ signals: }; -class __MathVectorEditRegistrator__ { +class QAD_WIDGETS_EXPORT __MathVectorEditRegistrator__ { public: __MathVectorEditRegistrator__(); }; diff --git a/qad/libs/widgets/matrixedit.h b/qad/libs/widgets/matrixedit.h index 53af595..7558a9b 100644 --- a/qad/libs/widgets/matrixedit.h +++ b/qad/libs/widgets/matrixedit.h @@ -21,7 +21,7 @@ #define MATRIXEDIT_H #include -#include "qad_export.h" +#include "qad_widgets_export.h" namespace Ui { @@ -29,7 +29,7 @@ namespace Ui { } -class QAD_EXPORT MatrixEdit: public QWidget { +class QAD_WIDGETS_EXPORT MatrixEdit: public QWidget { Q_OBJECT public: explicit MatrixEdit(QWidget * parent = 0); diff --git a/qad/libs/widgets/propertystorage_editor.h b/qad/libs/widgets/propertystorage_editor.h index fde0be0..76a79e1 100644 --- a/qad/libs/widgets/propertystorage_editor.h +++ b/qad/libs/widgets/propertystorage_editor.h @@ -22,9 +22,10 @@ #include #include "propertystorage.h" +#include "qad_widgets_export.h" -class QAD_EXPORT PropertyStorageEditor: public QWidget { +class QAD_WIDGETS_EXPORT PropertyStorageEditor: public QWidget { Q_OBJECT public: explicit PropertyStorageEditor(QWidget * parent = 0); diff --git a/qad/libs/widgets/qcodeedit.h b/qad/libs/widgets/qcodeedit.h index 6b437c3..63059a1 100644 --- a/qad/libs/widgets/qcodeedit.h +++ b/qad/libs/widgets/qcodeedit.h @@ -24,6 +24,7 @@ #include #include #include "iconedlabel.h" +#include "qad_widgets_export.h" namespace Ui { @@ -31,7 +32,7 @@ namespace Ui { } -class QAD_EXPORT QCodeEdit: public QWidget +class QAD_WIDGETS_EXPORT QCodeEdit: public QWidget { Q_OBJECT Q_PROPERTY(QString text READ text WRITE setText) @@ -93,7 +94,7 @@ protected: Ui::QCodeEdit * ui; private: - struct ACClass { + struct QAD_WIDGETS_EXPORT ACClass { ACClass(int i = -2, ACClassType c = QCodeEdit::Keyword, const QString & n = QString(), const QIcon & ic = QIcon()): id(i), class_(c), name(n), icon(ic) {} int id; ACClassType class_; diff --git a/qad/libs/widgets/qipedit.h b/qad/libs/widgets/qipedit.h index c1d72f2..2396e86 100644 --- a/qad/libs/widgets/qipedit.h +++ b/qad/libs/widgets/qipedit.h @@ -26,10 +26,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" -class QAD_EXPORT QIPEdit: public QWidget +class QAD_WIDGETS_EXPORT QIPEdit: public QWidget { Q_OBJECT Q_PROPERTY(QString IP READ IP WRITE setIP) diff --git a/qad/libs/widgets/qpiconfignewdialog.h b/qad/libs/widgets/qpiconfignewdialog.h index 2730507..2553c85 100644 --- a/qad/libs/widgets/qpiconfignewdialog.h +++ b/qad/libs/widgets/qpiconfignewdialog.h @@ -22,7 +22,7 @@ #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" namespace Ui { @@ -30,7 +30,7 @@ namespace Ui { } -class QAD_EXPORT QPIConfigNewDialog: public QDialog +class QAD_WIDGETS_EXPORT QPIConfigNewDialog: public QDialog { Q_OBJECT diff --git a/qad/libs/widgets/qpiconfigvaluewidget.h b/qad/libs/widgets/qpiconfigvaluewidget.h index e71e512..6ddadbe 100644 --- a/qad/libs/widgets/qpiconfigvaluewidget.h +++ b/qad/libs/widgets/qpiconfigvaluewidget.h @@ -20,6 +20,10 @@ #ifndef QPICONFIGVALUEWIDGET_H #define QPICONFIGVALUEWIDGET_H +#include +#include +#include +#include #include "qpiconfig.h" #include "qvariantedit.h" #include "qrectedit.h" @@ -29,13 +33,10 @@ #include "qipedit.h" #include "limits.h" #include "float.h" -#include -#include -#include -#include +#include "qad_widgets_export.h" -class QAD_EXPORT ConfigValueWidget: public QWidget +class QAD_WIDGETS_EXPORT ConfigValueWidget: public QWidget { Q_OBJECT friend class QPIConfigWidget; diff --git a/qad/libs/widgets/qpiconfigwidget.h b/qad/libs/widgets/qpiconfigwidget.h index 464cf70..4929ba1 100644 --- a/qad/libs/widgets/qpiconfigwidget.h +++ b/qad/libs/widgets/qpiconfigwidget.h @@ -20,18 +20,19 @@ #ifndef QPICONFIGWIDGET_H #define QPICONFIGWIDGET_H -#include "qpiconfig.h" -#include "qpiconfignewdialog.h" -#include "qpiconfigvaluewidget.h" #include #include #include #include #include #include +#include "qpiconfig.h" +#include "qpiconfignewdialog.h" +#include "qpiconfigvaluewidget.h" +#include "qad_widgets_export.h" -class QAD_EXPORT UComboBox: public QComboBox +class QAD_WIDGETS_EXPORT UComboBox: public QComboBox { Q_OBJECT public: @@ -43,7 +44,7 @@ signals: }; -class QAD_EXPORT QPIConfigWidget: public QTreeWidget +class QAD_WIDGETS_EXPORT QPIConfigWidget: public QTreeWidget { Q_OBJECT Q_PROPERTY(bool readOnlyName READ readOnlyName WRITE setReadOnlyName) diff --git a/qad/libs/widgets/qpiconsole.h b/qad/libs/widgets/qpiconsole.h index 1937d44..9426421 100644 --- a/qad/libs/widgets/qpiconsole.h +++ b/qad/libs/widgets/qpiconsole.h @@ -26,7 +26,7 @@ #include #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" typedef long long llong; @@ -38,7 +38,7 @@ typedef unsigned long long ullong; typedef long double ldouble; -class QAD_EXPORT QPIConsole: public QTabWidget { +class QAD_WIDGETS_EXPORT QPIConsole: public QTabWidget { Q_OBJECT public: QPIConsole(QWidget * parent = 0); @@ -143,7 +143,7 @@ private: return QString::number(v); } - struct Variable { + struct QAD_WIDGETS_EXPORT Variable { Variable() {label = widget = 0;} QString name; Formats format; @@ -157,7 +157,7 @@ private: bitFrom = src.bitFrom; bitCount = src.bitCount; ptr = src.ptr;} }; - struct Column { + struct QAD_WIDGETS_EXPORT Column { Column(Qt::Alignment align = Qt::AlignRight) {variables.reserve(16); alignment = align;} QVector variables; Qt::Alignment alignment; @@ -169,7 +169,7 @@ private: void operator =(const Column & src) {variables = src.variables; alignment = src.alignment;} }; - struct Tab { + struct QAD_WIDGETS_EXPORT Tab { Tab(QString n = "", char k = 0) {columns.reserve(16); name = n; key = k;} QVector columns; QString name; diff --git a/qad/libs/widgets/qpointedit.h b/qad/libs/widgets/qpointedit.h index c56ce95..1006257 100644 --- a/qad/libs/widgets/qpointedit.h +++ b/qad/libs/widgets/qpointedit.h @@ -24,10 +24,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" -class QAD_EXPORT QPointEdit: public QWidget +class QAD_WIDGETS_EXPORT QPointEdit: public QWidget { Q_OBJECT Q_PROPERTY(QPointF value READ value WRITE setValue) diff --git a/qad/libs/widgets/qrectedit.h b/qad/libs/widgets/qrectedit.h index df955c9..5fc0d33 100644 --- a/qad/libs/widgets/qrectedit.h +++ b/qad/libs/widgets/qrectedit.h @@ -24,10 +24,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" -class QAD_EXPORT QRectEdit: public QWidget +class QAD_WIDGETS_EXPORT QRectEdit: public QWidget { Q_OBJECT Q_PROPERTY(QRectF value READ value WRITE setValue) diff --git a/qad/libs/widgets/qvariantedit.h b/qad/libs/widgets/qvariantedit.h index aaaea63..4bd466a 100644 --- a/qad/libs/widgets/qvariantedit.h +++ b/qad/libs/widgets/qvariantedit.h @@ -20,6 +20,9 @@ #ifndef QVARIANTEDIT_H #define QVARIANTEDIT_H +#include +#include +#include #include "qvariantedit_custom.h" #include "qad_types.h" #include "clineedit.h" @@ -28,12 +31,10 @@ #include "qrectedit.h" #include "qpointedit.h" #include "evalspinbox.h" -#include -#include -#include +#include "qad_widgets_export.h" -class QAD_EXPORT StringListEdit: public QWidget +class QAD_WIDGETS_EXPORT StringListEdit: public QWidget { Q_OBJECT public: @@ -66,7 +67,7 @@ signals: -class QAD_EXPORT PathEdit: public QWidget +class QAD_WIDGETS_EXPORT PathEdit: public QWidget { Q_OBJECT public: @@ -100,7 +101,7 @@ signals: -class QAD_EXPORT QVariantEdit: public QWidget +class QAD_WIDGETS_EXPORT QVariantEdit: public QWidget { Q_OBJECT Q_PROPERTY(QVariant value READ value WRITE setValue) diff --git a/qad/libs/widgets/qvariantedit_custom.h b/qad/libs/widgets/qvariantedit_custom.h index 8d392c3..2511dba 100644 --- a/qad/libs/widgets/qvariantedit_custom.h +++ b/qad/libs/widgets/qvariantedit_custom.h @@ -23,13 +23,13 @@ #include #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" class QVariantEdit; -class QAD_EXPORT QVariantEditorFactoryBase { +class QAD_WIDGETS_EXPORT QVariantEditorFactoryBase { friend class QVariantEdit; public: QVariantEditorFactoryBase() {} @@ -39,7 +39,7 @@ private: }; -class QAD_EXPORT QVariantEditorFactories { +class QAD_WIDGETS_EXPORT QVariantEditorFactories { public: static void registerEditorFactory(int meta_id, QVariantEditorFactoryBase * f); static void unregisterEditorFactory(int meta_id); diff --git a/qad/libs/widgets/scroll_spin_box.h b/qad/libs/widgets/scroll_spin_box.h index 2dedcbc..266bbdc 100644 --- a/qad/libs/widgets/scroll_spin_box.h +++ b/qad/libs/widgets/scroll_spin_box.h @@ -21,7 +21,7 @@ #define SCROLL_SPIN_BOX_H #include -#include "qad_export.h" +#include "qad_widgets_export.h" namespace Ui { @@ -32,7 +32,7 @@ namespace Ui { class EvalSpinBox; -class QAD_EXPORT ScrollSpinBox: public QWidget +class QAD_WIDGETS_EXPORT ScrollSpinBox: public QWidget { Q_OBJECT Q_PROPERTY(double sensivity READ sensivity WRITE setSensivity) diff --git a/qad/libs/widgets/session_manager.h b/qad/libs/widgets/session_manager.h index d788b2c..b3c84fa 100644 --- a/qad/libs/widgets/session_manager.h +++ b/qad/libs/widgets/session_manager.h @@ -35,6 +35,7 @@ #include "spinslider.h" #include "evalspinbox.h" #include "qpiconfig.h" +#include "qad_widgets_export.h" /// for all children widgets of "QMainWindow"s and MainWidgets @@ -43,7 +44,7 @@ /// * void sessionLoad(QByteArray * data); -class QAD_EXPORT SessionManager: public QObject +class QAD_WIDGETS_EXPORT SessionManager: public QObject { Q_OBJECT public: diff --git a/qad/libs/widgets/shortcuts.h b/qad/libs/widgets/shortcuts.h index cc41df3..2bdc1f8 100644 --- a/qad/libs/widgets/shortcuts.h +++ b/qad/libs/widgets/shortcuts.h @@ -33,14 +33,15 @@ #include #include #include "clineedit.h" +#include "qad_widgets_export.h" -class QAD_EXPORT ShortcutEdit: public CLineEdit +class QAD_WIDGETS_EXPORT ShortcutEdit: public CLineEdit { Q_OBJECT friend class Shortcuts; public: - explicit ShortcutEdit(QWidget * parent = 0): CLineEdit(parent) {ti = 0; ca = 0; connect(this, SIGNAL(textChanged(QString)), this, SLOT(textChanged_(QString)));} + explicit ShortcutEdit(QWidget * parent = 0): CLineEdit(parent) {ti = 0; ca = 0; connect(this, SIGNAL(textChanged(QString)), this, SLOT(textChanged_(QString)));} void assignAction(QAction * a) {clear(); ca = a; reset();} QAction * action() const {return ca;} @@ -60,7 +61,7 @@ private: }; -class QAD_EXPORT Shortcuts: public QTreeWidget +class QAD_WIDGETS_EXPORT Shortcuts: public QTreeWidget { Q_OBJECT @@ -82,7 +83,7 @@ public slots: void filter(const QString & what); private: - virtual void updateEditorGeometries() {foreach (ShortcutEdit * i, edits) i->setGeometry(visualRect(indexFromItem(i->ti, 1)));} + virtual void updateEditorGeometries() {foreach (ShortcutEdit * i, edits) i->setGeometry(visualRect(indexFromItem(i->ti, 1)));} virtual void changeEvent(QEvent * ); bool filterTree(QTreeWidgetItem * ti, QString f); diff --git a/qad/libs/widgets/spinslider.h b/qad/libs/widgets/spinslider.h index 1fbc185..fda4742 100644 --- a/qad/libs/widgets/spinslider.h +++ b/qad/libs/widgets/spinslider.h @@ -23,10 +23,10 @@ #include #include #include -#include "qad_export.h" +#include "qad_widgets_export.h" -class QAD_EXPORT SpinSlider: public QWidget +class QAD_WIDGETS_EXPORT SpinSlider: public QWidget { Q_OBJECT Q_ENUMS(Direction) @@ -72,13 +72,13 @@ public: bool invertedAppearance() const {return slider->invertedAppearance();} bool squareScale() const {return square;} - void setSingleStep(double step) {spin->setSingleStep(step); slider->setPageStep(qRound(step * delim));} + void setSingleStep(double step) {spin->setSingleStep(step); slider->setPageStep(qRound(step * delim));} void setAdaptiveStep(bool on); - void setPageStep(double step) {page = step; slider->setPageStep(qRound(page * delim));} + void setPageStep(double step) {page = step; slider->setPageStep(qRound(page * delim));} void setPrefix(QString prefix) {spin->setPrefix(prefix);} void setSuffix(QString suffix) {spin->setSuffix(suffix);} void setTickPosition(QSlider::TickPosition tp) {slider->setTickPosition(tp);} - void setTickInterval(int ti) {ticks_ = ti; slider->setTickInterval(qRound(ticks_ * delim));} + void setTickInterval(int ti) {ticks_ = ti; slider->setTickInterval(qRound(ticks_ * delim));} void setOrientation(Qt::Orientation orient); void setDirection(Direction d) {direc = d; layout->setDirection((QBoxLayout::Direction)d);} void setInvertedAppearance(bool yes) {slider->setInvertedAppearance(yes);} diff --git a/qad/qad_export.h b/qad/qad_export.h deleted file mode 100644 index 1f7e882..0000000 --- a/qad/qad_export.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef QAD_EXPORT_H -#define QAD_EXPORT_H - -#include - -#if defined(QAD_STATIC_DEFINE) || defined(DOXYGEN) -# define QAD_EXPORT -#else -# ifdef QAD_SHARED_DEFINE -# define QAD_EXPORT Q_DECL_EXPORT -# else -# define QAD_EXPORT Q_DECL_IMPORT -# endif -#endif - -#endif //QAD_EXPORT_H