X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fselectionmodelsynchronizer.cpp;h=fc732d4a386b23aef5940ce7cef3b6acc79dc862;hb=61f33c7895e324f6e95034d86897ad2e963653f1;hp=717ef4e03c7b0fb9f9f5f52297c3a58cb52d5849;hpb=158443f71d48215eea8b47b836b61afd77654b78;p=quassel.git diff --git a/src/client/selectionmodelsynchronizer.cpp b/src/client/selectionmodelsynchronizer.cpp index 717ef4e0..fc732d4a 100644 --- a/src/client/selectionmodelsynchronizer.cpp +++ b/src/client/selectionmodelsynchronizer.cpp @@ -30,10 +30,10 @@ SelectionModelSynchronizer::SelectionModelSynchronizer(QAbstractItemModel *paren _model(parent), _selectionModel(parent) { - connect(&_selectionModel, SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(currentChanged(const QModelIndex &, const QModelIndex &))); - connect(&_selectionModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), - this, SLOT(selectionChanged(const QItemSelection &, const QItemSelection &))); + connect(&_selectionModel, &QItemSelectionModel::currentChanged, + this, &SelectionModelSynchronizer::currentChanged); + connect(&_selectionModel, &QItemSelectionModel::selectionChanged, + this, &SelectionModelSynchronizer::selectionChanged); } @@ -66,12 +66,12 @@ void SelectionModelSynchronizer::synchronizeSelectionModel(QItemSelectionModel * return; } - connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), - this, SLOT(syncedCurrentChanged(QModelIndex, QModelIndex))); - connect(selectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), - this, SLOT(syncedSelectionChanged(QItemSelection, QItemSelection))); + connect(selectionModel, &QItemSelectionModel::currentChanged, + this, &SelectionModelSynchronizer::syncedCurrentChanged); + connect(selectionModel, &QItemSelectionModel::selectionChanged, + this, &SelectionModelSynchronizer::syncedSelectionChanged); - connect(selectionModel, SIGNAL(destroyed(QObject *)), this, SLOT(selectionModelDestroyed(QObject *))); + connect(selectionModel, &QObject::destroyed, this, &SelectionModelSynchronizer::selectionModelDestroyed); _selectionModels << selectionModel; } @@ -87,7 +87,7 @@ void SelectionModelSynchronizer::removeSelectionModel(QItemSelectionModel *model void SelectionModelSynchronizer::selectionModelDestroyed(QObject *object) { - QItemSelectionModel *model = static_cast(object); + auto *model = static_cast(object); QSet::iterator iter = _selectionModels.begin(); while (iter != _selectionModels.end()) { if (*iter == model) { @@ -107,7 +107,7 @@ void SelectionModelSynchronizer::syncedCurrentChanged(const QModelIndex ¤t if (!_changeCurrentEnabled) return; - QItemSelectionModel *selectionModel = qobject_cast(sender()); + auto *selectionModel = qobject_cast(sender()); Q_ASSERT(selectionModel); QModelIndex newSourceCurrent = mapToSource(current, selectionModel); if (newSourceCurrent.isValid() && newSourceCurrent != currentIndex()) @@ -123,7 +123,7 @@ void SelectionModelSynchronizer::syncedSelectionChanged(const QItemSelection &se if (!_changeSelectionEnabled) return; - QItemSelectionModel *selectionModel = qobject_cast(sender()); + auto *selectionModel = qobject_cast(sender()); Q_ASSERT(selectionModel); QItemSelection mappedSelection = selectionModel->selection();