summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp1
-rw-r--r--src/widgets/itemviews/qheaderview.cpp1
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp9
-rw-r--r--src/widgets/itemviews/qlistview.cpp2
4 files changed, 10 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 20002b1f82..d24456edef 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -4035,6 +4035,7 @@ QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionC
switch (static_cast<const QKeyEvent*>(event)->key()) {
case Qt::Key_Backtab:
modifiers = modifiers & ~Qt::ShiftModifier; // special case for backtab
+ Q_FALLTHROUGH();
case Qt::Key_Down:
case Qt::Key_Up:
case Qt::Key_Left:
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index d2f9618c29..e0e993ce77 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -2565,6 +2565,7 @@ void QHeaderView::mouseReleaseEvent(QMouseEvent *e)
d->updateSectionIndicator(d->section, pos);
break;
} // not moving
+ Q_FALLTHROUGH();
case QHeaderViewPrivate::SelectSections:
if (!d->clickableSections) {
int section = logicalIndexAt(pos);
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index c044d37575..c535cf5f9e 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -55,6 +55,7 @@
#include <qapplication.h>
#include <qdebug.h>
+#include <vector>
#include <algorithm>
QT_BEGIN_NAMESPACE
@@ -191,9 +192,11 @@ QByteArray QItemEditorFactory::valuePropertyName(int userType) const
QItemEditorFactory::~QItemEditorFactory()
{
//we make sure we delete all the QItemEditorCreatorBase
- //this has to be done only once, hence the QSet
- QSet<QItemEditorCreatorBase*> set = creatorMap.values().toSet();
- qDeleteAll(set);
+ //this has to be done only once, hence the sort-unique idiom
+ std::vector<QItemEditorCreatorBase*> creators(creatorMap.cbegin(), creatorMap.cend());
+ std::sort(creators.begin(), creators.end());
+ const auto it = std::unique(creators.begin(), creators.end());
+ qDeleteAll(creators.begin(), it);
}
/*!
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 653b03ef0d..3ef5b788c6 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -1157,6 +1157,7 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
rect.moveTop(rect.top() - d->viewport->height() + 2 * rect.height());
if (rect.top() < rect.height())
rect.moveTop(rect.height());
+ Q_FALLTHROUGH();
case MovePrevious:
case MoveUp:
while (intersectVector.isEmpty()) {
@@ -1185,6 +1186,7 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
rect.moveTop(rect.top() + d->viewport->height() - 2 * rect.height());
if (rect.bottom() > contents.height() - rect.height())
rect.moveBottom(contents.height() - rect.height());
+ Q_FALLTHROUGH();
case MoveNext:
case MoveDown:
while (intersectVector.isEmpty()) {