+}
+
+void SelectionModelSynchronizer::addRegularSelectionModel(QItemSelectionModel *selectionmodel) {
+ if(selectionmodel->model() != model()) {
+ qWarning() << "cannot Syncronize QItemSelectionModel" << selectionmodel << "which has a different model()";
+ return;
+ }
+ connect(selectionmodel, SIGNAL(currentChanged(QModelIndex, QModelIndex)),
+ this, SLOT(_regularCurrentChanged(QModelIndex, QModelIndex)));
+ connect(selectionmodel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
+ this, SLOT(_regularSelectionChanged(QItemSelection, QItemSelection)));
+
+ connect(this, SIGNAL(setCurrentIndex(QModelIndex, QItemSelectionModel::SelectionFlags)),
+ selectionmodel, SLOT(setCurrentIndex(QModelIndex, QItemSelectionModel::SelectionFlags)));
+ connect(this, SIGNAL(select(QItemSelection, QItemSelectionModel::SelectionFlags)),
+ selectionmodel, SLOT(select(QItemSelection, QItemSelectionModel::SelectionFlags)));