summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-06-27 15:43:33 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-08-19 18:38:53 +0000
commit9f888d2fde9c5413e5519e0914e9b13638760985 (patch)
tree7e211a2ae70c272ea8041d5100f0c9a67b32de1b /src/widgets/itemviews
parent25dd9c521fc064a71db63b110b7973225ee20c02 (diff)
Support C++17 fallthrough attribute
Replaces our mix of comments for annotating intended absence of break in switches with the C++17 attribute [[fallthrough]], or its earlier a clang extension counterpart. Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp4
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 7b393463a6..6f1e301d4f 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -2563,7 +2563,7 @@ void QHeaderView::mouseReleaseEvent(QMouseEvent *e)
int section = logicalIndexAt(pos);
updateSection(section);
}
- // fall through
+ Q_FALLTHROUGH();
case QHeaderViewPrivate::NoState:
if (d->clickableSections) {
int section = logicalIndexAt(pos);
@@ -2669,7 +2669,7 @@ bool QHeaderView::viewportEvent(QEvent *e)
case QEvent::FontChange:
case QEvent::StyleChange:
d->invalidateCachedSizeHint();
- // Fall through
+ Q_FALLTHROUGH();
case QEvent::Hide:
case QEvent::Show: {
QAbstractScrollArea *parent = qobject_cast<QAbstractScrollArea *>(parentWidget());
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 74ca7d2827..5e0f13277c 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -1737,7 +1737,7 @@ void QTreeWidgetItem::setData(int column, int role, const QVariant &value)
}
}
}
- // Don't break, but fall through
+ Q_FALLTHROUGH();
default:
if (column < values.count()) {
bool found = false;
@@ -1787,7 +1787,7 @@ QVariant QTreeWidgetItem::data(int column, int role) const
// special case for check state in tristate
if (children.count() && (itemFlags & Qt::ItemIsAutoTristate))
return childrenCheckState(column);
- // fallthrough intended
+ Q_FALLTHROUGH();
default:
if (column >= 0 && column < values.size()) {
const QVector<QWidgetItemData> &column_values = values.at(column);