diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-11-15 21:57:42 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-12-06 18:22:41 +0100 |
commit | a3e20df03d522bd1b07ac7a85578401f36f290b9 (patch) | |
tree | f4ed5be0841a6b38e16fd1fb4bf6ddee46eadc0a /examples/widgets/itemviews/simpletreemodel/treeitem.h | |
parent | 283cdcd3d5fad368c9df1bcae69cbfbf9ade623f (diff) |
Polish the SimpleTreeModel example
- 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>
Diffstat (limited to 'examples/widgets/itemviews/simpletreemodel/treeitem.h')
-rw-r--r-- | examples/widgets/itemviews/simpletreemodel/treeitem.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/widgets/itemviews/simpletreemodel/treeitem.h b/examples/widgets/itemviews/simpletreemodel/treeitem.h index 8edebcc34b..b9002f06fd 100644 --- a/examples/widgets/itemviews/simpletreemodel/treeitem.h +++ b/examples/widgets/itemviews/simpletreemodel/treeitem.h @@ -11,7 +11,7 @@ class TreeItem { public: - explicit TreeItem(const QVariantList &data, TreeItem *parentItem = nullptr); + explicit TreeItem(QVariantList data, TreeItem *parentItem = nullptr); void appendChild(std::unique_ptr<TreeItem> &&child); |