diff options
Diffstat (limited to 'examples/charts/barmodelmapper')
-rw-r--r-- | examples/charts/barmodelmapper/customtablemodel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/charts/barmodelmapper/customtablemodel.cpp b/examples/charts/barmodelmapper/customtablemodel.cpp index 23b5271c..a1446386 100644 --- a/examples/charts/barmodelmapper/customtablemodel.cpp +++ b/examples/charts/barmodelmapper/customtablemodel.cpp @@ -89,10 +89,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); |