diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-06-15 16:43:43 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-06-20 20:52:28 +0000 |
commit | e80a3b49c0aac237104e1696fc64b3a924c89ca1 (patch) | |
tree | 9ab978ddf4bd9666333a9b4f316745401e832018 /src/widgets/itemviews | |
parent | fc7f58b3007fb356a52cb21f3aa5f5478cb46791 (diff) |
Item widgets: API cleanups
A few functions ended up in the wrong visibility section.
For instance, it should be perfectly fine to call indexFromItem
even from non-subclasses. We can't change that in Qt 5, make a note
for Qt 6.
Change-Id: I277d831ef1a4b3dcae99bef299ea334954d5b0d3
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r-- | src/widgets/itemviews/qlistwidget.h | 9 | ||||
-rw-r--r-- | src/widgets/itemviews/qtablewidget.h | 8 | ||||
-rw-r--r-- | src/widgets/itemviews/qtreewidget.h | 8 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h index 2dbdbdf48b..fee99fa428 100644 --- a/src/widgets/itemviews/qlistwidget.h +++ b/src/widgets/itemviews/qlistwidget.h @@ -254,6 +254,9 @@ public: bool isItemHidden(const QListWidgetItem *item) const; void setItemHidden(const QListWidgetItem *item, bool hide); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +protected: +#endif #if QT_CONFIG(draganddrop) void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; #endif @@ -287,6 +290,12 @@ protected: virtual bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action); virtual Qt::DropActions supportedDropActions() const; #endif + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +public: +#else +protected: +#endif QList<QListWidgetItem*> items(const QMimeData *data) const; QModelIndex indexFromItem(QListWidgetItem *item) const; diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h index 8b827bc16b..092ce77306 100644 --- a/src/widgets/itemviews/qtablewidget.h +++ b/src/widgets/itemviews/qtablewidget.h @@ -329,10 +329,18 @@ protected: #endif virtual bool dropMimeData(int row, int column, const QMimeData *data, Qt::DropAction action); virtual Qt::DropActions supportedDropActions() const; + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +public: +#else +protected: +#endif QList<QTableWidgetItem*> items(const QMimeData *data) const; QModelIndex indexFromItem(QTableWidgetItem *item) const; QTableWidgetItem *itemFromIndex(const QModelIndex &index) const; + +protected: #if QT_CONFIG(draganddrop) void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; #endif diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h index 70f7d1507b..5fa6ffcd17 100644 --- a/src/widgets/itemviews/qtreewidget.h +++ b/src/widgets/itemviews/qtreewidget.h @@ -357,11 +357,19 @@ protected: virtual bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action); virtual Qt::DropActions supportedDropActions() const; + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +public: +#else +protected: +#endif QList<QTreeWidgetItem*> items(const QMimeData *data) const; QModelIndex indexFromItem(const QTreeWidgetItem *item, int column = 0) const; QModelIndex indexFromItem(QTreeWidgetItem *item, int column = 0) const; // ### Qt 6: remove QTreeWidgetItem *itemFromIndex(const QModelIndex &index) const; + +protected: #if QT_CONFIG(draganddrop) void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; #endif |