From f00f72efa98ce27aeaa1e5ecd8dee2ba9791acf0 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 30 Oct 2022 12:26:13 +0300 Subject: [PATCH 1/2] Github actions: add support msvc, mingw, macos --- .github/workflows/cmake.yml | 129 +++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 57437ed..be1b89b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: ubuntu_version: [20.04, 22.04] - qt_version: [5.12.12, 5.15.2, 6.3.0] + qt_version: [5.15.2, 6.4.0] static: [ON, OFF] steps: @@ -45,3 +45,130 @@ jobs: - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + MSVC: + name: windows-${{ matrix.win_version }}-Qt-${{ matrix.qt_version }}-static-${{ matrix.static }} + runs-on: windows-${{ matrix.win_version }} + strategy: + fail-fast: false + matrix: + win_version: [2019, 2022] + qt_version: [5.15.2, 6.4.0] + static: [ON, OFF] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: ${{ matrix.qt_version }} + cache: 'true' + cache-key-prefix: ${{ runner.os }}-Qt-Cache-${{ matrix.qt_version }} + dir: ${{ github.workspace }}/Qt + + - name: Configure CMake for Qt5 + if: "startsWith(matrix.qt_version, '5.')" + run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + + + - name: Configure CMake for Qt6 + if: "startsWith(matrix.qt_version, '6.')" + run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + MinGW-w64: + runs-on: windows-2022 + name: msys2-${{ matrix.msystem }}-Qt-${{ matrix.qt_version }}-static-${{ matrix.static }} + strategy: + fail-fast: false + matrix: + qt_version: [5, 6] + msystem: [UCRT64, CLANG64] + static: [ON, OFF] + defaults: + run: + shell: msys2 {0} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install MinGW-w64 packages Qt5 + if: "startsWith(matrix.qt_version, '5')" + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + release: false + update: true + pacboy: >- + cc:p + cmake:p + ninja:p + qt${{ matrix.qt_version }}-base:p + qt${{ matrix.qt_version }}-svg:p + qt${{ matrix.qt_version }}-tools:p + qt${{ matrix.qt_version }}-quickcontrols:p + + - name: Install MinGW-w64 packages Qt6 + if: "startsWith(matrix.qt_version, '6')" + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + release: false + update: true + pacboy: >- + cc:p + cmake:p + ninja:p + qt${{ matrix.qt_version }}-base:p + qt${{ matrix.qt_version }}-svg:p + qt${{ matrix.qt_version }}-tools:p + qt${{ matrix.qt_version }}-declarative:p + + - name: Configure CMake for Qt5 + if: "startsWith(matrix.qt_version, '5')" + run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + + + - name: Configure CMake for Qt6 + if: "startsWith(matrix.qt_version, '6')" + run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + + - name: Build + run: cmake --build '${{github.workspace}}/build' --config ${{env.BUILD_TYPE}} + macos: + runs-on: macos-${{ matrix.macos_version }} + name: macos-${{ matrix.macos_version }}-Qt-${{ matrix.qt_version }}-static-${{ matrix.static }} + strategy: + fail-fast: false + matrix: + macos_version: [11, 12] + qt_version: [5.15.2, 6.4.0] + static: [ON, OFF] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: ${{ matrix.qt_version }} + cache: 'true' + cache-key-prefix: ${{ runner.os }}-Qt-Cache-${{ matrix.qt_version }} + dir: ${{ github.workspace }}/Qt + + - name: Configure CMake for Qt5 + if: "startsWith(matrix.qt_version, '5.')" + run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + + + - name: Configure CMake for Qt6 + if: "startsWith(matrix.qt_version, '6.')" + run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} \ No newline at end of file From e6ead26d31385cc62e969339623ce9d45717b0f8 Mon Sep 17 00:00:00 2001 From: Jihadist Date: Sun, 30 Oct 2022 20:44:59 +0300 Subject: [PATCH 2/2] Cmake fixes: non exported symbols, missing files, shared import, rewrite cmake for demo and designer --- .github/workflows/cmake.yml | 16 ++++++------ CMakeLists.txt | 27 +++++++++++++++---- demo_r1/CMakeLists.txt | 9 ++++--- designer/CMakeLists.txt | 10 +++---- limereport/items/lrbordereditor.h | 2 +- limereport/items/lrpageeditor.cpp | 33 +++++++++++++----------- limereport/items/lrpageeditor.h | 2 +- limereport/lrbasedesignintf.h | 8 +++--- limereport/lrcollection.h | 6 ++--- limereport/lrglobal.h | 10 +++---- limereport/lritemscontainerdesignitf.h | 12 ++++----- limereport/lrpageitemdesignintf.h | 2 +- limereport/serializators/lrstorageintf.h | 7 ++--- 13 files changed, 83 insertions(+), 61 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index be1b89b..1233e7a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -35,12 +35,12 @@ jobs: - name: Configure CMake for Qt5 if: "startsWith(matrix.qt_version, '5.')" - run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -DLIMEREPORT_DEMO=ON -B "${{github.workspace}}/build" - name: Configure CMake for Qt6 if: "startsWith(matrix.qt_version, '6.')" - run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -DLIMEREPORT_DEMO=ON -B "${{github.workspace}}/build" - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} @@ -69,12 +69,12 @@ jobs: - name: Configure CMake for Qt5 if: "startsWith(matrix.qt_version, '5.')" - run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -DLIMEREPORT_DEMO=ON -B "${{github.workspace}}/build" - name: Configure CMake for Qt6 if: "startsWith(matrix.qt_version, '6.')" - run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -DLIMEREPORT_DEMO=ON -B "${{github.workspace}}/build" - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} @@ -130,12 +130,12 @@ jobs: - name: Configure CMake for Qt5 if: "startsWith(matrix.qt_version, '5')" - run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -DLIMEREPORT_DEMO=ON -B "${{github.workspace}}/build" - name: Configure CMake for Qt6 if: "startsWith(matrix.qt_version, '6')" - run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -DLIMEREPORT_DEMO=ON -B "${{github.workspace}}/build" - name: Build run: cmake --build '${{github.workspace}}/build' --config ${{env.BUILD_TYPE}} @@ -163,12 +163,12 @@ jobs: - name: Configure CMake for Qt5 if: "startsWith(matrix.qt_version, '5.')" - run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -DLIMEREPORT_DEMO=ON -B "${{github.workspace}}/build" - name: Configure CMake for Qt6 if: "startsWith(matrix.qt_version, '6.')" - run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -B "${{github.workspace}}/build" + run: cmake -DUSE_QT6=ON -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DLIMEREPORT_STATIC=${{ matrix.static }} -DLIMEREPORT_DEMO=ON -B "${{github.workspace}}/build" - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 00f0869..64ce1b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ set(LIMEREPORT_VERSION_RELEASE 8) option(ENABLE_ZINT "Enable libzint build for barcode support" OFF) option(LIMEREPORT_STATIC "Build LimeReport as static library" OFF) +option(LIMEREPORT_DEMO "Build LimeReport demos" OFF) option(USE_QT6 "Use Qt6" OFF) if(USE_QT6) @@ -37,8 +38,11 @@ if (Qt${QT_VERSION_MAJOR}Widgets_FOUND) endif() add_subdirectory(3rdparty) -add_subdirectory(designer EXCLUDE_FROM_ALL) -add_subdirectory(demo_r1 EXCLUDE_FROM_ALL) + +if (LIMEREPORT_DEMO) + add_subdirectory(designer) + add_subdirectory(demo_r1) +endif() set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) @@ -79,6 +83,8 @@ ${PROJECT_NAME}/items/editors/lritemsborderseditorwidget.cpp ${PROJECT_NAME}/items/editors/lrtextalignmenteditorwidget.cpp ${PROJECT_NAME}/items/lrabstractlayout.cpp ${PROJECT_NAME}/items/lralignpropitem.cpp +${PROJECT_NAME}/items/borderframeeditor.cpp +${PROJECT_NAME}/items/lrbordereditor.cpp ${PROJECT_NAME}/items/lrchartitem.cpp ${PROJECT_NAME}/items/lrchartaxiseditor.cpp ${PROJECT_NAME}/items/lrchartitemeditor.cpp @@ -86,6 +92,7 @@ ${PROJECT_NAME}/items/lrhorizontallayout.cpp ${PROJECT_NAME}/items/lrimageitem.cpp ${PROJECT_NAME}/items/lrimageitemeditor.cpp ${PROJECT_NAME}/items/lrlayoutmarker.cpp +${PROJECT_NAME}/items/lrpageeditor.cpp ${PROJECT_NAME}/items/lrshapeitem.cpp ${PROJECT_NAME}/items/lrsubitemparentpropitem.cpp ${PROJECT_NAME}/items/lrsvgitem.cpp @@ -191,6 +198,8 @@ ${PROJECT_NAME}/items/editors/lritemsborderseditorwidget.h ${PROJECT_NAME}/items/editors/lrtextalignmenteditorwidget.h ${PROJECT_NAME}/items/lrabstractlayout.h ${PROJECT_NAME}/items/lralignpropitem.h +${PROJECT_NAME}/items/borderframeeditor.h +${PROJECT_NAME}/items/lrbordereditor.h ${PROJECT_NAME}/items/lrchartitem.h ${PROJECT_NAME}/items/lrchartaxiseditor.h ${PROJECT_NAME}/items/lrchartitemeditor.h @@ -199,6 +208,7 @@ ${PROJECT_NAME}/items/lrhorizontallayout.h ${PROJECT_NAME}/items/lrimageitem.h ${PROJECT_NAME}/items/lrimageitemeditor.h ${PROJECT_NAME}/items/lrlayoutmarker.h +${PROJECT_NAME}/items/lrpageeditor.h ${PROJECT_NAME}/items/lrshapeitem.h ${PROJECT_NAME}/items/lrsubitemparentpropitem.h ${PROJECT_NAME}/items/lrsvgitem.h @@ -288,9 +298,12 @@ ${PROJECT_NAME}/databrowser/lrdatabrowser.ui ${PROJECT_NAME}/databrowser/lrsqleditdialog.ui ${PROJECT_NAME}/databrowser/lrvariabledialog.ui ${PROJECT_NAME}/dialogdesigner/templates/Dialog.ui +${PROJECT_NAME}/items/borderframeeditor.ui +${PROJECT_NAME}/items/lrbordereditor.ui ${PROJECT_NAME}/items/lrchartitemeditor.ui ${PROJECT_NAME}/items/lrchartaxiseditor.ui ${PROJECT_NAME}/items/lrimageitemeditor.ui +${PROJECT_NAME}/items/lrpageeditor.ui ${PROJECT_NAME}/items/lrtextitemeditor.ui ${PROJECT_NAME}/lraboutdialog.ui ${PROJECT_NAME}/lrpreviewreportwidget.ui @@ -348,12 +361,13 @@ set(GLOBAL_HEADERS set(PROJECT_NAME ${PROJECT_NAME}-qt${QT_VERSION_MAJOR}) if (LIMEREPORT_STATIC) - message(STATUS "STATIC LIBRARY") - add_library(${PROJECT_NAME} STATIC ${EXTRA_FILES} ${LIMEREPORT_SOURCES}) + message(STATUS "STATIC LIBRARY") + add_library(${PROJECT_NAME} STATIC ${EXTRA_FILES} ${LIMEREPORT_SOURCES}) target_compile_definitions( ${PROJECT_NAME} PUBLIC -DHAVE_STATIC_BUILD) else() add_library(${PROJECT_NAME} SHARED ${EXTRA_FILES} ${LIMEREPORT_SOURCES}) - target_compile_definitions( ${PROJECT_NAME} PUBLIC -DLIMEREPORT_EXPORTS) + target_compile_definitions( ${PROJECT_NAME} PRIVATE -DLIMEREPORT_EXPORTS) + target_compile_definitions( ${PROJECT_NAME} INTERFACE -DLIMEREPORT_IMPORTS) endif() target_compile_definitions(${PROJECT_NAME} PUBLIC -DCMAKE_CONFIG) @@ -392,6 +406,9 @@ target_include_directories( ${PROJECT_NAME} PRIVATE limereport/serializators limereport/scripteditor ) +target_include_directories( ${PROJECT_NAME} INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/include) + install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib diff --git a/demo_r1/CMakeLists.txt b/demo_r1/CMakeLists.txt index da749ac..4f68d4a 100644 --- a/demo_r1/CMakeLists.txt +++ b/demo_r1/CMakeLists.txt @@ -1,3 +1,5 @@ +project(demo_r1) + set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) @@ -9,15 +11,14 @@ set(PROJECT_SOURCES mainwindow.ui ) -add_executable(demo_r1 main.cpp ${PROJECT_SOURCES}) +add_executable(${PROJECT_NAME} main.cpp ${PROJECT_SOURCES}) -target_include_directories( demo_r1 PRIVATE ../include/ ) -target_link_libraries(demo_r1 PRIVATE +target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::PrintSupport Qt${QT_VERSION_MAJOR}::Qml Qt${QT_VERSION_MAJOR}::Sql - ${PROJECT_NAME}-qt${QT_VERSION_MAJOR} + limereport-qt${QT_VERSION_MAJOR} ) diff --git a/designer/CMakeLists.txt b/designer/CMakeLists.txt index d63ea0b..9ae1a39 100644 --- a/designer/CMakeLists.txt +++ b/designer/CMakeLists.txt @@ -1,3 +1,5 @@ +project(LRDesigner) + set(CMAKE_AUTOMOC ON) set(LRDESIGNER_FILES @@ -7,14 +9,12 @@ set(LRDESIGNER_FILES mainicon.rc ) -add_executable(LRDesigner ${LRDESIGNER_FILES}) +add_executable(${PROJECT_NAME} ${LRDESIGNER_FILES}) -target_include_directories(LRDesigner PUBLIC ${PROJECT_SOURCE_DIR}/include) - -target_link_libraries(LRDesigner PUBLIC +target_link_libraries(${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::PrintSupport Qt${QT_VERSION_MAJOR}::Qml - ${PROJECT_NAME}-qt${QT_VERSION_MAJOR} + limereport-qt${QT_VERSION_MAJOR} ) diff --git a/limereport/items/lrbordereditor.h b/limereport/items/lrbordereditor.h index 5c2c9ba..3158b48 100644 --- a/limereport/items/lrbordereditor.h +++ b/limereport/items/lrbordereditor.h @@ -7,7 +7,7 @@ namespace Ui { class lrbordereditor; } -class lrbordereditor : public QDialog +class LIMEREPORT_EXPORT lrbordereditor : public QDialog { Q_OBJECT diff --git a/limereport/items/lrpageeditor.cpp b/limereport/items/lrpageeditor.cpp index d0c2f46..0efe6f2 100644 --- a/limereport/items/lrpageeditor.cpp +++ b/limereport/items/lrpageeditor.cpp @@ -1,9 +1,12 @@ #include "lrpageeditor.h" #include "ui_lrpageeditor.h" -#include "lrpagedesignintf.h" +#include "lrpageitemdesignintf.h" #include #include -lrpageeditor::lrpageeditor(QWidget *parent, LimeReport::PageItemDesignIntf *page) : + +using namespace LimeReport; + +lrpageeditor::lrpageeditor(QWidget *parent, PageItemDesignIntf *page) : QDialog(parent), ui(new Ui::lrpageeditor) { @@ -16,10 +19,10 @@ lrpageeditor::lrpageeditor(QWidget *parent, LimeReport::PageItemDesignIntf *page ui->format->addItem(pageSizes.key(i)); } ui->format->setCurrentIndex(m_page->pageSize()); - ui->width->setValue(m_page->width() / LimeReport::Const::mmFACTOR); - ui->height->setValue(m_page->height() / LimeReport::Const::mmFACTOR); - ui->portrait->setChecked(m_page->pageOrientation() == LimeReport::PageItemDesignIntf::Portrait); - ui->landscape->setChecked(m_page->pageOrientation() == LimeReport::PageItemDesignIntf::Landscape); + ui->width->setValue(m_page->width() / Const::mmFACTOR); + ui->height->setValue(m_page->height() / Const::mmFACTOR); + ui->portrait->setChecked(m_page->pageOrientation() == PageItemDesignIntf::Portrait); + ui->landscape->setChecked(m_page->pageOrientation() == PageItemDesignIntf::Landscape); //Margins ui->marginTop->setValue(m_page->topMargin()); ui->marginRight->setValue(m_page->rightMargin()); @@ -40,10 +43,10 @@ lrpageeditor::~lrpageeditor() void lrpageeditor::applyChanges() { - m_page->setPageSize(static_cast(ui->format->currentIndex())); - m_page->setWidth(ui->width->value()* LimeReport::Const::mmFACTOR); - m_page->setHeight(ui->height->value()* LimeReport::Const::mmFACTOR); - m_page->setPageOrientation(ui->portrait->isChecked()?LimeReport::PageItemDesignIntf::Portrait : LimeReport::PageItemDesignIntf::Landscape); + m_page->setPageSize(static_cast(ui->format->currentIndex())); + m_page->setWidth(ui->width->value()* Const::mmFACTOR); + m_page->setHeight(ui->height->value()* Const::mmFACTOR); + m_page->setPageOrientation(ui->portrait->isChecked()?PageItemDesignIntf::Portrait : PageItemDesignIntf::Landscape); m_page->setTopMargin(ui->marginTop->value()); m_page->setBottomMargin(ui->marginBottom->value()); @@ -61,9 +64,9 @@ void lrpageeditor::on_buttonBox_accepted() } -QSizeF lrpageeditor::getRectByPageSize(const LimeReport::PageItemDesignIntf::PageSize& size) +QSizeF lrpageeditor::getRectByPageSize(const PageItemDesignIntf::PageSize& size) { - if (size != LimeReport::PageItemDesignIntf::Custom) { + if (size != PageItemDesignIntf::Custom) { QPrinter printer; printer.setOutputFormat(QPrinter::PdfFormat); #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 1)) @@ -76,8 +79,8 @@ QSizeF lrpageeditor::getRectByPageSize(const LimeReport::PageItemDesignIntf::Pag QPageSize pageSize = QPageSize((QPageSize::PageSizeId)size); qreal width = pageSize.size(QPageSize::Millimeter).width() * 10; qreal height = pageSize.size(QPageSize::Millimeter).height() * 10; - return QSizeF(pageOrientation() == Portrait ? width : height, - pageOrientation() == Portrait ? height : width); + return QSizeF(m_page->pageOrientation() == PageItemDesignIntf::Portrait ? width : height, + m_page->pageOrientation() == PageItemDesignIntf::Orientation::Portrait ? height : width); // printer.setPageOrientation((QPageLayout::Orientation)pageOrientation()); // printer.setPageSize(QPageSize((QPageSize::PageSizeId)size)); @@ -95,7 +98,7 @@ void lrpageeditor::on_format_currentIndexChanged(int index) QPageSize ps = *new QPageSize(); if(ui->format->currentText() != "Custom") { - QSizeF pageSize = getRectByPageSize(static_cast(index)); + QSizeF pageSize = getRectByPageSize(static_cast(index)); ui->width->setValue(pageSize.width()/10); ui->height->setValue(pageSize.height()/10); } diff --git a/limereport/items/lrpageeditor.h b/limereport/items/lrpageeditor.h index 545ca3e..d1ed8d5 100644 --- a/limereport/items/lrpageeditor.h +++ b/limereport/items/lrpageeditor.h @@ -8,7 +8,7 @@ namespace Ui { class lrpageeditor; } -class lrpageeditor : public QDialog +class LIMEREPORT_EXPORT lrpageeditor : public QDialog { Q_OBJECT diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index adf7d21..44267c0 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -49,7 +49,7 @@ class ReportEnginePrivate; class PageDesignIntf; class BaseDesignIntf; -class Marker : public QGraphicsItem{ +class LIMEREPORT_EXPORT Marker : public QGraphicsItem{ public: Marker(QGraphicsItem* parent = 0, BaseDesignIntf* owner = 0): QGraphicsItem(parent), m_owner(owner){} QRectF boundingRect() const; @@ -65,7 +65,7 @@ private: BaseDesignIntf* m_owner; }; -class SelectionMarker : public Marker{ +class LIMEREPORT_EXPORT SelectionMarker : public Marker{ public: SelectionMarker(QGraphicsItem* parent=0, BaseDesignIntf* owner = 0); QColor color() const; @@ -80,7 +80,7 @@ protected: class DataSourceManager; class ReportRender; -class BaseDesignIntf : +class LIMEREPORT_EXPORT BaseDesignIntf : public QObject, public QGraphicsItem, public ICollectionContainer, public ObjectLoadingStateIntf { Q_OBJECT Q_INTERFACES(QGraphicsItem) @@ -515,7 +515,7 @@ signals: void afterRender(); }; -class BookmarkContainerDesignIntf: public BaseDesignIntf{ +class LIMEREPORT_EXPORT BookmarkContainerDesignIntf: public BaseDesignIntf{ Q_OBJECT public: BookmarkContainerDesignIntf(const QString& storageTypeName, QObject* owner = 0, QGraphicsItem* parent = 0) diff --git a/limereport/lrcollection.h b/limereport/lrcollection.h index 4e3aded..e66d1b9 100644 --- a/limereport/lrcollection.h +++ b/limereport/lrcollection.h @@ -35,7 +35,7 @@ #include "lrglobal.h" -class ACollectionProperty{ +class LIMEREPORT_EXPORT ACollectionProperty{ public: ACollectionProperty(){} ACollectionProperty(const ACollectionProperty& ){} @@ -45,8 +45,8 @@ Q_DECLARE_METATYPE(ACollectionProperty) namespace LimeReport{ -const int COLLECTION_TYPE_ID = qMetaTypeId(); -class ICollectionContainer{ +const int inline COLLECTION_TYPE_ID = qMetaTypeId(); +class LIMEREPORT_EXPORT ICollectionContainer{ public: virtual QObject* createElement(const QString& collectionName,const QString& elementType)=0; virtual int elementsCount(const QString& collectionName)=0; diff --git a/limereport/lrglobal.h b/limereport/lrglobal.h index b2fe56c..95f9801 100644 --- a/limereport/lrglobal.h +++ b/limereport/lrglobal.h @@ -125,12 +125,12 @@ namespace Const{ Q_DECLARE_FLAGS(PreviewHints, PreviewHint) Q_FLAGS(PreviewHints) - class ReportError : public std::runtime_error{ + class LIMEREPORT_EXPORT ReportError : public std::runtime_error{ public: ReportError(const QString& message); }; - class ReportSettings{ + class LIMEREPORT_EXPORT ReportSettings{ public: ReportSettings():m_suppressAbsentFieldsAndVarsWarnings(false){} void setDefaultValues(){m_suppressAbsentFieldsAndVarsWarnings = false;} @@ -140,13 +140,13 @@ namespace Const{ bool m_suppressAbsentFieldsAndVarsWarnings; }; - class IExternalPainter{ + class LIMEREPORT_EXPORT IExternalPainter{ public: virtual void paintByExternalPainter(const QString& objectName, QPainter* painter, const QStyleOptionGraphicsItem* options) = 0; virtual ~IExternalPainter(); }; - class IPainterProxy{ + class LIMEREPORT_EXPORT IPainterProxy{ public: virtual void setExternalPainter(IExternalPainter* externalPainter) = 0; virtual ~IPainterProxy(); @@ -168,7 +168,7 @@ namespace Const{ #endif - class Enums + class LIMEREPORT_EXPORT Enums { public: enum VariableDataType {Undefined, String, Bool, Int, Real, Date, Time, DateTime}; diff --git a/limereport/lritemscontainerdesignitf.h b/limereport/lritemscontainerdesignitf.h index 483bf95..5a87532 100644 --- a/limereport/lritemscontainerdesignitf.h +++ b/limereport/lritemscontainerdesignitf.h @@ -5,7 +5,7 @@ namespace LimeReport{ -class Segment{ +class LIMEREPORT_EXPORT Segment{ public: Segment(qreal segmentStart,qreal segmentEnd):m_begin(segmentStart),m_end(segmentEnd){} bool intersect(Segment value); @@ -15,17 +15,17 @@ private: qreal m_end; }; -class VSegment : public Segment{ +class LIMEREPORT_EXPORT VSegment : public Segment{ public: VSegment(QRectF rect):Segment(rect.top(),rect.bottom()){} }; -struct HSegment :public Segment{ +struct LIMEREPORT_EXPORT HSegment :public Segment{ public: HSegment(QRectF rect):Segment(rect.left(),rect.right()){} }; -struct ItemSortContainer { +struct LIMEREPORT_EXPORT ItemSortContainer { QRectF m_rect; BaseDesignIntf * m_item; ItemSortContainer(BaseDesignIntf *item){ @@ -35,9 +35,9 @@ struct ItemSortContainer { }; typedef QSharedPointer< ItemSortContainer > PItemSortContainer; -bool itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortContainer c2); +bool LIMEREPORT_EXPORT itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortContainer c2); -class ItemsContainerDesignInft : public BookmarkContainerDesignIntf{ +class LIMEREPORT_EXPORT ItemsContainerDesignInft : public BookmarkContainerDesignIntf{ Q_OBJECT public: ItemsContainerDesignInft(const QString& xmlTypeName, QObject* owner = 0, QGraphicsItem* parent=0): diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index 365c87d..1170a8f 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -39,7 +39,7 @@ namespace LimeReport{ class ReportRender; -class PageItemDesignIntf : public ItemsContainerDesignInft +class LIMEREPORT_EXPORT PageItemDesignIntf : public ItemsContainerDesignInft { Q_OBJECT Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin) diff --git a/limereport/serializators/lrstorageintf.h b/limereport/serializators/lrstorageintf.h index e0ec406..c178bd2 100644 --- a/limereport/serializators/lrstorageintf.h +++ b/limereport/serializators/lrstorageintf.h @@ -30,6 +30,7 @@ #ifndef LRSTORAGEINTF_H #define LRSTORAGEINTF_H +#include "lrglobal.h" #include class QString; @@ -37,14 +38,14 @@ class QObject; namespace LimeReport{ -class ObjectLoadingStateIntf{ +class LIMEREPORT_EXPORT ObjectLoadingStateIntf{ public: virtual bool isLoading() = 0; virtual void objectLoadStarted() = 0; virtual void objectLoadFinished() = 0; }; -class ItemsWriterIntf +class LIMEREPORT_EXPORT ItemsWriterIntf { public: virtual void putItem(QObject* item) = 0; @@ -55,7 +56,7 @@ public: virtual ~ItemsWriterIntf(){} }; -class ItemsReaderIntf +class LIMEREPORT_EXPORT ItemsReaderIntf { public: typedef QSharedPointer Ptr;