diff options
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index c776c36..709f6f3 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -3084,9 +3084,10 @@ void QWidgetPrivate::setEnabled_helper(bool enable) #endif #ifndef QT_NO_IM if (q->testAttribute(Qt::WA_InputMethodEnabled) && q->hasFocus()) { - QInputContext *qic = inputContext(); + QWidget *focusWidget = effectiveFocusWidget(); + QInputContext *qic = focusWidget->d_func()->inputContext(); if (enable) { - qic->setFocusWidget(q); + qic->setFocusWidget(focusWidget); } else { qic->reset(); qic->setFocusWidget(0); @@ -4676,8 +4677,10 @@ void QWidgetPrivate::resolveLayoutDirection() By default, this property is set to Qt::LeftToRight. When the layout direction is set on a widget, it will propagate to - the widget's children. Children added after the call to \c - setLayoutDirection() will not inherit the parent's layout + the widget's children, but not to a child that is a window and not + to a child for which setLayoutDirection() has been explicitly + called. Also, child widgets added \e after setLayoutDirection() + has been called for the parent do not inherit the parent's layout direction. \sa QApplication::layoutDirection @@ -10348,9 +10351,10 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; } case Qt::WA_NativeWindow: { #ifndef QT_NO_IM + QWidget *focusWidget = d->effectiveFocusWidget(); QInputContext *ic = 0; if (on && !internalWinId() && testAttribute(Qt::WA_InputMethodEnabled) && hasFocus()) { - ic = d->inputContext(); + ic = focusWidget->d_func()->inputContext(); ic->reset(); ic->setFocusWidget(0); } @@ -10359,7 +10363,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created)) d->createWinId(); if (ic && isEnabled()) - ic->setFocusWidget(this); + ic->setFocusWidget(focusWidget); #endif //QT_NO_IM break; } @@ -10391,13 +10395,14 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; case Qt::WA_InputMethodEnabled: { #ifndef QT_NO_IM - QInputContext *ic = d->ic; + QWidget *focusWidget = d->effectiveFocusWidget(); + QInputContext *ic = focusWidget->d_func()->ic; if (!ic && (!on || hasFocus())) - ic = d->inputContext(); + ic = focusWidget->d_func()->inputContext(); if (ic) { - if (on && hasFocus() && ic->focusWidget() != this && isEnabled()) { - ic->setFocusWidget(this); - } else if (!on && ic->focusWidget() == this) { + if (on && hasFocus() && ic->focusWidget() != focusWidget && isEnabled()) { + ic->setFocusWidget(focusWidget); + } else if (!on && ic->focusWidget() == focusWidget) { ic->reset(); ic->setFocusWidget(0); } @@ -11462,6 +11467,17 @@ void QWidget::languageChange() { } // compat \sa QWidget::setMaximumSize() */ +/*! + \fn QWidget::setupUi(QWidget *widget) + + Sets up the user interface for the specified \a widget. + + \note This function is available with widgets that derive from user + interface descriptions created using \l{uic}. + + \sa {Using a Designer UI File in Your Application} +*/ + QRect QWidgetPrivate::frameStrut() const { Q_Q(const QWidget); @@ -11855,8 +11871,7 @@ void QWidget::ungrabGesture(Qt::GestureType gesture) isVisible() returns false for a widget, that widget cannot call grabMouse(). - \sa releaseMouse() grabKeyboard() releaseKeyboard() grabKeyboard() - focusWidget() + \sa releaseMouse() grabKeyboard() releaseKeyboard() */ /*! |