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: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
6ee5e09680
commit
819ad98520
@@ -223,8 +223,11 @@ void SelectionTool::itemsAboutToRemoved(const QList<FormEditorItem*> &itemList)
|
|||||||
{
|
{
|
||||||
const QList<FormEditorItem *> current = items();
|
const QList<FormEditorItem *> current = items();
|
||||||
|
|
||||||
QList<FormEditorItem *> remaining = Utils::filtered(current, [&itemList](FormEditorItem *item) {
|
const auto allItems = scene()->items();
|
||||||
return !itemList.contains(item);
|
QList<FormEditorItem *> remaining = Utils::filtered(current,
|
||||||
|
[&itemList, &allItems](FormEditorItem *item) {
|
||||||
|
return !itemList.contains(item)
|
||||||
|
&& allItems.contains(item);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!remaining.isEmpty()) {
|
if (!remaining.isEmpty()) {
|
||||||
|
Reference in New Issue
Block a user