summaryrefslogtreecommitdiffstats
path: root/examples/charts/barmodelmapper/customtablemodel.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-08-15 12:22:16 +0200
committerLiang Qi <liang.qi@qt.io>2017-08-15 13:06:48 +0200
commit0168fe1f95d56850734447b118cdcf1847da1c51 (patch)
tree55763c374af875fc7228dc8d1f3771ef74c083cb /examples/charts/barmodelmapper/customtablemodel.cpp
parentac79bf382a9fabed940b8f9be20feeb58ac205aa (diff)
parent1f47b1a7ae58702dccc57a9ccbaa905441f4fecb (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: .qmake.conf examples/charts/dynamicspline/chart.cpp examples/charts/piechartdrilldown/main.cpp Change-Id: I839e97bf377c7823f2f464c097656d58f279ed77
Diffstat (limited to 'examples/charts/barmodelmapper/customtablemodel.cpp')
-rw-r--r--examples/charts/barmodelmapper/customtablemodel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/charts/barmodelmapper/customtablemodel.cpp b/examples/charts/barmodelmapper/customtablemodel.cpp
index 2caef9b5..71165dff 100644
--- a/examples/charts/barmodelmapper/customtablemodel.cpp
+++ b/examples/charts/barmodelmapper/customtablemodel.cpp
@@ -88,10 +88,10 @@ QVariant CustomTableModel::data(const QModelIndex &index, int role) const
} else if (role == Qt::EditRole) {
return m_data[index.row()]->at(index.column());
} else if (role == Qt::BackgroundRole) {
- QRect rect;
- foreach (rect, m_mapping)
- if (rect.contains(index.column(), index.row()))
- return QColor(m_mapping.key(rect));
+ for (const QRect &rect : m_mapping) {
+ if (rect.contains(index.column(), index.row()))
+ return QColor(m_mapping.key(rect));
+ }
// cell not mapped return white color
return QColor(Qt::white);