summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tools
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Add deployment API to our examplesAlexandru Croitor2024-03-225-45/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects were modified using the tool at: https://git.qt.io/alcroito/cmake_refactor A couple of examples had to be adapted manually, due to them including more than one app per example subdirectory. The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were removed. The install(TARGETS) calls were modified according to our documentation snippets for qt_generate_deploy_app_script. A qt_generate_deploy_app_script call was added for each executable target. Note that the deployment step will be skipped in the CI for now, because we enable QT_DEPLOY_MINIMAL_EXAMPLES and thus QT_INTERNAL_SKIP_DEPLOYMENT, and also because standalone examples are not enabled yet, and deployment is disabled for in-tree (so no-standalone-example) prefix builds. The install(TARGETS) calls for each example will still run, installing the examples into an installed_examples directory, that will not be archived by the CI. Pick-to: 6.7 Task-number: QTBUG-102056 Task-number: QTBUG-102057 Change-Id: Ida389bbad41710b2ae5da4d95e2d85be9e0cd9ce Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Correct license for examples filesLucie Gérard2024-03-076-6/+6
| | | | | | | | | | | | | | Example takes precedent over build system file type. According to QUIP-18 [1], all examples file should be LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Id348a89884bb309b96abb31077f14a51086b5d0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Remove the style plugin exampleVolker Hilsheimer2023-12-2116-290/+0
| | | | | | | | | | The snippets in the QStylePlugin class documentation show the relevant bits well enough. Pick-to: 6.7 6.6 Fixes: QTBUG-119974 Change-Id: Iba4a37664d64d86a2946f41d131a201ccdcd723b Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Remove echo pluginAxel Spoerl2023-12-2015-345/+0
| | | | | | | | | Remove echo plugin code and documentation. Fixes: QTBUG-119981 Pick-to: 6.7 Change-Id: I4083ac6cdb768facaed041241af2c5ee6e28df50 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move the settingseditor example into tests/manualVolker Hilsheimer2023-12-1515-1331/+0
| | | | | | | | | | | | | | | | The example uses QTreeWidget when it should use a QTreeView with a dedicated item model, primarily shows how to use item views (and very little about QSettings), and is generally not useful to show how an application could or should use QSettings to store settings. Turn it into a manual test instead; it's useful for that as it supports ini and plist files, and settings in different scopes. Pick-to: 6.7 Fixes: QTBUG-119978 Change-Id: I7ce039f6391c41c679d126d90a251eee60327c39 Reviewed-by: Ed Cooke <ed.cooke@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Fix the project nameAmir Masoud Abdol2023-07-311-1/+1
| | | | | | | Fixes: QTBUG-115327 Pick-to: 6.2 6.5 6.6 Change-Id: I77fc3a98d1658609caa9618430f6e6823b8e1bb5 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Remove references to Application ExampleAxel Spoerl2023-07-061-1/+0
| | | | | | | | | Removing dangling references to the example due to its move to manual tests. Pick-to: 6.6 6.5 Change-Id: I13f5fad93763d1ef70ddd8b3dcf430b5df8e28f9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move plug and paint example to manual testTor Arne Vestbø2023-06-3026-1311/+1
| | | | | | Pick-to: 6.5 6.6 Change-Id: Ibfd870f2f879d6ae68cd6806b0c1ab02da0a3441 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Examples: "About &Qt" should show info about Qt, not quitEdward Welbourne2023-06-161-1/+1
| | | | | | | | | | | A few examples seem to have copied and pasted a help action "About &Qt" that triggered QCoreApplication::quit. This does not look like best practice. Use QApplication::aboutQt instead. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I1887a3c999d752a24c7c4d3cabc4a5d63b29b966 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Remove unnecessary Q_INIT_RESOURCE callsKai Köhne2023-06-084-8/+0
| | | | | | | | | | | Explicit calls to Q_INIT_RESOURCE are only needed for resources embedded in static libraries. See also https://doc.qt.io/qt-6/resources.html#explicit-loading-and-unloading-of-embedded-resources Pick-to: 6.5 6.6 Change-Id: I06a24d1c04369eedc78ca60a6ca02ce33907d9e7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix CMakeLists.txt of echo plugin exampleAxel Spoerl2023-04-061-1/+5
| | | | | | | | | | | | This patch adds a missing dependency to the echo plugin for shared builds. Since it fixes the last remaining example, it closes the Jira ticket. Fixes: QTBUG-112300 Pick-to: 6.5 Change-Id: Ib1da2d7d5f5d54d7224f1c65a995f3752037e5be Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: build the shared plugin when building the plugandpaint targetJoerg Bornemann2023-03-281-1/+5
| | | | | | | | | | | | People expect that building the "main target" of an example builds all necessary subtargets as well. Add a dependency from plugandpaint to pnp_extrafilters. Pick-to: 6.5 Task-number: QTBUG-112300 Change-Id: I036beb961fe474ff060f93c98f5e2bda58e66f71 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Merge "undo" and "undoframework" examplesVolker Hilsheimer2023-01-3134-1644/+65
| | | | | | | | | | | | | | | | | | The "undo" example didn't show anything that the "undoframework" example doesn't, and the latter is more comprehensive and properly documented. "undoframework" also uses QGraphicsView instead of inventing its own diagram widget. However, the "undo" example created a nicer UI with toolbuttons, icons, and the undo view in a dock widget, so reuse those elements in the "undoframework" example instead. Update the documentation quoting tags accordingly, and clean up a bit. Pick-to: 6.5 Change-Id: I3c91feecbd5fe3e5900838b0b51f9fe7bd190280 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix CMakeLists.txt of Style Plugin Example (broken on macOS)Axel Spoerl2023-01-191-1/+1
| | | | | | | | | Add TARGET instruction in property setter, used in debug mode on macOS. Task-number: QTBUG-107842 Task-number: QTBUG-109227 Change-Id: I8704b7009c36ea8ddbf8773abfaf2b5f34f728ac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix Style Plugin Example, and add some CMake DocsAmir Masoud Abdol2023-01-185-11/+44
| | | | | | | | | | | | | | | | | | | | A few things: - Improved the documentation by adding a CMake section, briefly describing the process of adding the plugin, and placing it where it should be. - Write a note about the case where the style may be overwritten at launch, and how to set the a new style using a CLI - Improved the CMake build such that it creates the App Bundle correctly, and also works without an App Bundle as well. - Changed the example, and plugin such that now instead of a QPushButton we have a QTextEdit, and change the text color. - Replaced the application screenshot Fixes: QTBUG-107842 Fixes: QTBUG-109227 Change-Id: I161a91b27df016ff6230fac3871b79d2dfbdf18a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Use PRIVATE CMake linkageKai Köhne2022-11-3010-11/+11
| | | | | | | We (almost) only build apps, for which PRIVATE linkage makes more sense. Change-Id: I09a509c3fb33a00cdfdede687b3f95d638f42091 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Use qt_standard_project_setup()Kai Köhne2022-11-1710-21/+20
| | | | | Change-Id: I0ceab08108b7e58e4e2ed25db9e3c289f5c0ddac Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Use Qt6:: to qualify Qt CMake packagesKai Köhne2022-11-1714-40/+40
| | | | | | | This is what we promote also in the documentation. Change-Id: If91aebafe861b0c934acbb2c69afd182abc3345d Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Move i18n example to qttoolsKai Köhne2022-11-0138-1224/+0
| | | | | | | | Move i18n example out of qtbase. In qttools, it can use lrelease, avoiding the need to store .qm files in the repository. Change-Id: I8ba36a1372c2a743b809e3f7ea95a67825558f41 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix typo in examples/i18nYAMAMOTO Atsushi2022-10-251-7/+7
| | | | | | | | The name of the variable that handles the qm file is qmlFile. Change-Id: I873c73cd8f96ff821fe3d2e633e84fef8c687875 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2319-19/+19
| | | | | | | 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-0319-0/+57
| | | | | | | | | | | | 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>
* CMake: Make sure qtbase examples are installed into the correct pathAlexandru Croitor2022-07-273-6/+6
| | | | | | | | | | The find_package calls need to happen after we set INSTALL_EXAMPLEDIR to ensure that INSTALL_EXAMPLEDIR is overridden if necessary. Pick-to: 6.2 6.3 6.4 Task-number: QTBUG-102879 Change-Id: I3c2e6c5a68a8c6ff9b98b79dbd6c83445d8da052 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Let qt6_add_plugin accept sourcesJoerg Bornemann2022-06-294-12/+0
| | | | | | | | | | | The commands qt6_add_executable and qt6_add_library both accept a list of sources that get automatically added to the created target. Extend qt6_add_plugin to also accept sources for consistency. Fixes: QTBUG-104189 Change-Id: Iad5d8c5b31551663be155d068d55e770e1a91b27 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1674-3607/+152
| | | | | | | | | | | | | 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: Remove unneeded CMake optionsKai Köhne2022-01-249-31/+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>
* 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-1315-15/+42
| | | | | | 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-139-22/+3
| | | | | | Pick-to: 6.3 Change-Id: Ia5d474a3efd6aadbd0ef1537318f2f24e6c24fee Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Prefer unversioned commandsKai Köhne2021-12-137-7/+7
| | | | | | 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-1011-27/+11
| | | | | | | | | 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>
* Remove .prev_CMakeLists.txtKai Köhne2021-12-068-275/+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>
* 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>
* 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-1714-14/+14
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I1270b4846d8a23bc3563b6942c0910e095d2be4a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regular Expression example: Brush up and add a way to preview replacementsFriedemann Kleint2021-06-012-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>
* Build examples in isolated sub-builds using ExternalProjectCraig Scott2021-05-262-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Re-work the CMake project files for the plugandpaint exampleJoerg Bornemann2021-04-275-105/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the project prelude to examples/widgets/tools/plugandpaint/CMakeLists.txt to mark it as the entry point of the example project. Remove the project prelude from all its subdirectories, because the subdirs are not supposed to be built separately. Remove the wrong code that pro2cmake generated for the application's project file. That merely tried to link the basictools static plugin. Move common initialization code (CMAKE_AUTO*, INSTALL_EXAMPLESDIR) to the top-level plugandpaint project file. Remove superfluous CMAKE_INCLUDE_CURRENT_DIR. Set the output directory of the extrafilters plugin to the application's build directory such that the app can find the plugin without having to install the example. Skip regeneration in those files, to avoid scattering the project files with special case markers. Fixes: QTBUG-87449 Fixes: QTBUG-91066 Change-Id: I3ceb08f5fcda1ffea3c35cee8580f7b5e4ecfc1f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: Fix build error issue in examplesJukka Passi2021-04-271-1/+5
| | | | | | | | | | Added branching to plugandpaint example to get correct library architecture to the build Fixes: QTBUG-56322 Pick-to: 5.15 Change-Id: I4d0eb4e24681642991d08c3dd2bad73d10caf962 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Port example away from deprecated QVariant APIVolker Hilsheimer2021-04-161-1/+1
| | | | | Change-Id: I284610f216409b593d307b8076c8f638722929e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* UndoFramework example: make the background visibleIvan Solovev2021-01-111-0/+0
| | | | | | | | | | | | Existing background image was not displayed correctly due to scaling (see the description in related Jira task). This commit increases the thickness of the lines, so that the grid is displayed correctly Task-number: QTBUG-89896 Pick-to: 6.0 5.15 Change-Id: Iaa8218a5e9852adbc40715e86862ac3b34e1fbec Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* i18n example: No longer ignore return value of QTranslator.load()Friedemann Kleint2020-11-191-4/+9
| | | | | | | | Adapt to qtbase/86ebe46f591d33dc76e2f764524c988dd72f4437. Change-Id: Ie45d43b3eabe60195622d69458e3d881139f9ce1 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-2717-0/+68
| | | | | | | | | As well as the MACOSX_BUNDLE properties as necessary. Task-number: QTBUG-87664 Task-number: QTBUG-86827 Change-Id: I7677449a26d51fa853bd67bab6b3b61afbd2b12f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-1913-13/+13
| | | | | | Task-number: QTBUG-87661 Change-Id: I0dacfdc97a3fb7d88da85b67800f2c1b084d869b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make QStringList an alias to QList<QString>Lars Knoll2020-09-122-2/+0
| | | | | | | | | | | | | | | | | | Fix our API, so that QStringList and QList<QString> are the same thing. This required a bit of refactoring in QList and moving the indexOf(), lastIndexOf() and contains() method into QListSpecialMethods. In addition, we need to ensure that the QStringList(const QString&) constructor is still available for compatibility with Qt 5. Once those two are done, all methods in QStringList can be moved into QListSpecialMethods<QString>. Change-Id: Ib8afbf5b6d9df4d0d47051252233506f62335fa3 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* High-DPI: Remove usage of Qt::AA_EnableHighDpiScalingTor Arne Vestbø2020-08-281-3/+0
| | | | | | | | This attribute is now on by default. Change-Id: I7c9d2e3445d204d3450758673048d514bc9c850c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-241-1/+1
| | | | | | | | | | | | | And remove one of the type id to name mapping that still existed in QMetaType. QMetaTypeInterface can provide that, so there's no need to have a second copy of the data. qMetaTypeTypeInternal() can still map all the names of all builtin types to ids. That functionality is for now still required by moc and can't be removed yet. Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move QStringRef and remains to Qt5CompatKarsten Heimrich2020-08-202-4/+4
| | | | | | | | | Export some private functions from QUtf8 to resolve undefined symbols in Qt5Compat after moving QStringRef. Task-number: QTBUG-84437 Change-Id: I9046dcb14ed520d8868a511d79da6e721e26f72b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Polish the settingseditor exampleFriedemann Kleint2020-07-104-107/+227
| | | | | | | | | | | | | | | | | | | | | | | The example is meant to show an item delegate with a line edit with QRegularExpression-based validation depending on type. Unfortunately, this does not work since QSettings mostly return QString types. Fix it to a partially working state by - Making the expressions match from beginning to end which was overlooked in the QRegExp->QRegularExpression change. - Use QCheckBox, QSpinBox for bool/int since it is silly to have a user edit a bool value by typing 'true'/'false'. - Move the expressions out to a separate struct to be able to do some guessing of the type when reading the QSettings, implement for bool and int. - Use a fancy Unicode checkmark for displaying bools. - Fix the garbled display of QByteArray with binary data by displaying them with hex characters and setting them read-only. Change-Id: Iba22dfafc3b813b3fd3d2915ef5210d661049382 Reviewed-by: Paul Wicking <paul.wicking@qt.io>