QItemSelectionModelPrivate: improve formatting of the connections

The formatting of the connections in the initModel() call was confusing
and made me overlook the fact that they all were directly used to
initialize the connections array.
Indent all the nested connections, and move the closing '}' to a
separate line to make the code more readable.

This commit amends 4f4a8e75ab34003a4a49b89392ae7712415ac788.

Change-Id: I607e09699a3b4865cb17639ffc75f754f4400c91
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 76617b07cf386f46a094b811373718725b14174e)
This commit is contained in:
Ivan Solovev 2023-09-06 11:24:22 +02:00
parent f56b186f78
commit 355e2aa12c

View File

@ -562,30 +562,31 @@ void QItemSelectionModelPrivate::initModel(QAbstractItemModel *m)
if (model.value()) {
connections = std::array<QMetaObject::Connection, 12> {
QObjectPrivate::connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
this, &QItemSelectionModelPrivate::rowsAboutToBeRemoved),
QObjectPrivate::connect(model, &QAbstractItemModel::columnsAboutToBeRemoved,
this, &QItemSelectionModelPrivate::columnsAboutToBeRemoved),
QObjectPrivate::connect(model, &QAbstractItemModel::rowsAboutToBeInserted,
this, &QItemSelectionModelPrivate::rowsAboutToBeInserted),
QObjectPrivate::connect(model, &QAbstractItemModel::columnsAboutToBeInserted,
this, &QItemSelectionModelPrivate::columnsAboutToBeInserted),
QObjectPrivate::connect(model, &QAbstractItemModel::rowsAboutToBeMoved,
this, &QItemSelectionModelPrivate::triggerLayoutToBeChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::columnsAboutToBeMoved,
this, &QItemSelectionModelPrivate::triggerLayoutToBeChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::rowsMoved,
this, &QItemSelectionModelPrivate::triggerLayoutChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::columnsMoved,
this, &QItemSelectionModelPrivate::triggerLayoutChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::layoutAboutToBeChanged,
this, &QItemSelectionModelPrivate::layoutAboutToBeChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::layoutChanged,
this, &QItemSelectionModelPrivate::layoutChanged),
QObject::connect(model, &QAbstractItemModel::modelReset,
q, &QItemSelectionModel::reset),
QObjectPrivate::connect(model, &QAbstractItemModel::destroyed,
this, &QItemSelectionModelPrivate::modelDestroyed)};
QObjectPrivate::connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
this, &QItemSelectionModelPrivate::rowsAboutToBeRemoved),
QObjectPrivate::connect(model, &QAbstractItemModel::columnsAboutToBeRemoved,
this, &QItemSelectionModelPrivate::columnsAboutToBeRemoved),
QObjectPrivate::connect(model, &QAbstractItemModel::rowsAboutToBeInserted,
this, &QItemSelectionModelPrivate::rowsAboutToBeInserted),
QObjectPrivate::connect(model, &QAbstractItemModel::columnsAboutToBeInserted,
this, &QItemSelectionModelPrivate::columnsAboutToBeInserted),
QObjectPrivate::connect(model, &QAbstractItemModel::rowsAboutToBeMoved,
this, &QItemSelectionModelPrivate::triggerLayoutToBeChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::columnsAboutToBeMoved,
this, &QItemSelectionModelPrivate::triggerLayoutToBeChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::rowsMoved,
this, &QItemSelectionModelPrivate::triggerLayoutChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::columnsMoved,
this, &QItemSelectionModelPrivate::triggerLayoutChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::layoutAboutToBeChanged,
this, &QItemSelectionModelPrivate::layoutAboutToBeChanged),
QObjectPrivate::connect(model, &QAbstractItemModel::layoutChanged,
this, &QItemSelectionModelPrivate::layoutChanged),
QObject::connect(model, &QAbstractItemModel::modelReset,
q, &QItemSelectionModel::reset),
QObjectPrivate::connect(model, &QAbstractItemModel::destroyed,
this, &QItemSelectionModelPrivate::modelDestroyed)
};
}
}