├── .clang-format ├── .clang-tidy ├── .clazy ├── .cmake-format.py ├── .codespellrc ├── .editorconfig ├── .github └── workflows │ ├── build.yml │ ├── nightly.yml │ └── pip-requirements.txt ├── .gitignore ├── .krazy ├── .markdownlint.json ├── .pep8 ├── .pre-commit-config.yaml ├── .pylintrc ├── .shellcheckrc ├── CMakeLists.txt ├── CMakePresets.json ├── INSTALL.txt ├── LICENSE.txt ├── LICENSES ├── BSD-3-Clause.txt └── MIT.txt ├── README-WASM.md ├── README-bindings.md ├── README.md ├── REUSE.toml ├── cmake ├── ECM │ └── modules │ │ ├── BSD-3-Clause.txt │ │ ├── COPYING-CMAKE-SCRIPTS │ │ ├── ECMEnableSanitizers.cmake │ │ ├── ECMGenerateHeaders.cmake │ │ ├── ECMGeneratePriFile.cmake │ │ ├── ECMQueryQmake.cmake │ │ ├── ECMQueryQt.cmake │ │ ├── ECMSetupVersion.cmake │ │ ├── ECMUninstallTarget.cmake │ │ ├── ECMVersionHeader.h.in │ │ ├── QtVersionOption.cmake │ │ └── ecm_uninstall.cmake.in └── KDAB │ └── modules │ ├── FindKDChart.cmake │ ├── FindPySide2.cmake │ ├── FindPySide6.cmake │ ├── FindShiboken2.cmake │ ├── FindShiboken6.cmake │ ├── KDCompilerFlags.cmake │ ├── KDFixupShiboken2.py │ ├── KDFunctions.cmake │ ├── KDInstallLocation.cmake │ ├── KDPySide2ModuleBuild.cmake │ ├── KDPySide6ModuleBuild.cmake │ └── KDQtInstallPaths.cmake ├── conan ├── README.txt └── conanfile.py ├── deploy └── release-kdreports.sh ├── distro ├── debian.changelog ├── debian.compat ├── debian.control ├── qt5-debian.rules ├── qt5-kdreports-rpmlintrc ├── qt5-kdreports.dsc ├── qt5-kdreports.spec ├── qt6-debian.rules ├── qt6-kdreports-rpmlintrc ├── qt6-kdreports.dsc └── qt6-kdreports.spec ├── docs ├── CHANGES_1_1.txt ├── CHANGES_1_2.txt ├── CHANGES_1_3.txt ├── CHANGES_1_4.txt ├── CHANGES_1_5.txt ├── CHANGES_1_6.txt ├── CHANGES_1_7.txt ├── CHANGES_1_8.txt ├── CHANGES_1_9.txt ├── CHANGES_2_0.txt ├── CHANGES_2_1.txt ├── CHANGES_2_2.txt ├── CHANGES_2_3.txt ├── CHANGES_2_4.txt ├── CMakeLists.txt ├── api │ ├── CMakeLists.txt │ ├── Doxyfile.cmake │ ├── doxygen-awesome.css │ ├── footer.html │ └── kdab-logo-22x22.png ├── developer │ ├── branching.md │ ├── prerelease-source.md │ └── release-todo.md └── manual │ └── kdreports.pdf ├── examples ├── BigImage │ ├── BigImage.cpp │ ├── BigImage.qrc │ ├── CMakeLists.txt │ ├── image.jpg │ └── imageTall.jpg ├── CMakeLists.txt ├── ChartXML │ ├── CMakeLists.txt │ ├── Chart.xml │ ├── ChartXML.cpp │ └── ChartXML.qrc ├── Database │ ├── CMakeLists.txt │ └── Database.cpp ├── DatabaseXML │ ├── CMakeLists.txt │ ├── Database.xml │ ├── DatabaseXML.cpp │ └── DatabaseXML.qrc ├── DemoWasm │ ├── CMakeLists.txt │ ├── ResultModel.cpp │ ├── ResultModel.h │ ├── TableModel.cpp │ ├── TableModel.h │ ├── files │ │ ├── 1leftarrow.png │ │ ├── 1rightarrow.png │ │ ├── 2leftarrow.png │ │ ├── 2rightarrow.png │ │ ├── KDReports-Test-NetworkPeripherals.csv │ │ ├── KDReports-Test-PrinterCartridges.csv │ │ ├── MailMerge.xml │ │ ├── PriceList.xml │ │ ├── cr32-device-system.png │ │ ├── kdab.jpg │ │ ├── kdab_small.jpg │ │ ├── logo.png │ │ ├── members.csv │ │ ├── zoom+.png │ │ └── zoom-.png │ ├── kdreports.qrc │ ├── kdreportswindow.cpp │ ├── kdreportswindow.h │ ├── kdreportswindow.ui │ ├── main.cpp │ └── tools_export.h ├── HelloWorld │ ├── CMakeLists.txt │ └── HelloWorld.cpp ├── HelloWorldXML │ ├── CMakeLists.txt │ ├── HelloWorld.xml │ ├── HelloWorldXML.cpp │ └── HelloWorldXML.qrc ├── Labels │ ├── CMakeLists.txt │ └── Labels.cpp ├── Letter │ ├── CMakeLists.txt │ └── Letter.cpp ├── LongTextReport │ ├── CMakeLists.txt │ └── LongTextReport.cpp ├── MailMergeXML │ ├── CMakeLists.txt │ ├── MailMerge.xml │ ├── MailMergeXML.cpp │ ├── MailMergeXML.qrc │ ├── logo.png │ └── members.csv ├── PriceList │ ├── CMakeLists.txt │ ├── KDReports-Test-NetworkPeripherals.csv │ ├── KDReports-Test-PrinterCartridges.csv │ ├── PriceList.cpp │ ├── PriceList.qrc │ ├── cr32-device-system.png │ ├── kdab.jpg │ └── kdab_small.jpg ├── PriceListXML │ ├── CMakeLists.txt │ ├── PriceList.xml │ ├── PriceListXML.cpp │ └── PriceListXML.qrc ├── ReferenceReport │ ├── CMakeLists.txt │ ├── ChartModel.csv │ ├── ReferenceReport.cpp │ ├── ReferenceReport.qrc │ ├── ResultModel.cpp │ ├── ResultModel.h │ └── background.jpg ├── ReportSection │ ├── CMakeLists.txt │ └── ReportSection.cpp ├── SpreadsheetAutoTable │ ├── CMakeLists.txt │ └── SpreadsheetAutoTable.cpp └── tools │ ├── CMakeLists.txt │ ├── TableModel.cpp │ ├── TableModel.h │ └── tools_export.h ├── images ├── kdreports-medium.png ├── kdreports-small.png ├── kdreports-trademark.png ├── kdreports.png └── kdreports.svg ├── kdchart.pri ├── kdreports.bat ├── kdreports.pri ├── pics ├── 1leftarrow.png ├── 1rightarrow.png ├── 2leftarrow.png ├── 2rightarrow.png ├── pics.qrc ├── zoom+.png └── zoom-.png ├── python ├── CMakeLists.txt ├── PyKDReports │ ├── CMakeLists.txt │ ├── __init__.py.cmake │ ├── glue.cpp │ ├── kdreports_global.h │ └── typesystem_kdreports.xml ├── examples-qt6 │ ├── HelloWorld │ │ └── HelloWorld.py │ ├── Labels │ │ └── Labels.py │ └── PriceList │ │ ├── KDReports-Test-NetworkPeripherals.csv │ │ ├── KDReports-Test-PrinterCartridges.csv │ │ ├── PriceList.py │ │ ├── PriceList.qrc │ │ ├── TableModel.py │ │ ├── cr32-device-system.png │ │ ├── kdab.jpg │ │ └── kdab_small.jpg ├── examples │ ├── HelloWorld │ │ └── HelloWorld.py │ ├── Labels │ │ └── Labels.py │ └── PriceList │ │ ├── KDReports-Test-NetworkPeripherals.csv │ │ ├── KDReports-Test-PrinterCartridges.csv │ │ ├── PriceList.py │ │ ├── PriceList.qrc │ │ ├── TableModel.py │ │ ├── cr32-device-system.png │ │ ├── kdab.jpg │ │ └── kdab_small.jpg └── tests │ ├── CMakeLists.txt │ ├── config.py.cmake │ └── tst_importModule.py ├── src ├── CMakeLists.txt ├── KDReports │ ├── KDReports.h │ ├── KDReportsAbstractReportLayout.cpp │ ├── KDReportsAbstractReportLayout_p.h │ ├── KDReportsAbstractTableElement.cpp │ ├── KDReportsAbstractTableElement.h │ ├── KDReportsAutoTableElement.cpp │ ├── KDReportsAutoTableElement.h │ ├── KDReportsCell.cpp │ ├── KDReportsCell.h │ ├── KDReportsChartElement.cpp │ ├── KDReportsChartElement.h │ ├── KDReportsChartTextObject.cpp │ ├── KDReportsChartTextObject_p.h │ ├── KDReportsElement.cpp │ ├── KDReportsElement.h │ ├── KDReportsElementData_p.h │ ├── KDReportsErrorDetails.cpp │ ├── KDReportsErrorDetails.h │ ├── KDReportsErrorDetails_p.h │ ├── KDReportsFontScaler.cpp │ ├── KDReportsFontScaler_p.h │ ├── KDReportsFrame.cpp │ ├── KDReportsFrame.h │ ├── KDReportsGlobal.h │ ├── KDReportsHLineElement.cpp │ ├── KDReportsHLineElement.h │ ├── KDReportsHLineTextObject.cpp │ ├── KDReportsHLineTextObject_p.h │ ├── KDReportsHeader.cpp │ ├── KDReportsHeader.h │ ├── KDReportsHeader_p.h │ ├── KDReportsHtmlElement.cpp │ ├── KDReportsHtmlElement.h │ ├── KDReportsImageElement.cpp │ ├── KDReportsImageElement.h │ ├── KDReportsLayoutHelper.cpp │ ├── KDReportsLayoutHelper_p.h │ ├── KDReportsMainTable.cpp │ ├── KDReportsMainTable.h │ ├── KDReportsPreviewDialog.cpp │ ├── KDReportsPreviewDialog.h │ ├── KDReportsPreviewWidget.cpp │ ├── KDReportsPreviewWidget.h │ ├── KDReportsReport.cpp │ ├── KDReportsReport.h │ ├── KDReportsReportBuilder.cpp │ ├── KDReportsReportBuilder_p.h │ ├── KDReportsReport_p.h │ ├── KDReportsSpreadsheetReportLayout.cpp │ ├── KDReportsSpreadsheetReportLayout_p.h │ ├── KDReportsTableBreakingLogic.cpp │ ├── KDReportsTableBreakingLogic_p.h │ ├── KDReportsTableBreakingSettingsDialog.cpp │ ├── KDReportsTableBreakingSettingsDialog.h │ ├── KDReportsTableElement.cpp │ ├── KDReportsTableElement.h │ ├── KDReportsTableLayout.cpp │ ├── KDReportsTableLayout_p.h │ ├── KDReportsTextDocReportLayout.cpp │ ├── KDReportsTextDocReportLayout_p.h │ ├── KDReportsTextDocument.cpp │ ├── KDReportsTextDocumentData.cpp │ ├── KDReportsTextDocumentData_p.h │ ├── KDReportsTextDocument_p.h │ ├── KDReportsTextElement.cpp │ ├── KDReportsTextElement.h │ ├── KDReportsUnit.h │ ├── KDReportsVariableType.h │ ├── KDReportsXmlElementHandler.cpp │ ├── KDReportsXmlElementHandler.h │ ├── KDReportsXmlHelper.cpp │ ├── KDReportsXmlHelper.h │ ├── KDReportsXmlParser.cpp │ ├── KDReportsXmlParser_p.h │ ├── previewdialogbase.ui │ └── tablebreakingdialogbase.ui └── KDReportsConfig.cmake.in ├── translations └── kdreports_fr_FR.ts └── unittests ├── CMakeLists.txt ├── ElementCopying ├── CMakeLists.txt └── ElementCopying.cpp ├── Headers ├── CMakeLists.txt ├── Headers.cpp └── Headers.qrc ├── InThread ├── CMakeLists.txt ├── InThread.cpp ├── PriceList.xml └── resources.qrc ├── PageLayout ├── CMakeLists.txt └── PageLayout.cpp ├── SpreadsheetMode ├── CMakeLists.txt └── SpreadsheetMode.cpp ├── TableBreakingLogic ├── CMakeLists.txt └── TableBreakingTest.cpp ├── TextDocument ├── CMakeLists.txt └── TextDocument.cpp ├── XmlParser ├── CMakeLists.txt ├── TestXmlElementHandler.cpp ├── TestXmlElementHandler.h ├── XmlParser.cpp ├── XmlParser.qrc ├── broken.xml ├── doc_footer.xml ├── doc_header.xml ├── fonts.xml ├── handler.xml ├── handlerWithError.xml ├── htmlid.xml ├── margins.xml ├── simple.xml ├── spreadsheet.xml ├── tabs.xml ├── textid.xml ├── vspaceInHeader.xml └── wrongTopElement.xml └── runTest.bat /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Json 3 | DisableFormat: true 4 | --- 5 | BasedOnStyle: WebKit 6 | Language: Cpp 7 | Standard: Cpp11 8 | 9 | IndentWidth: 4 10 | SpacesBeforeTrailingComments: 1 11 | TabWidth: 8 12 | UseTab: Never 13 | ContinuationIndentWidth: 4 14 | MaxEmptyLinesToKeep: 3 15 | BreakBeforeBinaryOperators: NonAssignment 16 | BreakBeforeTernaryOperators: true 17 | BreakConstructorInitializers: BeforeColon 18 | BreakConstructorInitializersBeforeComma: true 19 | 20 | BreakBeforeBraces: Custom 21 | BraceWrapping: 22 | AfterClass: true 23 | AfterControlStatement: false 24 | AfterEnum: true 25 | AfterFunction: true 26 | AfterNamespace: false 27 | AfterObjCDeclaration: false 28 | AfterStruct: true 29 | AfterUnion: false 30 | BeforeCatch: false 31 | BeforeElse: false 32 | IndentBraces: false 33 | 34 | ForEachMacros: 35 | - forever # avoids { wrapped to next line 36 | - foreach 37 | - Q_FOREACH 38 | 39 | AccessModifierOffset: -4 40 | ConstructorInitializerIndentWidth: 4 41 | AlignEscapedNewlinesLeft: false 42 | AlignTrailingComments: false 43 | AllowAllParametersOfDeclarationOnNextLine: true 44 | AllowShortIfStatementsOnASingleLine: false 45 | AllowShortLoopsOnASingleLine: false 46 | AllowShortFunctionsOnASingleLine: false 47 | AllowShortEnumsOnASingleLine: false # requires clang-format 11 48 | AlignAfterOpenBracket: true 49 | AlwaysBreakBeforeMultilineStrings: false 50 | AlwaysBreakTemplateDeclarations: true 51 | BinPackParameters: true 52 | ColumnLimit: 0 53 | Cpp11BracedListStyle: true 54 | DerivePointerBinding: false 55 | ExperimentalAutoDetectBinPacking: false 56 | IndentCaseLabels: false 57 | NamespaceIndentation: None 58 | ObjCSpaceBeforeProtocolList: true 59 | PenaltyBreakBeforeFirstCallParameter: 19 60 | PenaltyBreakComment: 60 61 | PenaltyBreakFirstLessLess: 120 62 | PenaltyBreakString: 1000 63 | PenaltyExcessCharacter: 1000000 64 | PenaltyReturnTypeOnItsOwnLine: 60 65 | PointerBindsToType: false 66 | SpaceAfterTemplateKeyword: false 67 | IndentFunctionDeclarationAfterType: false 68 | SpaceAfterControlStatementKeyword: true 69 | SpaceBeforeAssignmentOperators: true 70 | SpaceInEmptyParentheses: false 71 | SpacesInAngles: false 72 | SpacesInCStyleCastParentheses: true 73 | SpacesInParentheses: false 74 | ... 75 | -------------------------------------------------------------------------------- /.clang-tidy: -------------------------------------------------------------------------------- 1 | --- 2 | Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,*,-google-*,-cppcoreguidelines-*,-readability-else-after-return,-readability-implicit-bool-cast,-llvm-include-order,-readability-named-parameter,-readabilty-namespace-comments,-llvm-namespace-comment,-clang-analyzer-alpha.core.CastToStruct,-modernize-use-override,-modernize-use-bool-literals,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-alpha.deadcode.UnreachableCode,-modernize-use-default,-clang-analyzer-core.CallAndMessage,-modernize-pass-by-value,-clang-analyzer-core.NonNullParamChecker,-modernize-raw-string-literal,-modernize-use-using,-modernize-loop-convert,-modernize-use-emplace,-modernize-return-braced-init-list,-modernize-use-default-member-init,-modernize-use-equals-default,-fuchsia-*,-hicpp-*,-readability-implicit-bool-conversion,-llvm-*,-llvmlibc-*,-modernize-use-trailing-return-type,-readability-magic-numbers,-readability-qualified-auto,-clang-diagnostic-gnu-zero-variadic-macro-arguments,-android-*,-misc-no-recursion,-modernize-avoid-c-arrays,-misc-non-private-member-variables-in-classes,-readability-redundant-access-specifiers' 3 | WarningsAsErrors: '' 4 | HeaderFilterRegex: '' 5 | CheckOptions: 6 | - key: cert-oop11-cpp.UseCERTSemantics 7 | value: '1' 8 | - key: modernize-loop-convert.MaxCopySize 9 | value: '16' 10 | - key: modernize-loop-convert.MinConfidence 11 | value: reasonable 12 | - key: modernize-loop-convert.NamingStyle 13 | value: CamelCase 14 | - key: modernize-pass-by-value.IncludeStyle 15 | value: llvm 16 | - key: modernize-replace-auto-ptr.IncludeStyle 17 | value: llvm 18 | - key: modernize-use-nullptr.NullMacros 19 | value: 'NULL' 20 | - key: readability-braces-around-statements.ShortStatementLines 21 | value: '3' 22 | ... 23 | -------------------------------------------------------------------------------- /.clazy: -------------------------------------------------------------------------------- 1 | #do not report clazy results for these subdirs 2 | #SKIP whatever 3 | 4 | #clazy checks specification 5 | CHECKS level2,no-qstring-ref,no-qproperty-without-notify,no-qstring-allocations 6 | -------------------------------------------------------------------------------- /.codespellrc: -------------------------------------------------------------------------------- 1 | [codespell] 2 | skip = *.ts,./build-*,.git 3 | interactive = 3 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.sh] 2 | indent_style = space 3 | indent_size = 2 4 | -------------------------------------------------------------------------------- /.github/workflows/nightly.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: Tidy / Clazy / cppcheck 6 | 7 | on: 8 | workflow_dispatch: 9 | schedule: 10 | - cron: '0 3 * * *' 11 | 12 | jobs: 13 | build: 14 | runs-on: ${{ matrix.os }} 15 | strategy: 16 | fail-fast: true 17 | matrix: 18 | os: 19 | - ubuntu-latest 20 | 21 | config: 22 | - name: clang-tidy 23 | preset: clang-tidy 24 | qt_version: "6.6.0" 25 | 26 | - name: clazy 27 | preset: clazy 28 | qt_version: "6.6.0" 29 | apt_pgks: 30 | - clazy 31 | - cppcheck 32 | 33 | steps: 34 | - name: Install Qt ${{ matrix.config.qt_version }} with options and default aqtversion 35 | uses: jurplel/install-qt-action@v3 36 | with: 37 | version: ${{ matrix.config.qt_version }} 38 | cache: true 39 | 40 | - name: Install ninja-build tool (must be after Qt due PATH changes) 41 | uses: turtlesec-no/get-ninja@main 42 | 43 | - name: Install dependencies on Ubuntu (${{ join(matrix.config.apt_pgks, ' ') }}) 44 | if: ${{ runner.os == 'Linux' && matrix.config.apt_pgks }} 45 | run: | 46 | sudo apt update -qq 47 | echo ${{ join(matrix.config.apt_pgks, ' ') }} | xargs sudo apt install -y 48 | 49 | - uses: actions/checkout@v4 50 | #with: 51 | #ref: '2.0' # schedule.cron do not allow branch setting 52 | 53 | - name: Make sure MSVC is found when Ninja generator is in use 54 | if: ${{ runner.os == 'Windows' }} 55 | uses: ilammy/msvc-dev-cmd@v1 56 | 57 | - name: Configure project 58 | run: cmake --preset=${{ matrix.config.preset }} 59 | 60 | - name: Build Project 61 | id: ctest 62 | run: cmake --build --preset=${{ matrix.config.preset }} 63 | 64 | - name: Read tests log when it fails 65 | uses: andstor/file-reader-action@v1 66 | if: ${{ steps.ctest.conclusion == 'failure' }} 67 | with: 68 | path: "./build/Testing/Temporary/LastTest.log" 69 | 70 | - name: Run cppcheck 71 | if: ${{ matrix.config.preset == 'clazy' }} 72 | run: cmake --build --preset=${{ matrix.config.preset }} --target cppcheck 73 | -------------------------------------------------------------------------------- /.github/workflows/pip-requirements.txt: -------------------------------------------------------------------------------- 1 | shiboken6-generator == 6.6.0 2 | pyside6 == 6.6.0 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.moc 2 | *.obj 3 | *.o 4 | *.app 5 | *.user 6 | *.rej 7 | 8 | moc_*.cpp 9 | ui_*.h 10 | qrc_*.cpp 11 | 12 | *.pyc 13 | 14 | *-e 15 | 16 | rc_price_list.py 17 | CPackConfig.cmake 18 | 19 | configure.sh 20 | configure.bat 21 | 22 | bin/ 23 | lib/ 24 | include/ 25 | unittests/ElementCopying/ElementCopying 26 | unittests/Headers/Headers 27 | unittests/InThread/InThread 28 | unittests/ModelInfo/ModelInfo 29 | unittests/PageLayout/PageLayout 30 | unittests/SpreadsheetMode/SpreadsheetMode 31 | unittests/TableBreakingLogic/TableBreakingLogic 32 | unittests/TextDocument/TextDocument 33 | unittests/XmlParser/XmlParser 34 | ReportEditor/unittests/DocumentModification/DocumentModification 35 | ReportEditor/unittests/IdAssociation/IdAssociation 36 | ReportEditor/unittests/ModelAssociation/ModelAssociation 37 | ReportEditor/unittests/ModelInfo/ModelInfo 38 | ReportEditor/unittests/Paragraph/Paragraph 39 | ReportEditor/unittests/Property/Property 40 | ReportEditor/unittests/ReportObjectXmlHandler/ReportObjectXmlHandler 41 | ReportEditor/unittests/ReportTextEditor/ReportTextEditor 42 | ReportEditor/unittests/Table/Table 43 | ReportEditor/unittests/XmlSaving/XmlSaving 44 | 45 | Makefile* 46 | 47 | internal/tests/qttests/qttests 48 | 49 | kdreports-*-doc.zip 50 | kdreports-*.tar.gz 51 | kdreports-*.tar.gz.asc 52 | kdreports-*.zip 53 | kdreports-*.zip.asc 54 | 55 | build*/ 56 | -------------------------------------------------------------------------------- /.krazy: -------------------------------------------------------------------------------- 1 | CHECKSETS qt5,c++,foss 2 | 3 | #KDAB-specific checks 4 | EXTRA kdabcopyright-reuse,fosslicense-reuse 5 | 6 | #exclude checks now being done by clazy or clang-tools 7 | EXCLUDE includes,strings,explicit,normalize,passbyvalue,operators,nullstrcompare,nullstrassign,doublequote_chars,qobject,sigsandslots,staticobjects,cpp 8 | #exclude more checks 9 | EXCLUDE qminmax,captruefalse,dpointer,inline,constref 10 | #exclude spelling as codespell is much, much better tool 11 | EXCLUDE spelling 12 | EXCLUDE style 13 | 14 | #skip the combined header 15 | SKIP /src/KDReports/KDReports.h 16 | 17 | #skip other cmake 18 | SKIP Doxyfile.cmake 19 | SKIP \.cmake-format\.py 20 | #skip the borrowed code in the cmake subdir 21 | SKIP /cmake/ECM/|/cmake/KDAB/ 22 | SKIP .markdownlint.json 23 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "MD007": { 4 | "indent": 2, 5 | "start_indented": false 6 | }, 7 | "MD013": { 8 | "line_length": 100, 9 | "tables": false, 10 | "code_blocks": false 11 | }, 12 | "MD029": { 13 | "style": "ordered" 14 | }, 15 | "MD033": false 16 | } 17 | -------------------------------------------------------------------------------- /.pep8: -------------------------------------------------------------------------------- 1 | [pycodestyle] 2 | max_line_length = 120 3 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # See https://pre-commit.com for more information 2 | # See https://pre-commit.com/hooks.html for more hooks 3 | ci: 4 | autoupdate_schedule: monthly 5 | 6 | exclude: ^(cmake/ECM/|cmake/KDAB/|docs/api/doxygen-awesome.css) 7 | repos: 8 | - repo: https://github.com/pre-commit/pre-commit-hooks 9 | rev: v5.0.0 10 | hooks: 11 | - id: trailing-whitespace 12 | - id: end-of-file-fixer 13 | - id: check-added-large-files 14 | - id: check-case-conflict 15 | - id: check-xml 16 | exclude: unittests/XmlParser/broken.xml 17 | - id: check-yaml 18 | args: [--allow-multiple-documents] 19 | - id: check-json 20 | - id: check-symlinks 21 | - id: destroyed-symlinks 22 | - id: check-executables-have-shebangs 23 | - repo: https://github.com/pre-commit/mirrors-clang-format 24 | rev: v19.1.7 25 | hooks: 26 | - id: clang-format 27 | - repo: https://github.com/PyCQA/pylint 28 | rev: v3.3.4 29 | hooks: 30 | - id: pylint 31 | exclude: ^(.cmake-format.py|conan/conanfile.py) 32 | - repo: https://github.com/hhatto/autopep8 33 | rev: v2.3.2 34 | hooks: 35 | - id: autopep8 36 | exclude: ^(.cmake-format.py|conan/conanfile.py) 37 | - repo: https://github.com/codespell-project/codespell 38 | rev: v2.4.1 39 | hooks: 40 | - id: codespell 41 | - repo: https://github.com/cheshirekow/cmake-format-precommit 42 | rev: v0.6.13 43 | hooks: 44 | - id: cmake-lint 45 | exclude: (.py.cmake|Doxyfile.cmake) 46 | - id: cmake-format 47 | exclude: (.py.cmake|Doxyfile.cmake) 48 | - repo: https://github.com/DavidAnson/markdownlint-cli2 49 | rev: v0.17.2 50 | hooks: 51 | - id: markdownlint-cli2 52 | files: \.(md|mdown|markdown)$ 53 | - repo: https://github.com/fsfe/reuse-tool 54 | rev: v5.0.2 55 | hooks: 56 | - id: reuse 57 | - repo: https://github.com/scop/pre-commit-shfmt 58 | rev: v3.10.0-2 59 | hooks: 60 | - id: shfmt 61 | - repo: https://github.com/shellcheck-py/shellcheck-py 62 | rev: v0.10.0.1 63 | hooks: 64 | - id: shellcheck 65 | -------------------------------------------------------------------------------- /.shellcheckrc: -------------------------------------------------------------------------------- 1 | #disable=SC2006 2 | disable=SC2233 3 | -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version":2, 3 | "configurePresets":[ 4 | { 5 | "name":"base", 6 | "generator":"Ninja", 7 | "binaryDir":"${sourceDir}/build-${presetName}", 8 | "hidden":true, 9 | "cacheVariables":{ 10 | "CMAKE_EXPORT_COMPILE_COMMANDS":"ON" 11 | }, 12 | "warnings":{ 13 | "uninitialized":true 14 | }, 15 | "errors":{ 16 | "dev":true 17 | } 18 | }, 19 | { 20 | "name":"dev", 21 | "description":"Simple development preset", 22 | "inherits":[ 23 | "base" 24 | ], 25 | "cacheVariables":{ 26 | "CMAKE_BUILD_TYPE":"Debug", 27 | "KDReports_TESTS":"ON", 28 | "KDReports_QT6":"ON" 29 | } 30 | }, 31 | { 32 | "name":"dev-asan", 33 | "description":"Simple development preset with sanitizers", 34 | "generator":"Ninja", 35 | "binaryDir":"${sourceDir}/build-dev-asan", 36 | "cacheVariables":{ 37 | "ECM_ENABLE_SANITIZERS":"'address;undefined'" 38 | }, 39 | "inherits":"dev" 40 | }, 41 | { 42 | "name":"dev-profiling", 43 | "description":"Simple development preset with optimizations and debug symbols", 44 | "generator":"Ninja", 45 | "binaryDir":"${sourceDir}/build-dev-profiling", 46 | "cacheVariables":{ 47 | "CMAKE_BUILD_TYPE":"RelWithDebInfo", 48 | "CMAKE_EXPORT_COMPILE_COMMANDS":"ON", 49 | "KDReports_QT6":"ON" 50 | } 51 | }, 52 | { 53 | "name":"clazy", 54 | "inherits":"dev", 55 | "cacheVariables":{ 56 | "KDReports_EXAMPLES":"OFF", 57 | "KDReports_TESTS":"OFF", 58 | "CMAKE_COMPILE_WARNING_AS_ERROR":"ON" 59 | }, 60 | "environment":{ 61 | "CXX":"clazy", 62 | "CCACHE_DISABLE":"ON" 63 | } 64 | }, 65 | { 66 | "name":"clang-tidy", 67 | "inherits":"dev", 68 | "cacheVariables":{ 69 | "KDReports_EXAMPLES":"OFF", 70 | "KDReports_TESTS":"OFF", 71 | "CMAKE_CXX_CLANG_TIDY":"clang-tidy" 72 | } 73 | }, 74 | { 75 | "name":"release", 76 | "inherits":"base", 77 | "cacheVariables":{ 78 | "CMAKE_BUILD_TYPE":"Release" 79 | } 80 | } 81 | ], 82 | "buildPresets":[ 83 | { 84 | "name":"clazy", 85 | "configurePreset":"clazy", 86 | "environment":{ 87 | "CLAZY_CHECKS":"level2,no-qstring-allocations,no-fully-qualified-moc-types,no-copyable-polymorphic", 88 | "CCACHE_DISABLE":"ON" 89 | } 90 | }, 91 | { 92 | "name":"clang-tidy", 93 | "configurePreset":"clang-tidy" 94 | } 95 | ] 96 | } 97 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | License 2 | ======= 3 | The KD Reports Software is © 2007 Klarälvdalens Datakonsult AB (KDAB), 4 | and is available under the terms of the MIT license. 5 | 6 | See the full license text in the LICENSES folder. 7 | -------------------------------------------------------------------------------- /LICENSES/BSD-3-Clause.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) . All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, 4 | are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, 7 | this list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | 3. Neither the name of the copyright holder nor the names of its contributors 14 | may be used to endorse or promote products derived from this software without 15 | specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 26 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README-WASM.md: -------------------------------------------------------------------------------- 1 | # KDReports with WebAssembly 2 | 3 | ## Demo 4 | 5 | A demo is available at . 6 | 7 | ## Build tips for KDReports 8 | 9 | - Visit if you haven't yet 10 | 11 | - Open a terminal suitable for WASM development (with the correct Qt and toolchain in PATH, etc) 12 | 13 | - KDReports can be built with: 14 | 15 | ```bash 16 | cmake \ 17 | -DCMAKE_TOOLCHAIN_FILE=/usr/local/emsdk-1.39.8/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake 18 | -DCMAKE_FIND_ROOT_PATH=~/Qt/5.15.1/wasm_32/ -DCMAKE_BUILD_TYPE=Release` 19 | (Adapt the paths to your own situation) 20 | ``` 21 | 22 | ## Builds tips for your own app == 23 | 24 | - Link to KDReports (libkdreports.a, or similar) 25 | -------------------------------------------------------------------------------- /REUSE.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | SPDX-PackageName = "KDReports" 3 | SPDX-PackageSupplier = "" 4 | SPDX-PackageDownloadLocation = "https://www.github.com/KDAB/KDReports" 5 | 6 | #misc source code 7 | [[annotations]] 8 | path = ["**.qrc", "**.ui", "**.xml", "**.csv", "**.bat", "**.ts", "**.json"] 9 | precedence = "aggregate" 10 | SPDX-FileCopyrightText = "Klarälvdalens Datakonsult AB, a KDAB Group company " 11 | SPDX-License-Identifier = "MIT" 12 | 13 | #artwork 14 | [[annotations]] 15 | path = ["images/**.png", "images/**.svg", "docs/api/**.png", "pics/**.png", "examples/**/**.png", "examples/**/**.jpg", "python/examples/**/**.jpg", "python/examples/**/**.png", "python/examples-qt6/**.jpg", "python/examples-qt6/**/**.png"] 16 | precedence = "aggregate" 17 | SPDX-FileCopyrightText = "Klarälvdalens Datakonsult AB, a KDAB Group company " 18 | SPDX-License-Identifier = "MIT" 19 | 20 | #misc documentation 21 | [[annotations]] 22 | path = ["**md", "**.txt", "**.html", "docs/manual/**.pdf"] 23 | precedence = "aggregate" 24 | SPDX-FileCopyrightText = "Klarälvdalens Datakonsult AB, a KDAB Group company " 25 | SPDX-License-Identifier = "MIT" 26 | 27 | #misc config files 28 | [[annotations]] 29 | path = [".pre-commit-config.yaml", ".codespellrc", ".krazy", ".cmake-format.py", ".clang-format", ".clang-tidy", ".clazy", ".gitignore", ".markdownlint.json", ".pep8", ".pylintrc", ".editorconfig", ".shellcheckrc", "docs/api/Doxyfile.cmake", "distro/**", "REUSE.toml"] 30 | precedence = "aggregate" 31 | SPDX-FileCopyrightText = "Klarälvdalens Datakonsult AB, a KDAB Group company " 32 | SPDX-License-Identifier = "BSD-3-Clause" 33 | 34 | #3rdparty 35 | [[annotations]] 36 | path = "cmake/ECM/modules/**" 37 | precedence = "aggregate" 38 | SPDX-FileCopyrightText = "The KDE Project" 39 | SPDX-License-Identifier = "BSD-3-Clause" 40 | 41 | # doxygen awesome 42 | [[annotations]] 43 | path = "docs/api/doxygen-awesome.css" 44 | precedence = "aggregate" 45 | SPDX-FileCopyrightText = "2021 - 2023 jothepro" 46 | SPDX-License-Identifier = "MIT" 47 | -------------------------------------------------------------------------------- /cmake/ECM/modules/BSD-3-Clause.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) . All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, 4 | are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, 7 | this list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | 3. Neither the name of the copyright holder nor the names of its contributors 14 | may be used to endorse or promote products derived from this software without 15 | specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 26 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /cmake/ECM/modules/COPYING-CMAKE-SCRIPTS: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions 3 | are met: 4 | 5 | 1. Redistributions of source code must retain the copyright 6 | notice, this list of conditions and the following disclaimer. 7 | 2. Redistributions in binary form must reproduce the copyright 8 | notice, this list of conditions and the following disclaimer in the 9 | documentation and/or other materials provided with the distribution. 10 | 3. The name of the author may not be used to endorse or promote products 11 | derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /cmake/ECM/modules/ECMQueryQmake.cmake: -------------------------------------------------------------------------------- 1 | if (${ECM_GLOBAL_FIND_VERSION} VERSION_GREATER_EQUAL 5.93) 2 | message(DEPRECATION "ECMQueryQmake.cmake is deprecated since 5.93, please use ECMQueryQt.cmake instead.") 3 | endif() 4 | 5 | include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake) 6 | find_package(Qt${QT_MAJOR_VERSION}Core QUIET) 7 | 8 | if (Qt5Core_FOUND) 9 | set(_qmake_executable_default "qmake-qt5") 10 | endif () 11 | if (TARGET Qt5::qmake) 12 | get_target_property(_qmake_executable_default Qt5::qmake LOCATION) 13 | endif() 14 | set(QMAKE_EXECUTABLE ${_qmake_executable_default} 15 | CACHE FILEPATH "Location of the Qt5 qmake executable") 16 | 17 | # Helper method 18 | # This is not public API (yet)! 19 | # Usage: query_qmake( [TRY]) 20 | # Passing TRY will result in the method not failing fatal if no qmake executable 21 | # has been found, but instead simply returning an empty string 22 | function(query_qmake result_variable qt_variable) 23 | set(options TRY) 24 | set(oneValueArgs ) 25 | set(multiValueArgs ) 26 | 27 | cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) 28 | 29 | if(NOT QMAKE_EXECUTABLE) 30 | if(ARGS_TRY) 31 | set(${result_variable} "" PARENT_SCOPE) 32 | message(STATUS "No qmake Qt5 binary found. Can't check ${qt_variable}") 33 | return() 34 | else() 35 | message(FATAL_ERROR "No qmake Qt5 binary found. Can't check ${qt_variable} as required") 36 | endif() 37 | endif() 38 | execute_process( 39 | COMMAND ${QMAKE_EXECUTABLE} -query "${qt_variable}" 40 | RESULT_VARIABLE return_code 41 | OUTPUT_VARIABLE output 42 | ) 43 | if(return_code EQUAL 0) 44 | string(STRIP "${output}" output) 45 | file(TO_CMAKE_PATH "${output}" output_path) 46 | set(${result_variable} "${output_path}" PARENT_SCOPE) 47 | else() 48 | message(WARNING "Failed call: ${QMAKE_EXECUTABLE} -query \"${qt_variable}\"") 49 | message(FATAL_ERROR "QMake call failed: ${return_code}") 50 | endif() 51 | endfunction() 52 | -------------------------------------------------------------------------------- /cmake/ECM/modules/ECMUninstallTarget.cmake: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2015 Alex Merry 2 | # 3 | # SPDX-License-Identifier: BSD-3-Clause 4 | 5 | #[=======================================================================[.rst: 6 | ECMUninstallTarget 7 | ------------------ 8 | 9 | Add an ``uninstall`` target. 10 | 11 | By including this module, an ``uninstall`` target will be added to your CMake 12 | project. This will remove all files installed (or updated) by a previous 13 | invocation of the ``install`` target. It will not remove files created or 14 | modified by an ``install(SCRIPT)`` or ``install(CODE)`` command; you should 15 | create a custom uninstallation target for these and use ``add_dependency`` to 16 | make the ``uninstall`` target depend on it: 17 | 18 | .. code-block:: cmake 19 | 20 | include(ECMUninstallTarget) 21 | install(SCRIPT install-foo.cmake) 22 | add_custom_target(uninstall_foo COMMAND ${CMAKE_COMMAND} -P uninstall-foo.cmake) 23 | add_dependency(uninstall uninstall_foo) 24 | 25 | The target will fail if the ``install`` target has not yet been run (so it is 26 | not possible to run CMake on the project and then immediately run the 27 | ``uninstall`` target). 28 | 29 | .. warning:: 30 | 31 | CMake deliberately does not provide an ``uninstall`` target by default on 32 | the basis that such a target has the potential to remove important files 33 | from a user's computer. Use with caution. 34 | 35 | Since 1.7.0. 36 | #]=======================================================================] 37 | 38 | if (NOT TARGET uninstall) 39 | configure_file( 40 | "${CMAKE_CURRENT_LIST_DIR}/ecm_uninstall.cmake.in" 41 | "${CMAKE_BINARY_DIR}/ecm_uninstall.cmake" 42 | IMMEDIATE 43 | @ONLY 44 | ) 45 | 46 | add_custom_target(uninstall 47 | COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/ecm_uninstall.cmake" 48 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" 49 | ) 50 | endif() 51 | -------------------------------------------------------------------------------- /cmake/ECM/modules/ECMVersionHeader.h.in: -------------------------------------------------------------------------------- 1 | // This file was generated by ecm_setup_version(): DO NOT EDIT! 2 | 3 | #ifndef @HEADER_PREFIX@_VERSION_H 4 | #define @HEADER_PREFIX@_VERSION_H 5 | 6 | #define @HEADER_PREFIX@_VERSION_STRING "@HEADER_VERSION@" 7 | #define @HEADER_PREFIX@_VERSION_MAJOR @HEADER_VERSION_MAJOR@ 8 | #define @HEADER_PREFIX@_VERSION_MINOR @HEADER_VERSION_MINOR@ 9 | #define @HEADER_PREFIX@_VERSION_PATCH @HEADER_VERSION_PATCH@ 10 | #define @HEADER_PREFIX@_VERSION @HEADER_PREFIX@_VERSION_CHECK(@HEADER_PREFIX@_VERSION_MAJOR, @HEADER_PREFIX@_VERSION_MINOR, @HEADER_PREFIX@_VERSION_PATCH) 11 | 12 | /* 13 | for example: @HEADER_PREFIX@_VERSION >= @HEADER_PREFIX@_VERSION_CHECK(1, 2, 2)) 14 | */ 15 | #define @HEADER_PREFIX@_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /cmake/ECM/modules/QtVersionOption.cmake: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Volker Krause 2 | # 3 | # SPDX-License-Identifier: BSD-3-Clause 4 | 5 | #[=======================================================================[.rst: 6 | QtVersionOption 7 | --------------- 8 | 9 | Adds a build option to select the major Qt version if necessary, 10 | that is, if the major Qt version has not yet been determined otherwise 11 | (e.g. by a corresponding ``find_package()`` call). 12 | This module is typically included by other modules requiring knowledge 13 | about the major Qt version. 14 | 15 | If the ECM version passed to find_package was at least 5.240.0 Qt6 is picked by default. 16 | Otherwise Qt5 is picked. 17 | 18 | ``QT_MAJOR_VERSION`` is defined to either be "5" or "6". 19 | 20 | Since 5.82.0. 21 | #]=======================================================================] 22 | 23 | if (DEFINED QT_MAJOR_VERSION) 24 | return() 25 | endif() 26 | 27 | if (TARGET Qt5::Core) 28 | set(QT_MAJOR_VERSION 5) 29 | elseif (TARGET Qt6::Core) 30 | set(QT_MAJOR_VERSION 6) 31 | else() 32 | if (ECM_GLOBAL_FIND_VERSION VERSION_GREATER_EQUAL 5.240) 33 | option(BUILD_WITH_QT6 "Build against Qt 6" ON) 34 | else() 35 | option(BUILD_WITH_QT6 "Build against Qt 6" OFF) 36 | endif() 37 | 38 | if (BUILD_WITH_QT6) 39 | set(QT_MAJOR_VERSION 6) 40 | else() 41 | set(QT_MAJOR_VERSION 5) 42 | endif() 43 | endif() 44 | -------------------------------------------------------------------------------- /cmake/ECM/modules/ecm_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") 3 | endif() 4 | 5 | file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 9 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if(NOT "${rm_retval}" STREQUAL 0) 16 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 17 | endif() 18 | else() 19 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 20 | endif() 21 | endforeach() 22 | -------------------------------------------------------------------------------- /cmake/KDAB/modules/FindKDChart.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # This module finds if KDChart is installed. 3 | # 4 | # KDChart_FOUND - Set to TRUE if KDChart was found. 5 | # KDChart_LIBRARIES - Path to KDChart libraries. 6 | # KDChart_INCLUDE_DIR - Path to the KDChart include directory. 7 | # 8 | # SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB, a KDAB Group company 9 | # 10 | # SPDX-License-Identifier: BSD-3-Clause 11 | # 12 | 13 | include(FindPackageHandleStandardArgs) 14 | 15 | find_library( 16 | KDChart_LIBRARIES 17 | NAMES KDChart 18 | kdchart 19 | kdchart2 20 | kdchartd2 21 | NAMES_PER_DIR 22 | HINTS ${KDChart_DIR} ENV KDChart_DIR 23 | PATH_SUFFIXES lib 24 | ) 25 | 26 | find_path( 27 | KDChart_INCLUDE_DIR 28 | NAMES KDChartGlobal.h 29 | HINTS ${KDChart_DIR} ENV KDChart_DIR 30 | PATH_SUFFIXES include include/KDChart 31 | ) 32 | 33 | mark_as_advanced(KDChart_LIBRARIES KDChart_INCLUDE_DIR) 34 | 35 | find_package_handle_standard_args(KDChart DEFAULT_MSG KDChart_LIBRARIES KDChart_INCLUDE_DIR) 36 | 37 | if(KDChart_FOUND) 38 | add_library(KDChart UNKNOWN IMPORTED) 39 | set_target_properties( 40 | KDChart PROPERTIES IMPORTED_LOCATION ${KDChart_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES ${KDChart_INCLUDE_DIR} 41 | ) 42 | endif() 43 | -------------------------------------------------------------------------------- /cmake/KDAB/modules/KDFixupShiboken2.py: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | # Author: Renato Araujo Oliveira Filho 4 | # 5 | # SPDX-License-Identifier: BSD-3-Clause 6 | # 7 | 8 | """ 9 | Script to fix bugs in code generated by shiboken-generator vr2 10 | """ 11 | 12 | import sys 13 | import re 14 | 15 | 16 | def removeExtraNamespaceForDefaultEnumValue(filename): 17 | """ 18 | Remove namespace from default flag value 19 | this is a shiboken2 bug fixed on shiboken6 20 | """ 21 | regex = re.compile(r"\s=\s[^\s]+::{}") 22 | newContent = "" 23 | with open(filename, encoding='utf-8') as f: 24 | for line in f: 25 | newContent += re.sub(regex, ' = {}', line) 26 | 27 | with open(filename, "w", encoding='utf-8') as f: 28 | f.write(newContent) 29 | 30 | 31 | # Usage: