summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tools/settingseditor/settingstree.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move the settingseditor example into tests/manualVolker Hilsheimer2023-12-151-231/+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>
* Use SPDX license identifiersLucie Gérard2022-05-161-49/+2
| | | | | | | | | | | | | 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>
* Port example away from deprecated QVariant APIVolker Hilsheimer2021-04-161-1/+1
| | | | | Change-Id: I284610f216409b593d307b8076c8f638722929e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Polish the settingseditor exampleFriedemann Kleint2020-07-101-2/+13
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Prepare for deprecating the QDesktopWidgetSona Kurazyan2019-10-151-2/+2
| | | | | | | | | | | | | | QDesktopWidget is marked as obsolete in docs, but it is not yet completely deprecated, some of its methods are still in use. Replace uses of the following methods marked as obsolete: - QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen() - QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry() - QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry() Task-number: QTBUG-76491 Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Cleanup QtWidgets (tools) examplesChristian Ehrlicher2019-09-111-23/+13
| | | | | | | | | | | | | | Cleanup QtWidgets tools examples: - use member-init (clang-tidy) - fix includes/don't include QtWidgets globally - include own header first - use nullptr (clang-tidy) - avoid c-style casts - use QVector instead QList - use QItemDelegate instead QStyledItemDelegate Change-Id: Ibe9440cdf711e5cc2138c054864edebe1fc95731 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Cleanup Widgets examples - foreachChristian Ehrlicher2019-01-071-2/+4
| | | | | | | | | | Cleanup the Widget examples - replace foreach with range-based for loop in subdirectory tools, touch and tutorials Change-Id: I008d23b5993a18a3332fe9f5e5bca68cb0561066 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Unify license header usage.Jani Heikkinen2016-03-291-3/+13
| | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Polish the settings editor example.Friedemann Kleint2015-09-231-23/+26
| | | | | | | | | | | | | | | | | - Set QtProject as organization. - Remove unneeded member variables. - Use member initialization in the constructor. - Use new connection syntax in createActions() to assemble the menu there, removing the createMenus() function. - Introduce a QSharedPointer to ensure settings are deleted. Previously, the settings were parented on the tree widget, which is a hack of sorts. - Fix OS X macros. Change-Id: Ibbc6bfb03eb5c7eda077b1a3aa3f1707667f7f13 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Updated BSD licensed file headersJani Heikkinen2015-02-151-3/+3
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-5/+5
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Examples: move widgets specific "tools" examples to the correct placeJ-P Nurmi2012-11-281-0/+262
examples/tools -> examples/widgets/tools Change-Id: I8b9e23c45e07ce5cd9da8f24a9a9f7ae10b2b107 Reviewed-by: hjk <qthjk@ovi.com>