summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Improve translations loading code in standarddialogs exampleFriedemann Kleint2021-08-061-7/+8
| | | | | | | Pick-to: 6.2 Change-Id: I799724b633f1b52675ca2aa69b22fdb678b84421 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove mention of permission api in http exampleAssam Boudjelthia2021-07-301-8/+0
| | | | | | Pick-to: 6.2 Change-Id: I8b22633e1ad5372f92f87315b7184a4b499a0a0b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Rename QPermission namespace to QApplicationPermissionAssam Boudjelthia2021-07-151-2/+3
| | | | | | | | Pick-to: 6.2 Task-number: QTBUG-94407 Change-Id: Ie9c05dbe498cd372c015b5125e6cb8d59ca96b59 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Port all in-tree addAction() users from postfix to infix QKeySequenceMarc Mutz2021-07-143-13/+13
| | | | | | | The former is QT_DEPRECATED_SINCE(6, 4). Change-Id: I9e60639651b0832f1e3d3282d15dd0ab0b22d819 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QObject: optimize the common case of findChildren(QString())Marc Mutz2021-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Outside tests, all in-tree callers of QObject::findChildren() pass no name to match, and in my experience that is also true for the vast majority of out-of-tree users. Avoid the temporary QString creation in the caller and the repeated QString::isNull() checks in the implementation by overloading findChildren() without a name argument and checking for name.isNull() only once, forking off into separate helper functions. Adjust in-tree callers that used an explicit `QString()` argument in order to pass options, which goes to show that `name` should never have been the first argument of findChilden() in the first place, even though I appreciate the symmetry with findChild() (the use-cases of which, however, are radically different). Change a `findChildren().size() == 0` call found while scanning for findChildren() calls to `!findChild()` as a drive-by. Modernize loops in the various qt_qFindChild{,ren}_helper() overloads to match how the new code looks. [ChangeLog][QtCore][QObject] Added findChildren() overload taking no name (thus optimizing this common case). Change-Id: Ifc56e5438023d079b40c67f11ae274a3e128ad5e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Android: trim down the examples manifests from obsolete tagsAssam Boudjelthia2021-07-011-62/+39
| | | | | | Pick-to: 6.2 Change-Id: I4a1fe025e59f724fb9aad8078198474f14d29feb Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Remove ministro codeAssam Boudjelthia2021-07-011-2/+0
| | | | | | | | | | | | | | Since Ministro no longer work on recent Android versions (Android 8+), and it hasn't been maintained and the repos are not updated, the existing code is practically a dead code. [ChangeLog][Android] Remove ministro code since it's been unmaintained and not working with recent Android versions. Task-number: QTBUG-85201 Pick-to: 6.2 Change-Id: I18d7b1e209cba3cfd04674060e9bf39aa5a5510f Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Qt::PrintSupport is an optional component in the fontsampler exampleVolker Hilsheimer2021-06-151-0/+1
| | | | | | | | | If we don't find it we can't link to it, and then the example will never have any print functionality, in spite of having the UI. Pick-to: 6.2 Change-Id: Ib84be39a2655253c7d643520487adee054d5bd2d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use new permission api for http exampleAssam Boudjelthia2021-06-073-33/+6
| | | | | Change-Id: I265ec42205a193e9862eef26e73805bbf4188640 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move notification example from androidextras to qtbaseAssam Boudjelthia2021-06-0422-1/+613
| | | | | | | | | | | | Refactor android notification example to fit in qtbase. The example demonstrates how to use JNI and work with Java APIs and add custom Java code to a Qt app targeting Android. Task-number: QTBUG-84382 Change-Id: I5fcbbf77b36eb47a0acaa13835ef3d773e63885c Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Regular Expression example: Brush up and add a way to preview replacementsFriedemann Kleint2021-06-013-27/+99
| | | | | | | | | | | | - Set a fixed font on text edits so that parentheses stand out - Rearrange the layout to have the text at the top be prevent long texts from being wrapped - Add a replacement field where one can exercise replacement with the \1, \2... placeholders. Pick-to: 6.1 Change-Id: I140a62e1fb2cd1c6bfe02a2f01b7f06a6f3b5eb2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* vulkan: Update legacy tests and examples to the modern validation layerLaszlo Agocs2021-05-315-66/+5
| | | | | | Fixes: QTBUG-88388 Change-Id: Ib072f203ada5d692dea8d35da2b24db0deac0297 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Build examples in isolated sub-builds using ExternalProjectCraig Scott2021-05-2647-267/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Examples are intended to show how to build against an installed Qt. Building them as part of the main build means the way the Qt targets are defined and created are not representative of an end user's build. By building them as separate projects using ExternalProject, we can more closely replicate the intended audience's environment. This should allow us to catch more problems earlier. Having examples built as part of the main build also creates problems with some static builds where a tool built by the main build is needed during configure time. This happens with other repos like qtdeclarative but not (currently) with qtbase. Converting the examples in qtbase to be built using ExternalProject is intended as a demonstrator for how other repos can do similar. Until other repos are converted, they will continue to work as they did before, with examples as part of the main build for non-static builds only. The new build-externally behavior is only supported for non-prefix builds with this change. Prefix builds will continue to use the old non-external method. Support for building examples externally in prefix builds will be a separate change. Task-number: QTBUG-90820 Fixes: QTBUG-91068 Change-Id: I2304329940568dbdb7da18d54d5595ea7d8668bc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Small fix to the notepad exampleFriedemann Kleint2021-05-184-68/+28
| | | | | | | | | | | - Remove misleading note about setCentralWidget() - Connect copy/paste and undo/redo directly to the QTextEdit instead of routing them via window - Add the missing "About" menu - Check for reject of QFileDialog Change-Id: Ia7457fbedd762028bf2bcde99dfcfb50bbc97f1d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix BASE argument of qt_add_resourcesJoerg Bornemann2021-05-1810-1400/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Brush up the text edit exampleFriedemann Kleint2021-05-182-82/+67
| | | | | | | | | | | | | | - Use initializer lists - Use u instead of QLatin1String() - Fix some clang warnings about else after return, constFirst() - Streamline code - Remove slot TextEdit::printPreview() which is not needed - Rename variable fileName to pdfFileName in filePrintPdf() to disambiguate from this->fileName Pick-to: 6.1 Change-Id: I377ebfd13487470b6f8eaf568dd5d99354f761f2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>