diff options
author | Andreas Buhr <andreas.buhr@qt.io> | 2021-07-08 10:10:27 +0200 |
---|---|---|
committer | Andreas Buhr <andreas.buhr@qt.io> | 2021-07-15 18:09:12 +0200 |
commit | 4cd2cca553ba2fdcd6cd59c2cd055fc8e6e83ae4 (patch) | |
tree | 7b9968ab7bacdb1a882560f9435bebab2a83ae2a /src/widgets/itemviews/qtreewidget.h | |
parent | 27d6314b9598908cbb9c2a589fb62f3653fa9062 (diff) |
Initialize class members of QTreeWidgetItem at declaration
The members view, par, and itemFlags were initialized in each
of its nine constructors. This patch moves the initilaization to
the declaration to prevent this repetition.
Change-Id: I71d136e7615dca5d87e8a4dc161c877633017ad0
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/itemviews/qtreewidget.h')
-rw-r--r-- | src/widgets/itemviews/qtreewidget.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h index cdf752e4b1..21f6883cae 100644 --- a/src/widgets/itemviews/qtreewidget.h +++ b/src/widgets/itemviews/qtreewidget.h @@ -202,13 +202,14 @@ private: int rtti; // One item has a vector of column entries. Each column has a vector of (role, value) pairs. QList<QList<QWidgetItemData>> values; - QTreeWidget *view; + QTreeWidget *view = nullptr; QTreeWidgetItemPrivate *d; - QTreeWidgetItem *par; + QTreeWidgetItem *par = nullptr; // ### Qt7: Move children to d-pointer and replace QList by a suitable data structure. // to fix QTBUG-94546 QList<QTreeWidgetItem*> children; - Qt::ItemFlags itemFlags; + Qt::ItemFlags itemFlags = Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled + | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled; }; inline void QTreeWidgetItem::setText(int column, const QString &atext) |