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 18:18:47 +0000
commit2d55aa2cc4faa33104398fd0bd69e7e184c79fd6 (patch)
tree1658dd821cc4ab8730324ddbf09f12956e03a0df
parente4b643f9ae7d15fd2ca585bfbf5a18e97ea16c64 (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 139efaf62..58b4b4975 100644
--- a/src/designer/src/components/propertyeditor/propertyeditor.cpp
+++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp
@@ -374,6 +374,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();
}