diff options
-rw-r--r-- | tools/designer/src/components/signalsloteditor/signalslot_utils.cpp | 7 | ||||
-rw-r--r-- | tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp b/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp index d0af770..9f72816 100644 --- a/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp +++ b/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp @@ -244,7 +244,12 @@ namespace qdesigner_internal { ClassesMemberFunctions reverseClassesMemberFunctions(const QString &obj_name, MemberType member_type, const QString &peer, QDesignerFormWindowInterface *form) { - QObject *object = qFindChild<QObject*>(form->mainContainer(), obj_name); + QObject *object = 0; + if (obj_name == form->mainContainer()->objectName()) { + object = form->mainContainer(); + } else { + object = qFindChild<QObject*>(form->mainContainer(), obj_name); + } if (!object) return ClassesMemberFunctions(); QDesignerFormEditorInterface *core = form->core(); diff --git a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp index 831649f..6690948 100644 --- a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp @@ -658,8 +658,12 @@ QWidget *ConnectionDelegate::createEditor(QWidget *parent, const qdesigner_internal::ClassesMemberFunctions class_list = qdesigner_internal::reverseClassesMemberFunctions(obj_name, type, peer, m_form); - QObject *object = qFindChild<QObject*>(m_form->mainContainer(), obj_name); - + QObject *object = 0; + if (obj_name == m_form->mainContainer()->objectName()) { + object = m_form->mainContainer(); + } else { + object = qFindChild<QObject*>(m_form->mainContainer(), obj_name); + } inline_editor->addText(type == qdesigner_internal::SignalMember ? tr("<signal>") : tr("<slot>")); foreach (const qdesigner_internal::ClassMemberFunctions &class_info, class_list) { if (class_info.m_className.isEmpty() || class_info.m_memberList.isEmpty()) |