Add option to not reset seletion on any / all index type change

This commit is contained in:
WarmUpTill 2022-12-10 17:20:41 +01:00 committed by WarmUpTill
parent 20cbe636df
commit 4ab88ea218
2 changed files with 10 additions and 3 deletions

View File

@ -369,10 +369,17 @@ void SceneItemSelectionWidget::SetShowAll(bool value)
_hasAllEntry = value;
}
void SceneItemSelectionWidget::SetShowAllSelectionType(AllSelectionType t)
void SceneItemSelectionWidget::SetShowAllSelectionType(AllSelectionType t,
bool resetSelection)
{
_allType = t;
_sceneItems->setCurrentIndex(0);
if (resetSelection) {
_sceneItems->setCurrentIndex(0);
} else {
auto count = _idx->count() - 1;
const QSignalBlocker b(_idx);
SetupIdxSelection(count > 0 ? count : 1);
}
}
void SceneItemSelectionWidget::SceneChanged(const SceneSelection &s)

View File

@ -51,7 +51,7 @@ public:
void SetSceneItem(const SceneItemSelection &);
void SetScene(const SceneSelection &);
void SetShowAll(bool);
void SetShowAllSelectionType(AllSelectionType t);
void SetShowAllSelectionType(AllSelectionType t, bool resetSelection = true);
signals:
void SceneItemChanged(const SceneItemSelection &);