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-16 17:48:47 +0000
commit005e3707ed20b8ab30b09359dc95f39b01b62fef (patch)
tree5f394977fb2d249a3d1001a142a8e121c71d0b55
parent9658b8b7a36c7149c82c10f09cade5821e8b5e88 (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 1b9b3c225..a85c48721 100644
--- a/src/designer/src/components/propertyeditor/propertyeditor.cpp
+++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp
@@ -341,6 +341,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();
}