diff options
Diffstat (limited to 'examples/widgets/itemviews/addressbook/tablemodel.cpp')
-rw-r--r-- | examples/widgets/itemviews/addressbook/tablemodel.cpp | 12 |
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); } |