From fa23cdf45a2416f0a4505f9f9bc63a83603dab74 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 8 Apr 2011 17:14:22 +0200 Subject: Designer: Allow promoted QWidget's to be buddies. Extend check for focusPolicy by promoted check. Task-number: QTBUG-18631 --- tools/designer/src/components/buddyeditor/buddyeditor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/designer/src/components/buddyeditor/buddyeditor.cpp b/tools/designer/src/components/buddyeditor/buddyeditor.cpp index d35415d..34e1681 100644 --- a/tools/designer/src/components/buddyeditor/buddyeditor.cpp +++ b/tools/designer/src/components/buddyeditor/buddyeditor.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -75,7 +76,8 @@ static bool canBeBuddy(QWidget *w, QDesignerFormWindowInterface *form) if (index != -1) { bool ok = false; const Qt::FocusPolicy q = static_cast(qdesigner_internal::Utils::valueOf(sheet->property(index), &ok)); - return ok && q != Qt::NoFocus; + // Refuse No-focus unless the widget is promoted. + return (ok && q != Qt::NoFocus) || qdesigner_internal::isPromoted(form->core(), w); } } return false; -- cgit v0.12