summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qlistwidget.h
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-11-04 19:42:41 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-11-08 16:53:59 +0000
commit63967313f57add6517cdc50b8a77fa319a2b7df0 (patch)
treea2fed36662f3b7407855eb6516ea1e445c415895 /src/widgets/itemviews/qlistwidget.h
parent97f73e957756753b09a778daf2ee8f0ddb97f746 (diff)
ItemWidgets: add helper function to retrieve the underlying model
Add a new function to return the underlying model to avoid code duplication and make the code more readable. Also replace some 0 with nullptr. Change-Id: I1ca33de6f26b4e36f46ce7d2eacc45d0799478a3 Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/itemviews/qlistwidget.h')
-rw-r--r--src/widgets/itemviews/qlistwidget.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h
index d3b27d201a..e96f639502 100644
--- a/src/widgets/itemviews/qlistwidget.h
+++ b/src/widgets/itemviews/qlistwidget.h
@@ -61,10 +61,10 @@ class Q_WIDGETS_EXPORT QListWidgetItem
friend class QListWidget;
public:
enum ItemType { Type = 0, UserType = 1000 };
- explicit QListWidgetItem(QListWidget *view = nullptr, int type = Type);
- explicit QListWidgetItem(const QString &text, QListWidget *view = nullptr, int type = Type);
+ explicit QListWidgetItem(QListWidget *listview = nullptr, int type = Type);
+ explicit QListWidgetItem(const QString &text, QListWidget *listview = nullptr, int type = Type);
explicit QListWidgetItem(const QIcon &icon, const QString &text,
- QListWidget *view = nullptr, int type = Type);
+ QListWidget *listview = nullptr, int type = Type);
QListWidgetItem(const QListWidgetItem &other);
virtual ~QListWidgetItem();
@@ -166,6 +166,8 @@ public:
inline int type() const { return rtti; }
private:
+ QListModel *listModel() const;
+private:
int rtti;
QVector<void *> dummy;
QListWidget *view;