diff options
author | Michael Hasselmann <michael@taschenorakel.de> | 2010-06-07 15:18:54 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-06-07 16:09:43 (GMT) |
commit | 0c0f22ec0e36d7001c8195dcc6e390a37118e33e (patch) | |
tree | 5732513e6405bbd807f7083e18040a28d654be97 /src/gui/kernel/qwidget.cpp | |
parent | c28da4dd467c2763bed5c6b31471f078ac26cee6 (diff) | |
download | Qt-0c0f22ec0e36d7001c8195dcc6e390a37118e33e.zip Qt-0c0f22ec0e36d7001c8195dcc6e390a37118e33e.tar.gz Qt-0c0f22ec0e36d7001c8195dcc6e390a37118e33e.tar.bz2 |
Fix QApplication/QWidget to really take ownership of input contexts
* src/gui/kernel/[qapplication|qwidget].cpp,
tests/auto/qapplication/tst_[qapplication|qwidget].cpp (setInputContext):
The documentation for [QApplication|QWidget]::setInputContext claims that the
[QApplication|QWidget] instance would take ownership. This commit fixes the
setter to also reparent the input context. Furthermore, the crappy test for
this setter was improved.
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index b5879ae..91dfaab 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -332,6 +332,8 @@ void QWidget::setInputContext(QInputContext *context) if (d->ic) delete d->ic; d->ic = context; + if (d->ic) + d->ic->setParent(this); #endif } |