summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Use SPDX license identifiersLucie Gérard2022-05-161195-54327/+2404
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* examples: add WindowStaysOnBottomHint into preview textLiang Qi2022-05-011-0/+2
| | | | | | Pick-to: 6.3 6.2 5.15 Change-Id: I1e4e390990fcb6e30b2ff7bb59168e4ffc01a936 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace uses of _qs with _s in sources and examplesSona Kurazyan2022-04-191-1/+3
| | | | | | Task-number: QTBUG-101408 Change-Id: I48360ba3b23965cd3d90ac243c100a0656a4cde8 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Chip example: fix an accidental bool->int conversion when using PMF connectionsTang Haixiang2022-04-132-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The example was refactored to use the PMF connection syntax. However this introduced a problem: when connecting a QAbstractButton to a slot that has a default parameter, the semantics of the connection change between string-based connections and PMF. Specifically: when connecting the QAbstractButton::clicked(bool checked = false) signal to a slot like View::zoomIn(int level = 1) then a string-based connection like connect(button, SIGNAL(clicked()), this, SLOT(zoomIn())) would call zoomIn without carrying the signal's parameter over. In other words, zoomIn's parameter is defaulted. The same connection using PFM instead is connect(button, &QAbstractButton::clicked, this, &View::zoomIn) which would "connect" the arguments. This makes emissions that pass false as clicked's parameter result in a zoomIn by 0. Fix it by avoiding the default parameter of zoomIn -- just split the function in two (zoomIn and zoomInBy). Amends 8cf812231405e011b422a1505d9a219618fe5cee. Pick-to: 5.15 6.2 6.3 Fixes: QTBUG-100135 Done-with: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Change-Id: I10c150c648034449e3154140108de2d64326d965 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Don't build the movie example if the feature is disabledAlexandru Croitor2022-03-191-1/+3
| | | | | | | Pick-to: 6.2 6.3 Fixes: QTBUG-101897 Change-Id: Idef9aaa0c0a0380b88d8769cb19becd613b2173b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Examples: Do not depend on transitive includesFabian Kosmale2022-03-174-0/+11
| | | | | Change-Id: I7bba855a14289edbedbaa07a1234213f59085c1d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QDebugStateSaver in example operator<<()Kai Köhne2022-03-161-1/+2
| | | | | | | | | | This makes sure that changes in the debug stream - like nospace() - do not "leak". Also use the example snippet in QDebugStateSaver documentation. Pick-to: 6.2 6.3 Change-Id: I934976d2c7c2335abfec68c763526a5cbb0e6f1e Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Compose render-to-texture widgets through QRhiLaszlo Agocs2022-03-116-22/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformTextureList holds a QRhiTexture instead of GLuint. A QPlatformBackingStore now optionally can own a QRhi and a QRhiSwapChain for the associated window. Non-GL rendering must use this QRhi everywhere, whereas GL (QOpenGLWidget) can choose to still rely on resource sharing between contexts. A widget tells that it wants QRhi and the desired configuration in a new virtual function in QWidgetPrivate returning a QPlatformBackingStoreRhiConfig. This is evaluated (among a top-level's all children) upon create() before creating the repaint manager and the QWidgetWindow. In QOpenGLWidget what do request is obvious: it will request an OpenGL-based QRhi. QQuickWidget (or a potential future QRhiWidget) will be more interesting: it needs to honor the standard Qt Quick env.vars. and QQuickWindow APIs (or, in whatever way the user configured the QRhiWidget), and so will set up the config struct accordingly. In addition, the rhiconfig and surface type is (re)evaluated when (re)parenting a widget to a new tlw. If needed, this will now trigger a destroy - create on the tlw. This should be be safe to do in setParent. When multiple child widgets report an enabled rhiconfig, the first one (the first child encountered) wins. So e.g. attempting to have a QOpenGLWidget and a Vulkan-based QQuickWidget in the same top-level window will fail one of the widgets (it likely won't render). RasterGLSurface is no longer used by widgets. Rather, the appropriate surface type is chosen. The rhi support in the backingstore is usable without widgets as well. To make rhiFlush() functional, one needs to call setRhiConfig() after creating the QBackingStore. (like QWidget does to top-level windows) Most of the QT_NO_OPENGL ifdefs are eliminated all over the place. Everything with QRhi is unconditional code at compile time, except the actual initialization. Having to plumb the widget tlw's shareContext (or, now, the QRhi) through QWindowPrivate is no longer needed. The old approach does not scale: to implement composeAndFlush (now rhiFlush) we need more than just a QRhi object, and this way we no longer pollute everything starting from the widget level (QWidget's topextra -> QWidgetWindow -> QWindowPrivate) just to send data around. The BackingStoreOpenGLSupport interface and the QtGui - QtOpenGL split is all gone. Instead, there is a QBackingStoreDefaultCompositor in QtGui which is what the default implementations of composeAndFlush and toTexture call. (overriding composeAndFlush and co. f.ex. in eglfs should continue working mostly as-is, apart from adapting to the texture list changes and getting the native OpenGL texture id out of the QRhiTexture) As QQuickWidget is way too complicated to just port as-is, an rhi manual test (rhiwidget) is introduced as a first step, in ordewr to exercise a simple, custom render-to-texture widget that does something using a (not necessarily OpenGL-backed) QRhi and acts as fully functional QWidget (modeled after QOpenGLWidget). This can also form the foundation of a potential future QRhiWidget. It is also possible to force the QRhi-based flushing always, regardless of the presence of render-to-texture widgets. To exercise this, set the env.var. QT_WIDGETS_RHI=1. This picks a platform-specific default, and can be overridden with QT_WIDGETS_RHI_BACKEND. (in sync with Qt Quick) This can eventually be extended to query the platform plugin as well to check if the platform plugin prefers to always do flushes with a 3D API. QOpenGLWidget should work like before from the user's perspective, while internally it has to do some things differently to play nice and prevent regressions with the new rendering architecture. To exercise this better, the qopenglwidget example gets a new tab-based view (that could perhaps replace the example's main window later on?). The openglwidget manual test is made compatible with Qt 6, and gets a counterpart in form of the dockedopenglwidget manual test, which is a modified version of the cube example that features dock widgets. This is relevant in particular because render-to-texture widgets within a QDockWidget has its own specific quirks, with logic taking this into account, hence testing is essential. For existing applications there are two important consequences with this patch in place: - Once the rhi-based composition is enabled, it stays active for the lifetime of the top-level window. - Dynamically creating and parenting the first render-to-texture widget to an already created tlw will destroy and recreate the tlw (and the underlying window). The visible effects of this depend on the platform. (e.g. the window may disappear and reappear on some, whereas with other windowing systems it is not noticeable at all - this is not really different from similar situtions with reparenting or when moving windows between screens, so should be acceptable in practice) - On iOS raster windows are flushed with Metal (and rhi) from now on (previously this was through OpenGL by making flush() call composeAndFlush(). Change-Id: Id05bd0f7a26fa845f8b7ad8eedda3b0e78ab7a4e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Do not assume implicit string-ish → QColor conversionMarc Mutz2022-03-111-2/+2
| | | | | | | | We want to mark the corresponding QColor ctor(s) explicit. Use Qt::GlobalColor or the new QColor::fromString() instead. Change-Id: I68bf75a094e6821b97682de5a0ffd975834d22d0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* secure UDP server: do not use deprecated protocol (DTLS 1.0)Timur Pocheptsov2022-03-101-6/+0
| | | | | | | | | | | | And also remove check for DtlsV1_2OrGreater for negotiated session protocol, since it must have been resolved to a specific protocol by this point. Fixes: QTBUG-100154 Pick-to: 6.3 6.2 Change-Id: I3aec31faed8b9cb22be0062da057c62864eba34f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Avoid using deprecated API in the icons exampleEirik Aavitsland2022-02-241-5/+3
| | | | | | | | | Fixes compilation warning. Fixes: QTBUG-100155 Change-Id: I1af2e69c070497509645c933df58fd42277cfb18 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* qtextstream.h: streamline includesFabian Kosmale2022-02-101-0/+1
| | | | | | | | | | | [ChangeLog][Potentially Source-Incompatible Changes] The qtextstream header no longer includes <QString>, <QStringEncoder> and <QStringDecoder>. Code which relied on the implicit inclusion of those classes might now need to include the headers explicitly. Task-number: QTBUG-97601 Change-Id: Ifb8c8452026195a772c0588dbbbc53fb51cac548 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Update Notepad tutorialLeena Miettinen2022-01-316-139/+92
| | | | | | | | | Update to use Qt Creator 7.0 and CMake as the build system. Fixes: QTBUG-100075 Pick-to: 6.3 Change-Id: I71e1d1446a2c79c98423ca5d4427b4b4eb00021b Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* threadedqopenglwidget example: Split out class RendererFriedemann Kleint2022-01-259-310/+441
| | | | | | | | | | | This makes the code clearer and decouples it from the GLWidget. As a drive-by, add a global shortcut to close. Pick-to: 6.3 6.2 Change-Id: I3469d29bc367acc17c5f8acf9d46219259b8315b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Examples: Remove unneeded CMake optionsKai Köhne2022-01-24236-905/+0
| | | | | | | | | | | | | | | CMAKE_INCLUDE_CURRENT_DIR is not necessary anymore for moc since CMake 3.8: https://cmake.org/cmake/help/latest/release/3.8.html#other-changes CMAKE_AUTORCC should not be used anymore. Instead, we now use qt_add_resources() or similar Enable CMAKE_AUTOUIC only if .ui files are present. Pick-to: 6.3 Task-number: QTBUG-87643 Change-Id: I835e2994cd5dba9918136999499b9077961b616c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Enable QStyle::State_Horizontal when initializing QStyleOptionProgressBarZhang Hao2022-01-211-1/+1
| | | | | | | | | | | | Since by default QStyleOptionProgressBar is initialized with initialize QStyle::State_Horizontal, the example shouldn't overwrite the state, and instead OR other states into it. Otherwise, the progressbar will be laid out vertically. Pick-to: 6.2 6.3 Fixes: QTBUG-100067 Change-Id: Ibebda48a297af4a621719673033f8199b8bc7984 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* bindablesubscription: Remove duplicated file entryKai Köhne2021-12-191-1/+0
| | | | | | Pick-to: 6.2 6.3 Change-Id: I7f24425c8ccfb11bda926373099d377f808a70dd Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Examples: Remove unneeded target_include_directoriesKai Köhne2021-12-174-16/+0
| | | | | | Pick-to: 6.3 Change-Id: Icd97815ee231c34ad4ea5ab94a73bfc26df7e0ca Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* mandelbrot example: Remove explicit linking against libmKai Köhne2021-12-172-8/+0
| | | | | | | | It seems not needed anymore with modern toolchains. Pick-to: 6.3 Change-Id: Ic5386cad4576b10f49fd74212f3514e26cfb0abe Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* analogclock example: Clean up link_librariesKai Köhne2021-12-171-5/+1
| | | | | | | | analogclock doesn't use widgets. Pick-to: 6.3 Change-Id: I75b5efc0bec786b45f8273e3d21c9be204e18225 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Clean up WIN32_EXECUTABLE, MACOSX_BUNDLE propertiesKai Köhne2021-12-1712-66/+0
| | | | | | | | | | | | Both are FALSE by default, so no point in explicitly setting them to FALSE. In addition, dbus/listnames is a command line tool. No reason to set WIN32_EXECUTABLE, MACOSX_BUNDLE here. Pick-to: 6.3 Change-Id: I99aaf27a0267c5575bd2ee5b6183991fce721f44 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* androidnotifier: Simplify example CMakeLists.txtKai Köhne2021-12-171-33/+35
| | | | | | | | | Building the example when not on android makes little sense. Therefore just error out in this case. Pick-to: 6.3 Change-Id: Ib7325156bcd8ffd1b9b3e67174d878f5731a4a4f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* CMake: Fix echoplugin example to be built as an external projectAlexandru Croitor2021-12-151-1/+1
| | | | | | | | | | | | It was accidentally reverted as part of a different change. Amends 3c1125d9fe41332087ab6213a5514426109ead08 Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Change-Id: Id9b2650c7c42fd9f401cd2da3fcd60ed4d39d212 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Examples: Fix whitespace issues in CMakeLists.txtKai Köhne2021-12-13241-307/+730
| | | | | | Pick-to: 6.3 Change-Id: I8e6dd1f250f8be6016ee4164cb2ab7034cbb1203 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Remove remaining conversion markers in CMakeLists.txtKai Köhne2021-12-13271-633/+47
| | | | | | Pick-to: 6.3 Change-Id: Ia5d474a3efd6aadbd0ef1537318f2f24e6c24fee Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Prefer unversioned commandsKai Köhne2021-12-1374-80/+80
| | | | | | Pick-to: 6.3 Change-Id: Ib32700ab82cf6b271c49e25d12fbad8c9c6bc1d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiomKai Köhne2021-12-10238-755/+268
| | | | | | | | | Also consolidate several find_package(Qt6 ...) calls in one call. Task-number: QTBUG-98867 Change-Id: Idfd5e71f46d4489fac7411cbfadb84437a0658f3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Simplify pingpong/complexpingpong examplesKai Köhne2021-12-092-81/+21
| | | | | Change-Id: Iff9bf22c7aebc6a5f61cd7411a99ee2bbb11c12c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Rasterwindow: Remove unneeded find_packageKai Köhne2021-12-061-2/+0
| | | | | Change-Id: Ia526f7603af98a6d450ff2465fd666d955772646 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Do not support Qt5 build in androidnotifier exampleKai Köhne2021-12-061-6/+3
| | | | | | | | We can expect that users use Qt 6 to try out Qt 6 examples. Pick-to: 6.2 Change-Id: Ifa7bd9471a712fa1d63107b7ff2d392b7aefdcfe Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove .prev_CMakeLists.txtKai Köhne2021-12-0644-2270/+0
| | | | | | | | These are left-overs from the initial qmake2cmake conversion. Pick-to: 6.2 Change-Id: Ie15c9ff022ea4566d10c1ba74599de9af83d29a7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QSystemTrayIcon example: ignore non-spontaneous QCloseEventShawn Rutledge2021-12-032-8/+5
| | | | | | | | | | Apparently this code is needed on other platforms now, not only macOS. Pick-to: 6.2 Fixes: QTBUG-98504 Change-Id: Ie0a7e38609e8fc8c11915784dd3652a3517bb639 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Repair parameter typeChunLin Wang2021-12-032-2/+2
| | | | | | | | | Fix the parameter types corresponding to the sample code and subclasses Fixes: QTBUG-98578 Pick-to: 6.2 Change-Id: I06e342ae1210ed53c5deec3e2711457cf2ac5b15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Document the example showing the benefits of using bindable propertiesSona Kurazyan2021-12-0212-0/+267
| | | | | | | | | | | And mention the example in the bindable properties docs. Pick-to: 6.2 Task-number: QTBUG-97655 Change-Id: I676e90dbda66c2e718c7f6c2240fac608a8653df Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add example showing the benefits of using bindable propertiesSona Kurazyan2021-12-0224-0/+1492
| | | | | | | | | | | | | Added two examples for modeling a subscription service: signal/slot connection-based and bindable property-based. The examples are based on the example from Fabian's Qt WS talk about the bindable properties. Pick-to: 6.2 Task-number: QTBUG-97655 Change-Id: I0345913b8b6e5c40b8477e128d36483598bdfcaa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* multistreamserver: fix compilationMarc Mutz2021-11-181-1/+1
| | | | | | | | | | | Instead of including <QIODevice>, use the correct 'nested name specifier', QIODeviceBase. Amends 8bd0a09475935cf33f6b7f63a898d4d2e6d43b17. Pick-to: 6.2 Change-Id: I077948b33f985cd4a2e3a9e591645cf20d7af91c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* multistreamclient example: fix compilationMarc Mutz2021-11-161-1/+1
| | | | | | | | | | | | | | Says GCC: qtbase/examples/network/multistreamclient/timeconsumer.cpp:85:37: error: incomplete type ‘QIODevice’ used in nested name specifier 85 | QDataStream ds(&buf, QIODevice::WriteOnly); | ^~~~~~~~~ Instead of including <QIODevice>, use the correct 'nested name specifier', QIODeviceBase. Pick-to: 6.2 Change-Id: Id8d87dbcb497e4feca1d5d3ce6b1bdb9da5c0dab Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use QScopedPointer to manage memoryTang Haixiang2021-11-041-1/+2
| | | | | | | | | | | Although the QBackingStore constructor takes a QWindow* as a parameter, it does not inherit QObject and doesn't become a QObject child of the QWindow. Use QScopedPointer to avoid memory leaks. Pick-to: 6.2 Change-Id: Ib065163a9149d002f8220a0257bd78549062c595 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Modify the target Square in the puzzleTang Haixiang2021-11-032-4/+4
| | | | | | | | | | | targetSquare judges which square the position falls in. The point scaling calculation method should not be used. The return value of QPoint operator/ will be rounded up. Modified to separate the x and y of position to calculate. Fixes: QTBUG-81842 Change-Id: I70375185a78ba47efe01be3fd490e0fb0f456e17 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix treemodelcompleter exampleJoerg Bornemann2021-10-271-3/+2
| | | | | | | | | | | | | | | | All nodes in the view were at the top level due to a spurious trimmed() call. The condition in the indentation calculation was flipped, leading to a segfault. Also, the input data does not contain tabs. Remove the condition that checks for tabs altogether. This amends commit 3fede6cb547b783377e833c9b269d4cecfe47e61. Fixes: QTBUG-97727 Pick-to: 6.2 5.15 Change-Id: Ic5068ead755c4dae5f0607724ac7704cce03227c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Add missing LIBRARY DESTINATION for examplesAlexey Edelev2021-10-203-0/+3
| | | | | | | Pick-to: 6.2 Fixes: QTBUG-97629 Change-Id: I5b32824693206926de9b4ee6637749a1814fdde7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Polish the painting/affine exampleFriedemann Kleint2021-10-167-299/+256
| | | | | | | | | | | | | | - Use member initialization - Remove C-style casts - Add space around operators - Use qsizetype for list indexes - Remove commented out debugging code Task-number: QTBUG-97095 Pick-to: 6.2 Change-Id: I11a17fa6e7f17968367a57291d83ee6fba731a34 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Support background-color CSS styling on <hr/>Shawn Rutledge2021-10-141-2/+7
| | | | | | | | | [ChangeLog][QtGui][CSS] The background-color style can now be applied to <hr/> to set the rule color. Task-number: QTBUG-74342 Change-Id: Ib960ce4d38caa225f258b6d228fb794cef43e1b7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove checks for C++ standard versions C++17 and belowIevgenii Meshcheriakov2021-10-011-9/+0
| | | | | | | | | | | Qt requires a compiler that support C++17 thus __cplusplus is always 201703L or higher. This patch removes checks for __cplusplus value that always succeed. Change-Id: I4b830683ecefab8f913d8b09604086d53209d2e3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove .qmake.conf from this repositoryJoerg Bornemann2021-09-202-0/+4
| | | | | | | | | | | | | | | | | | | | | | | This file was necessary for the qmake build and the CI. The qmake build is history, and the CI does now read .cmake.conf (see QTQAINFRA-4392). In addition to being superfluous, the existence of .qmake.conf triggers QTBUG-76140 when building Qt examples with qmake. Removing the file alleviates the symptoms of this bug. "Interestingly", to make the qmake build of examples work in the CI, we have to adjust the dbus examples to not use nmake inference rules. The absence of .qmake.conf results in a different order of inference rules in the Makefile, and nmake/jom pick up generated source files from the source dir. These are incompatible with the correct generated source files in the build dir. See QTBUG-96513 for details. Fixes: QTBUG-92271 Task-number: QTBUG-96513 Change-Id: I4076fae2eeb993956b54aced2c9c844ae2577a4a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Centralize RFC documentation-links in rfc.qdocLuca Di Sera2021-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | In the effort of repairing broken links as per QTBUG-96127, a series of RFC links referring to `tools.ietf.org/html/*` were modified to point to the new address that the site redirected to. To simplify executing a similar task and to diminish the duplication of manually inserted urls, the already existing `rfc.qdoc` file, containing `\externalpage` commands directing to RFC locations, was enhanced with links to all RFCs that were mentioned in the current documentation, so as to aggregate this common category of links. All links pointing to a `ietf` domain inside QDoc documentation blocks were then changed to use the newly provided external-references. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: I2a52eb6aa8c9e346f64ef1a627b039220d9f6c2a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* SQL browser example: fix typoTalent Gc2021-09-021-1/+1
| | | | | | | | | Both 'First name' and 'Last name' are two words, therefore the column names should be spelled 'FirstName' and 'LastName'. Fixes: QTBUG-96123 Change-Id: Iaf58442eba0bc5eb63dcde83ecdebdc4a3c658a5 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Port to QImage and QPixmap deviceIndependentSize()Morten Sørvig2021-09-011-2/+2
| | | | | | | | | Replace the “size() / devicePixelRatio()” pattern with a call to deviceIndependentSize(). Change-Id: I9d9359e80b9e6643e7395028cd43e3261d449ae7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Create plugin initializers for static user pluginsAlexandru Croitor2021-08-2411-136/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we only created object library static plugin initializers for Qt plugins only, not user-project plugins. The reason was that if a user tried to install the plugin target via an export set, CMake would error out saying that the _init library is not part of the same export set. Introduce an OUTPUT_TARGETS option that would allow projects to get the name of the generated _init target, so they can install it if needed. This was already done for qt6_add_qml_module, so we just introduce the same option for qt6_add_plugin. Now user static plugins will have an _init target created, which will be propagated to consumers whenever the consumers link against the plugin itself. We also need an internal option to disable this propagation, because it's handled a bit differently for Qt plugins which can be linked either via finalizers or via usage requirements. Amends 91c65dd80cdd2de666448c14202c0c63718152b6 As a result of the implementation change, cleanup example projects to ensure that they build successfully (the important part is specifying the CLASS_NAME). Only plugandpaint works properly with both shared and static Qt builds. echoplugin works with a shared Qt build, but not a static one due to some assumptions in the C++ code about shared plugins. styleplugin doesn't seem to work properly neither with shared Qt builds nor static Qt builds, at least on macOS. But it builds fine. For some reason even if the plugin is found, the style is not applied. Amends 4caac1feea025b0ad496141e8f16ab88c04c2caa Pick-to: 6.2 Task-number: QTBUG-80863 Task-number: QTBUG-92933 Change-Id: I6f631cda9566229b7a63992b23d7d7fa50303eeb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-17239-241/+241
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I1270b4846d8a23bc3563b6942c0910e095d2be4a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>