summaryrefslogtreecommitdiffstats
path: root/src/printsupport/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Long live [[nodiscard]] QFile::openGiuseppe D'Angelo2024-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having already caught some bugs in real code because of unchecked calls to QFile::open, this commit marks QFile::open (and open() in other file-I/O classes) as [[nodiscard]]. Since it's going to raise warnings, the plan is to keep the existing behavior up to and including the next LTS. Then the warnings will switch on by default. All of this is protected by system of macros to opt-in or opt-out the behavioral change at any time. A possible counter-argument for doing this is that QFile::open is also used for opening files in the the resource system, and that opening "cannot fail". It clearly can, if the resource is moved away or renamed; code should at a minimum use a Q_ASSERT in debug builds. Another counter-argument is the opening of file handles or descriptors; but again, that opening may fail in case the handle has been closed or if the flags are incompatible. --- Why not marking *every* open() override? Because some are not meant to be called directly -- for instance sockets are supposed to be open via calls to `connectToHost` or similar. One notable exception is QIODevice::open() itself. Although rarely called directly by user code (which just calls open() on a specific subclass, which likely has an override), it may be called: 1) By code that just takes a `QIODevice *` and does something with it. That code is arguably more rare than code using QFile directly. Still, being "generic" code, they have an extra responsibility when making sure to handle a possible opening failure. 2) By QIODevice subclasses, which are even more rare. However, they usually ignore the return from QIODevice::open() as it's unconditionally true. (QIODevice::open() doesn't use the protected virtual pattern.) I'll try and tackle QIODevice in a future commit. [ChangeLog][QtCore][QFileDevice] The open() functions of file-related I/O classes (such as QFile, QSaveFile, QTemporaryFile) can now be marked with the "nodiscard" attribute, in order to prevent a category of bugs where the return value of open() is not checked and the file is then used. In order to avoid warnings in existing code, the marking can be opted in or out, by defining QT_USE_NODISCARD_FILE_OPEN or the QT_NO_USE_NODISCARD_FILE_OPEN macros. By default, Qt will automatically enable nodiscard on these functions starting from Qt 6.10. Change-Id: Ied940e1c0a37344f5200b2c51b05cd1afcb2557d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Enable QT_NO_CONTEXTLESS_CONNECT for most of QtBaseGiuseppe D'Angelo2023-07-111-0/+1
| | | | | | | | | It's clean now, keep it as such. Enabling it for QtCore is still OK, because it just hides a function template declared in a header. Change-Id: I8e7dfae179732ba04241a6a3258c2d722e8259df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use Qt CMake APIs to exclude files from Unity BuildAmir Masoud Abdol2023-04-031-9/+4
| | | | | | | | | | | | | | | | | | | | This is a bit of a cleanup, mainly around unity build, and a few other minor things: - I replaced the direct inclusion of sources files using `set_source_files_properties`, and instead used `NO_UNITY_BUILD_SOURCES` when possible. In most cases, they are being excluded in their respective `qt_internal_extend_target` but sometimes I had to make a new extension. - In few cases, we had to manually exclude the NO_PCH files, so, I instead passed them directly to the NO_PCH_SOURCES which also exclude them from the unity build as well. - Removed a few unnecessary "" Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I466576592c1d115a2da4d88672c1e4b9f995f2ed Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add some exclusions for CMake Unity (Jumbo) buildsFriedemann Kleint2023-02-161-0/+11
| | | | | | | | | | | | | Add exclusions for issues that are likely not fixable (3rd party code, X11 define clashes, etc) in 3rd party, tools and plugins. Pick-to: 6.5 Task-number: QTBUG-109394 Done-with: Amir Masoud Abdol <amir.abdol@qt.io> Change-Id: I698c004201a76a48389271c130e44fba20f5adf7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* src: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-101-5/+0
| | | | | | Pick-to: 6.5 Change-Id: Id644d322a602038403bb7f46c532744575fbf6d3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Respect CMake source tree when installing header filesAlexey Edelev2022-09-071-0/+2
| | | | | | | | | | | | | | | | Use CMake source tree when installing header files instead installing all header files that syncqt.pl produces. This avoid adding header files which cannot be used because of platform or feature incompatibility with Qt version. Since syncqt.pl doesn't respect CMake build tree when generating master header and CaMeL case header files, these header files still will be installed regardless platform or feature limitations. This will not be the case once we switch to syncqt.cpp, which will install only headers that are relevant to the selected platform and enabled features. Task-number: QTBUG-103196 Change-Id: I7d64754648747bee700d96f2fd6228fe7248512e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Move file-static const arrays out of qprint_p.h fileØystein Heskestad2022-06-041-1/+1
| | | | | | | | | Move static arrays into new qprint.cpp file to avoid them being duplicated in many translation units. Fixes: QTBUG-102302 Change-Id: I47b7a6244e45672788792ec1a28d4fed20d233a3 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Add missing header files to the module sourcesAlexey Edelev2022-05-121-1/+1
| | | | | | | | | All module header files should be listed in the corresponding sections of modules SOURCEs to be accessible in CMake routines. Task-number: QTBUG-103196 Change-Id: Ieb77ae70557e35e546a5b00387e1e0aa40338239 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Use QtBase_SOURCE_DIR instead of QT_SOURCE_TREEJoerg Bornemann2021-07-121-1/+1
| | | | | | | | | | | | | ...where applicable to use a known CMake-provided variable in favor of our own cooked up one. This affects four plugins that are not supposed to be built out of tree, meaning QtBase_SOURCE_DIR is available (and identical to QT_SOURCE_TREE). Task-number: QTBUG-88090 Change-Id: I27f012e6c5fd99c3239a1dd65c0811c819dbcfe9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Migrate to autogenerated cpp exportsAlexey Edelev2021-06-251-0/+1
| | | | | | | | | Replace the hardcoded cpp exports with a generated one where it's applicable. Task-number: QTBUG-90492 Change-Id: Idc160b594987b2c765e75bd669aae851b4366282 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use icon themes in QPrintPreviewDialog [if they exist]Albert Astals Cid2021-06-051-12/+12
| | | | | | | | | | | I've renamed a few of the qrc icons to the names most common icon themes use for similar actions (the action themselves are not part of the icon naming spec https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html since it's not been updated in a while). Task-number: QTBUG-85879 Change-Id: I23bb300dbf4e953517516c97b8af118859aeb6fa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix BASE argument of qt_add_resourcesJoerg Bornemann2021-05-181-33/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BASE argument of qt_add_resources now denotes the root point of the alias of the file. Before, BASE was merely prepended to every file that got passed to qt_add_resources. Old behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "images/button.png") Alias is "../shared/images/button.png", and pro2cmake generated QT_RESOURCE_ALIAS assignments to fix this. New behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "../shared/images/button.png") The alias is "images/button.png". No extra QT_RESOURCE_ALIAS assignment is needed. The new behavior is in effect for user projects and for Qt repositories that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE. Qt repositories will be ported one by one to this new behavior. Then the old code path can be removed. Pick-to: 6.1 Task-number: QTBUG-86726 Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Windows: Build print support plugin directly into QtPrintSupportFriedemann Kleint2020-09-241-8/+13
| | | | | | Task-number: QTBUG-83259 Change-Id: I23042e1eb89d407692a96bfb2d6c4efdddbfb50f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-231-14/+14
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Regenerate rest of projects under src/Alexandru Croitor2020-07-031-13/+13
| | | | | Change-Id: I7d7692306a80deb9e8d2a90454dad4b39320f380 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove winrtOliver Wolff2020-06-061-3/+0
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Build print support plugin directly into QtPrintSupportTor Arne Vestbø2020-06-041-0/+2
| | | | | | Task-number: QTBUG-83259 Change-Id: I74f60519fbccfa5f208397bf3d65f0a4f64cb6f0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move macOS print support from platform plugin into QtPrintSupportTor Arne Vestbø2020-06-041-0/+11
| | | | | | Task-number: QTBUG-83256 Change-Id: I29044b6c3f952c259f501f94a175c8ef2cbaae55 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* cmake: Remove APPLE prefix from platform namesTor Arne Vestbø2020-03-161-1/+1
| | | | | | | None of the other platforms have it. Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Fix naming when referring to Apple macOSTor Arne Vestbø2020-03-161-1/+1
| | | | | Change-Id: Iafb5e448d0d65d42f788464fc600594a5666f9af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate projects to correctly handle private dependenciesAlexandru Croitor2020-02-051-0/+4
| | | | | | | Change-Id: I7d84bc9962bff5c89a90367ae704974c6ce2ec89 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate src/*Alexandru Croitor2019-11-141-14/+14
| | | | | | Change-Id: I0314b4faa1e4860e86198eea4189987e527dfec2 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Regenerate everything under ./srcAlexandru Croitor2019-11-121-1/+0
| | | | | | | Change-Id: Ibdbdc17f8c2ee41356f490dd839a47e1bcf4c586 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Regenerate a bunch of projects after pro2cmake changesAlexandru Croitor2019-11-121-2/+2
| | | | | | Change-Id: I675a068411785364915a074ca0e631fec944d228 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Re-generate affected cmake files and configure.json after the mergeSimon Hausmann2019-10-171-56/+57
| | | | | | | | | This also removes the workarounds of commit b2662b05dd078c46b82f5f041f51b0b83554113d now that it's fixed "upstream" in the .pro files. Change-Id: Idd5e6273873a700fcda5a6cad2039c4e88b61f6f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate qtbase/src projectsAlexandru Croitor2019-09-301-1/+0
| | | | | | | | To get less diffs for next merges and pro2cmake changes. Change-Id: I7fb5ff34bb884072a9964e8e3488c69f4290fca2 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix add_qt_docs callsSimon Hausmann2019-09-191-1/+1
| | | | | | | | Brown paper bag for me, don't use a comma to separate parameters when calling a function. Change-Id: I21e16142fab4fd1c2714df13cd6a892b036e899a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Re-generate main module CMake filesSimon Hausmann2019-09-181-1/+1
| | | | | | | This fixes the calls to add_qt_docs to include the target. Change-Id: I2c4c807bca8faa48bb49f4b8710035f21abfca0e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate src/printsupportAlexandru Croitor2019-09-111-35/+55
| | | | | | | Change-Id: I9aeb6408cac243c5b5c55b1f14db1f4ef90996f3 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Regenerate the main qtbase modulesAlexandru Croitor2019-06-051-0/+2
| | | | | | | | | | | | | | | There were some changes done in pro2cmake, so regenerate the main qtbase modules to keep everything up to date. Some new whitespace got added. Some special cases were removed (ZLIB). Some opengl code got moved around. Some plugin types were added. And some other minor things. Change-Id: Ie8cba4a9aa6b4b163c39d6cf546ea9e0bfc05c01 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Rerun pro2cmake on projects that use .ui filesAlexandru Croitor2019-05-221-0/+6
| | | | | | | Task-number: QTBUG-75875 Change-Id: I95109b07fc4a6e09fe7911a21fc5f27f2c895d77 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Regenerate printsupportAlexandru Croitor2019-05-201-6/+8
| | | | | | | No .prev file cause it's a clean conversion. Change-Id: I33e02dccb9c8da336891c36cd0e1454d29152065 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix yocto cross buildAlexandru Croitor2019-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | When cross-compiling Qt using a Yocto sysroot, if the sysroot already contains an installed Qt version, and a project (library or executable) does not explicitly link against all of its Qt dependencies, the cross linker will try to find a suitable library in the sysroot ./lib folder. This mighy lead to issues, because the linker will pick up an installed Qt library which might have different symbol versioning, and thus cause linker errors. This happened with the print support module. Make sure the print support module explicitly links against the newly built Qt modules. Task-number: QTBUG-74133 Change-Id: I876b1507c655673831e78dcfe737a5ede2a8c087 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Re-generate printsupportTobias Hunger2019-03-291-6/+46
| | | | | Change-Id: I8c859dad17dbb18694f52c4c87bf20d55f490099 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* cmake: src/printsupport: Rerun conversion scriptKevin Funk2019-02-131-13/+21
| | | | | Change-Id: I0bdc4eefa5e1e78ba7f68da5848e32297c6af5a1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Build PrintSupport module and testsTobias Hunger2018-12-141-0/+98
Change-Id: I7ac14f5214619f547af7221d213ac7e338a05bfc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>