diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-05-28 14:00:21 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-05-28 13:56:31 +0000 |
commit | 548a75049efaa3f9b3087016e3e36cc9b4f23e2e (patch) | |
tree | 3bb7f78fc01980c117ad183bd5b1ff7e29554a07 | |
parent | 8c018aec6b6563784229452fe29a27764b070e34 (diff) | |
download | qttools-548a75049efaa3f9b3087016e3e36cc9b4f23e2e.tar.gz |
Qt Designer: Fix crash when morphing widgets with buddies
Bail out of PropertyEditor::setObject() when no form window
can be found for the current widget, which can happen when
setting the buddy property in morph macro sequences.
Task-number: QTBUG-68507
Change-Id: I61955121d57e1c18e2ccf93d63e51d2df24f0827
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
-rw-r--r-- | src/designer/src/components/propertyeditor/propertyeditor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/designer/src/components/propertyeditor/propertyeditor.cpp b/src/designer/src/components/propertyeditor/propertyeditor.cpp index 2fc1ff415..a0d0a53d4 100644 --- a/src/designer/src/components/propertyeditor/propertyeditor.cpp +++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp @@ -911,6 +911,8 @@ void PropertyEditor::setObject(QObject *object) m_object = object; m_propertyManager->setObject(object); QDesignerFormWindowInterface *formWindow = QDesignerFormWindowInterface::findFormWindow(m_object); + if (Q_UNLIKELY(formWindow == nullptr)) // QTBUG-68507, can happen in Morph Undo macros with buddies + return; FormWindowBase *fwb = qobject_cast<FormWindowBase *>(formWindow); const bool idIdBasedTranslation = fwb && fwb->useIdBasedTranslations(); const bool idIdBasedTranslationUnchanged = (idIdBasedTranslation == DesignerPropertyManager::useIdBasedTranslations()); |