summaryrefslogtreecommitdiff
path: root/src/designer/src/components/propertyeditor
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-01-04 12:11:11 +0100
committerLiang Qi <liang.qi@qt.io>2019-01-04 13:03:26 +0100
commit7b23692538f55d499bf094a750311e1e4cd13ec6 (patch)
tree7e85cdabe0e069ee8fcbc3da3764327b4f8e2ba2 /src/designer/src/components/propertyeditor
parentaa316d1d463777612db4b144d945bbaf67481494 (diff)
parent32897fd0b98966d22ecbd475a0e6a77ca8b1108d (diff)
downloadqttools-7b23692538f55d499bf094a750311e1e4cd13ec6.tar.gz
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: src/qdoc/htmlgenerator.cpp src/qtattributionsscanner/qdocgenerator.cpp Done-With: Martin Smith <martin.smith@qt.io> Change-Id: I56a23175579a1a699939179da2f35bbcd6c73367
Diffstat (limited to 'src/designer/src/components/propertyeditor')
-rw-r--r--src/designer/src/components/propertyeditor/propertyeditor.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/designer/src/components/propertyeditor/propertyeditor.cpp b/src/designer/src/components/propertyeditor/propertyeditor.cpp
index 1fee704d2..d393caee5 100644
--- a/src/designer/src/components/propertyeditor/propertyeditor.cpp
+++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp
@@ -913,8 +913,15 @@ 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;
+ // QTBUG-68507: Form window can be null for objects in Morph Undo macros with buddies
+ if (object != nullptr && formWindow == nullptr) {
+ formWindow = m_core->formWindowManager()->activeFormWindow();
+ if (formWindow == nullptr) {
+ qWarning("PropertyEditor::setObject(): Unable to find form window for \"%s\".",
+ qPrintable(object->objectName()));
+ return;
+ }
+ }
FormWindowBase *fwb = qobject_cast<FormWindowBase *>(formWindow);
const bool idIdBasedTranslation = fwb && fwb->useIdBasedTranslations();
const bool idIdBasedTranslationUnchanged = (idIdBasedTranslation == DesignerPropertyManager::useIdBasedTranslations());