diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..1233e7a --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,174 @@ +name: CMake + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + runs-on: ubuntu-${{ matrix.ubuntu_version }} + name: Ubuntu-${{ matrix.ubuntu_version }}-Qt-${{ matrix.qt_version }}-static-${{ matrix.static }} + strategy: + fail-fast: false + matrix: + ubuntu_version: [20.04, 22.04] + 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 }} -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 }} -DLIMEREPORT_DEMO=ON -B "${{github.workspace}}/build" + + - 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 }} -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 }} -DLIMEREPORT_DEMO=ON -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 }} -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 }} -DLIMEREPORT_DEMO=ON -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 }} -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 }} -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/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..8e7bdb0 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +limereport \ No newline at end of file diff --git a/.idea/LimeReport.iml b/.idea/LimeReport.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/LimeReport.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..79b3c94 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..12d65df --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..15885cc --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/limereport/items/lrtextitem.cpp b/limereport/items/lrtextitem.cpp index 6cfd575..749d3a0 100644 --- a/limereport/items/lrtextitem.cpp +++ b/limereport/items/lrtextitem.cpp @@ -514,11 +514,14 @@ TextItem::TextPtr TextItem::textDocument() const QString content = m_trimValue ? m_strText.trimmed() : m_strText; if (allowHTML()) + { if (isReplaceCarriageReturns()){ text->setHtml(replaceReturns(content)); } else { text->setHtml(content); } + + } else text->setPlainText(content); @@ -533,7 +536,7 @@ TextItem::TextPtr TextItem::textDocument() const to.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); else to.setWrapMode(QTextOption::NoWrap); - text->setDocumentMargin(0); + text->setDocumentMargin(marginSize()); text->setDefaultTextOption(to); QFont _font = transformToSceneFont(font()); diff --git a/limereport/lrdatadesignintf.cpp b/limereport/lrdatadesignintf.cpp index f7b3aa2..f7b2b0c 100644 --- a/limereport/lrdatadesignintf.cpp +++ b/limereport/lrdatadesignintf.cpp @@ -99,7 +99,7 @@ bool QueryHolder::runQuery(IDataSource::DatasourceMode mode) if (m_dataSource) m_dataSource.clear(); setLastError(model->lastError().text()); - delete model; + //delete model; return false; } else { setLastError("");} diff --git a/limereport/lrdatasourcemanager.cpp b/limereport/lrdatasourcemanager.cpp index 78c875d..8fd0fcb 100644 --- a/limereport/lrdatasourcemanager.cpp +++ b/limereport/lrdatasourcemanager.cpp @@ -329,6 +329,7 @@ bool DataSourceManager::addModel(const QString &name, QAbstractItemModel *model, } catch (ReportError &e){ putError(e.what()); setLastError(e.what()); + delete model; return false; } emit datasourcesChanged(); diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 39b1e9f..22d01c5 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -968,9 +968,14 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da GroupBandHeader *group = dynamic_cast(parentBand); if(dataSource->model() && group && !group->groupFieldName().isEmpty() && !m_dataSourceSorted) { - dataSource->model()->sort(dataSource->columnIndexByName(group->groupFieldName()),group->SortFieldNameBy()); - qDebug()<<"sorted;"; - m_dataSourceSorted = true; + MasterDetailProxyModel *proxyModel = static_cast(dataSource->model()); + if(proxyModel) + { + proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); + + proxyModel->sort(dataSource->columnIndexByName(group->groupFieldName()),group->SortFieldNameBy()); + m_dataSourceSorted = true; + } } foreach(BandDesignIntf* band,parentBand->childrenByType(BandDesignIntf::GroupHeader)){ diff --git a/translations/limereport_fr.ts b/translations/limereport_fr.ts index 88af34f..dd26c82 100644 --- a/translations/limereport_fr.ts +++ b/translations/limereport_fr.ts @@ -1158,51 +1158,51 @@ p, li { white-space: pre-wrap; } LimeReport::DataSourceManager - + Connection "%1" is not open La connexion "%1" n'est pas ouverte - - - - + + + + Variable "%1" not found! Variable "%1" introuvable! - - + + Unknown parameter "%1" for variable "%2" found! Paramètre inconnu %1 pour la variable %2 ! - - + + Datasource "%1" not found! Source de donnée "%1" introuvable! - + Connection with name "%1" already exists! La connexion avec le nom "%1" existe déjà! - - - - - + + + + + Datasource with name "%1" already exists! La source de donnée avec le nom "%1" existe déjà! - + Database "%1" not found Base de données "%1 introuvable - + invalid connection Connexion invalide @@ -4284,18 +4284,18 @@ Cet aperçu n'est plus valide. Masquer si vide - - + + Error Erreur - + TextItem " %1 " already has folower " %2 " L'élément texte " %1 " a toujours un copain " %2 " - + TextItem " %1 " not found! Elément "%1" introuvable! diff --git a/translations/limereport_pl.ts b/translations/limereport_pl.ts index 96c10d7..68b21be 100644 --- a/translations/limereport_pl.ts +++ b/translations/limereport_pl.ts @@ -1170,51 +1170,51 @@ p, li { white-space: pre-wrap; } LimeReport::DataSourceManager - + Connection "%1" is not open Połączenie "%1" nie jest otwarte - - - - + + + + Variable "%1" not found! Zmienna "%1" nie znaleziona! - - + + Unknown parameter "%1" for variable "%2" found! Nieznany parametr "%1" dla znalezionej zmiennej "%2"! - - + + Datasource "%1" not found! Źródło danych %1" nie znalezione! - + Connection with name "%1" already exists! Połączenie o nazwie "%1" już istnieje! - - - - - + + + + + Datasource with name "%1" already exists! Źródło danych o nazwie "%1" już istnieje! - + Database "%1" not found Baza danych "%1" nie znaleziona - + invalid connection Nieprawidłowe połączenie @@ -4296,18 +4296,18 @@ Ten podgląd nie jest już prawidłowy. Ukryj jeśli pusty - - + + Error Błąd - + TextItem " %1 " already has folower " %2 " Pole tekstowe " %1 " już ma folower " %2 " - + TextItem " %1 " not found! Nie znaleziono pole tekstowego "%1"!