From f7e75244ab62b1fe0d1d73b84a6089d6b2a81d1a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 11 Feb 2011 14:27:39 +0100 Subject: Designer: Slots of main container not visible in signal/slot editor. Fix a regression introduced by dd7873cd7e02e42b384709f33a34f69bc06fb25d of QTBUG-17179. Reviewed-by: Kai Koehne Task-number: QTBUG-17358 --- .../designer/src/components/signalsloteditor/signalslot_utils.cpp | 7 ++++++- .../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(form->mainContainer(), obj_name); + QObject *object = 0; + if (obj_name == form->mainContainer()->objectName()) { + object = form->mainContainer(); + } else { + object = qFindChild(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(m_form->mainContainer(), obj_name); - + QObject *object = 0; + if (obj_name == m_form->mainContainer()->objectName()) { + object = m_form->mainContainer(); + } else { + object = qFindChild(m_form->mainContainer(), obj_name); + } inline_editor->addText(type == qdesigner_internal::SignalMember ? tr("") : tr("")); foreach (const qdesigner_internal::ClassMemberFunctions &class_info, class_list) { if (class_info.m_className.isEmpty() || class_info.m_memberList.isEmpty()) -- cgit v0.12