summaryrefslogtreecommitdiffstats
path: root/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* SimpleTreeModel: Polish TreeModel::setupModelData()Friedemann Kleint2023-12-061-33/+25
| | | | | | | | | | | | | - Use QStringView. - Use a list of a pair-like struct to represent the state instead of 2 lists. - Use qsizetype. - Use constLast() to avoid detaching. Pick-to: 6.6 Change-Id: Icc3586451f081f6166fece52675d5379160f51da Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Polish the SimpleTreeModel exampleFriedemann Kleint2023-12-061-36/+20
| | | | | | | | | | | | | | | | | | | - Fix/silence most clang-tidy/compiler warnings * unsigned/int comparison * Avoid repeating return / default parameter types * Make functions static/use static invocations * Use string literals everywhere * Use auto * for pointers * Streamline code, use ternary operators * Move constructor parameters * Observe rule of 5 by using Q_DISABLE_COPY_MOVE - Add some bells && whistles, resize properly, expand all Complements 25027444a9b53d61a6257dc5f5ce0ffdb3b06f98. Pick-to: 6.6 Change-Id: I78f48d187981ecabf69a5d4d42715bad026fa9e6 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Modernize SimpleTreeModel exampleCarl Schwan2023-06-281-15/+14
| | | | | | | | Use std::unique_ptr to manage items tree memory allocations. This also use the new string literals operator. Change-Id: Iab002b5dc612b75cef0be10862e263c6c6c013c1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@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>
* Use QList instead of QVector in examplesJarek Kobus2020-06-231-3/+3
| | | | | | Task-number: QTBUG-84469 Change-Id: Id14119168bb1bf11f99bda7ef6ee9cf51bcfab2e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Docs: Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-281-1/+2
| | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Applied suitable wrapping round various char and string literals, since docs are meant to show best practice. Change-Id: Ie061905fad26f9b4dda3eedba4612704f0a19126 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cleanup SimpleTreeModel exampleChristian Ehrlicher2019-01-231-20/+15
| | | | | | | | | | | Cleanup the SimpleTreeModel example: - include own headers first - use nullptr - add sanity checks Change-Id: If57d608e3919368b2022ff86aede8de9c2ba7369 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* 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>
* Examples/Doc snippets: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | Use character literals where applicable. Change-Id: I79fa5018f05735201ae35ee94ba0d356fcad1056 Reviewed-by: Topi Reiniö <topi.reinio@digia.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>
* simpletreemodel example: rename parent() to parentItem() for clarityDavid Faure2014-05-251-1/+1
| | | | | | | | | | I show this example during trainings, and parent() is too much like QObject::parent(), QModelIndex::parent() and our model's parent() [which calls this method], so it's less confusing if this is called something clearer like parentItem(). Change-Id: I101342051349d94c4a3bc3d4bc332194d6779293 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.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>
* Always use QAIM to get the default flags.Stephen Kelly2012-11-281-1/+1
| | | | | Change-Id: I801f5c8023e3e3672fde28139a7f34f640e650f5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QtBase: examples/widgets/itemviews code styleDavid Schulz2012-11-221-3/+3
| | | | | Change-Id: I78a7745f7dc3add3fd7780220118d1b35b50a941 Reviewed-by: hjk <qthjk@ovi.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-6/+6
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Moving .qdoc files under examples/widgets/docGabriel de Dietrich2012-08-201-0/+218
Updated those .qdoc files to refer to the new relative examples emplacement. Images and snippets to be moved later. Also grouped all widgets related examples under widgets. Change-Id: Ib29696e2d8948524537f53e8dda88f9ee26a597f Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>