-void SelectionModelSynchronizer::syncedSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) {
- Q_UNUSED(selected);
- Q_UNUSED(deselected);
-
- if(!_changeSelectionEnabled)
- return;
-
- QItemSelectionModel *selectionModel = qobject_cast<QItemSelectionModel *>(sender());
- Q_ASSERT(selectionModel);
-
- QItemSelection mappedSelection = selectionModel->selection();
- QItemSelection currentSelectionMapped = mapSelectionFromSource(currentSelection(), selectionModel);
-
- QItemSelection checkSelection = currentSelectionMapped;
- checkSelection.merge(mappedSelection, QItemSelectionModel::Deselect);
- if(checkSelection.isEmpty()) {
- // that means the new selection contains the current selection (currentSel - newSel = {})
- checkSelection = mappedSelection;
- checkSelection.merge(currentSelectionMapped, QItemSelectionModel::Deselect);
- if(checkSelection.isEmpty()) {
- // that means the current selection contains the new selection (newSel - currentSel = {})
- // -> currentSel == newSel
- return;
+
+void SelectionModelSynchronizer::syncedSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
+{
+ Q_UNUSED(selected);
+ Q_UNUSED(deselected);
+
+ if (!_changeSelectionEnabled)
+ return;
+
+ QItemSelectionModel *selectionModel = qobject_cast<QItemSelectionModel *>(sender());
+ Q_ASSERT(selectionModel);
+
+ QItemSelection mappedSelection = selectionModel->selection();
+ QItemSelection currentSelectionMapped = mapSelectionFromSource(currentSelection(), selectionModel);
+
+ QItemSelection checkSelection = currentSelectionMapped;
+ checkSelection.merge(mappedSelection, QItemSelectionModel::Deselect);
+ if (checkSelection.isEmpty()) {
+ // that means the new selection contains the current selection (currentSel - newSel = {})
+ checkSelection = mappedSelection;
+ checkSelection.merge(currentSelectionMapped, QItemSelectionModel::Deselect);
+ if (checkSelection.isEmpty()) {
+ // that means the current selection contains the new selection (newSel - currentSel = {})
+ // -> currentSel == newSel
+ return;
+ }