diff options
Diffstat (limited to 'src/designer/src/lib/shared/qdesigner_propertycommand.cpp')
-rw-r--r-- | src/designer/src/lib/shared/qdesigner_propertycommand.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp index 223fd76ae..9dde361e2 100644 --- a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp @@ -651,8 +651,14 @@ PropertyHelper::PropertyHelper(QObject* object, m_parentWidget = (qobject_cast<QWidget*>(object))->parentWidget(); m_objectType = OT_Widget; } else { - if (const QAction *action = qobject_cast<const QAction *>(m_object)) - m_objectType = action->associatedWidgets().isEmpty() ? OT_FreeAction : OT_AssociatedAction; + if (const QAction *action = qobject_cast<const QAction *>(m_object)) { + const QObjectList associatedObjects = action->associatedObjects(); + auto it = std::find_if(associatedObjects.cbegin(), associatedObjects.cend(), + [](QObject *obj) { + return qobject_cast<QWidget *>(obj) != nullptr; + }); + m_objectType = (it == associatedObjects.cend()) ? OT_FreeAction : OT_AssociatedAction; + } } if(debugPropertyCommands) |