TechDraw: Fix selections not clearing when subelements are also selected
This commit is contained in:
committed by
Chris Hennes
parent
5349b819b0
commit
e26a47d96c
@@ -197,15 +197,12 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
}
|
||||
|
||||
if (change == ItemSelectedHasChanged && scene()) {
|
||||
bool thisViewIsSelected = value.toBool();
|
||||
bool anyChildSelected = false;
|
||||
if (!thisViewIsSelected) { // Only check children if this view is becoming unselected
|
||||
anyChildSelected =
|
||||
std::ranges::any_of(childItems(), [](QGraphicsItem* child) {
|
||||
return child->isSelected();
|
||||
});
|
||||
}
|
||||
if(thisViewIsSelected || anyChildSelected || isSelected()) {
|
||||
std::vector<Gui::SelectionObject> currentSelection = Gui::Selection().getSelectionEx();
|
||||
bool isViewObjectSelected = Gui::Selection().isSelected(getViewObject());
|
||||
bool hasSelectedSubElements =
|
||||
!DrawGuiUtil::getSubsForSelectedObject(currentSelection, getViewObject()).empty();
|
||||
|
||||
if (isViewObjectSelected || hasSelectedSubElements) {
|
||||
m_colCurrent = getSelectColor();
|
||||
m_border->show();
|
||||
m_label->show();
|
||||
|
||||
Reference in New Issue
Block a user