forked from qt-creator/qt-creator
QmlDesigner: Fix crash
The items in selection tool can be dangling. Therefore we check it against all items in the scene. Task-number: QDS-15146 Change-Id: I1008e6855f874bf4f9d6c2f615ecf6b628747666 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
e5a44265d4
commit
c4a8272734
@@ -223,9 +223,12 @@ void SelectionTool::itemsAboutToRemoved(const QList<FormEditorItem*> &itemList)
|
||||
{
|
||||
const QList<FormEditorItem *> current = items();
|
||||
|
||||
QList<FormEditorItem *> remaining = Utils::filtered(current, [&itemList](FormEditorItem *item) {
|
||||
return !itemList.contains(item);
|
||||
});
|
||||
const auto allItems = scene()->items();
|
||||
QList<FormEditorItem *> remaining = Utils::filtered(current,
|
||||
[&itemList, &allItems](FormEditorItem *item) {
|
||||
return !itemList.contains(item)
|
||||
&& allItems.contains(item);
|
||||
});
|
||||
|
||||
if (!remaining.isEmpty()) {
|
||||
m_selectionIndicator.setItems(remaining);
|
||||
|
Reference in New Issue
Block a user