summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-06-16 13:04:25 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-17 05:43:25 +0000
commit00d0f9a3b457bff3cca3c47966331a48cd590b03 (patch)
tree453aecbe16780ef47907ec8a6835b68a1f9b5f62
parent15d3908bd8d1e18c73a2985465ed2aaef7dbe6fe (diff)
Qt Designer: Fix occasional exit assert in property editor
Changing the current item when deleting the item in the tree property browser was causing: ASSERT failure in qdesigner_internal::PropertyEditor: "Called object is not of the correct type (class destructor may have already run)", file QtCore/qobjectdefs_impl.h, line 155 Clear the current item in the destructor to fix this. Task-number: QTBUG-104377 Change-Id: I7106d4c7e41c1af4d90efdd49fc07776a27d9e25 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit f9fa71fa36d2d6f62e0142601661e4ff4f92c921) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/designer/src/components/propertyeditor/propertyeditor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/designer/src/components/propertyeditor/propertyeditor.cpp b/src/designer/src/components/propertyeditor/propertyeditor.cpp
index 4a30c5c3c..966eaa7b0 100644
--- a/src/designer/src/components/propertyeditor/propertyeditor.cpp
+++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp
@@ -366,6 +366,9 @@ PropertyEditor::PropertyEditor(QDesignerFormEditorInterface *core, QWidget *pare
PropertyEditor::~PropertyEditor()
{
+ // Prevent emission of QtTreePropertyBrowser::itemChanged() when deleting
+ // the current item, causing asserts.
+ m_treeBrowser->setCurrentItem(nullptr);
storeExpansionState();
saveSettings();
}