diff options
author | Pierre Rossi <pierre.rossi@nokia.com> | 2009-07-10 19:15:25 +0200 |
---|---|---|
committer | Pierre Rossi <pierre.rossi@nokia.com> | 2009-07-10 19:40:42 +0200 |
commit | baacf493e1c968ee2ffa59a8b87754388cb7a61a (patch) | |
tree | 2f411662090de28b4bb9563190f364ec570e18b5 /tests/auto/qwidget | |
parent | 593f8a322895dc011d88fbe112987f2189d43724 (diff) | |
download | qt4-tools-baacf493e1c968ee2ffa59a8b87754388cb7a61a.tar.gz |
Fixed a crash with input methods
The inputContext's focusWidget was not reset when disabling input
methods.
Thanks to Benjamin P.
Task-number: 257832
Reviewed-by: Denis
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 7b68732222..1db6eb26df 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -350,6 +350,7 @@ private slots: #endif void updateOnDestroyedSignal(); void toplevelLineEditFocus(); + void inputFocus_task257832(); private: bool ensureScreenSize(int width, int height); @@ -8965,5 +8966,19 @@ void tst_QWidget::toplevelLineEditFocus() QCOMPARE(QApplication::focusWidget(), &w); } +void tst_QWidget::inputFocus_task257832() +{ + QLineEdit *widget = new QLineEdit; + QInputContext *context = widget->inputContext(); + if (!context) + QSKIP("No input context", SkipSingle); + widget->setFocus(); + context->setFocusWidget(widget); + QCOMPARE(context->focusWidget(), widget); + widget->setReadOnly(true); + QVERIFY(!context->focusWidget()); + delete widget; +} + QTEST_MAIN(tst_QWidget) #include "tst_qwidget.moc" |