summaryrefslogtreecommitdiffstats
path: root/examples/widgets/itemviews/addressbook/tablemodel.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@digia.com>2012-11-21 15:45:13 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-22 08:24:26 +0100
commit78a239bc6d344f53cf48e4bceca7d45df69220e6 (patch)
tree954f97b37634b7aa86c75e6833180cab946bce27 /examples/widgets/itemviews/addressbook/tablemodel.cpp
parent8a83c1bb5504d34e07ce7cce36c10b6d5a9876bd (diff)
QtBase: examples/widgets/itemviews/addressbook codestyle
Change-Id: I710d67018351c34ef14ac30edcca81aba7ff5ad3 Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'examples/widgets/itemviews/addressbook/tablemodel.cpp')
-rw-r--r--examples/widgets/itemviews/addressbook/tablemodel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/widgets/itemviews/addressbook/tablemodel.cpp b/examples/widgets/itemviews/addressbook/tablemodel.cpp
index 7d21337750..5d18392d4e 100644
--- a/examples/widgets/itemviews/addressbook/tablemodel.cpp
+++ b/examples/widgets/itemviews/addressbook/tablemodel.cpp
@@ -46,10 +46,10 @@ TableModel::TableModel(QObject *parent)
{
}
-TableModel::TableModel(QList< QPair<QString, QString> > pairs, QObject *parent)
+TableModel::TableModel(QList<QPair<QString, QString> > pairs, QObject *parent)
: QAbstractTableModel(parent)
{
- listOfPairs=pairs;
+ listOfPairs = pairs;
}
//! [0]
@@ -114,9 +114,9 @@ QVariant TableModel::headerData(int section, Qt::Orientation orientation, int ro
bool TableModel::insertRows(int position, int rows, const QModelIndex &index)
{
Q_UNUSED(index);
- beginInsertRows(QModelIndex(), position, position+rows-1);
+ beginInsertRows(QModelIndex(), position, position + rows - 1);
- for (int row=0; row < rows; row++) {
+ for (int row = 0; row < rows; ++row) {
QPair<QString, QString> pair(" ", " ");
listOfPairs.insert(position, pair);
}
@@ -130,9 +130,9 @@ bool TableModel::insertRows(int position, int rows, const QModelIndex &index)
bool TableModel::removeRows(int position, int rows, const QModelIndex &index)
{
Q_UNUSED(index);
- beginRemoveRows(QModelIndex(), position, position+rows-1);
+ beginRemoveRows(QModelIndex(), position, position + rows - 1);
- for (int row=0; row < rows; ++row) {
+ for (int row = 0; row < rows; ++row) {
listOfPairs.removeAt(position);
}