summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2009-07-10 17:15:25 (GMT)
committerPierre Rossi <pierre.rossi@nokia.com>2009-07-10 17:40:42 (GMT)
commitbaacf493e1c968ee2ffa59a8b87754388cb7a61a (patch)
tree2f411662090de28b4bb9563190f364ec570e18b5 /tests/auto/qwidget
parent593f8a322895dc011d88fbe112987f2189d43724 (diff)
downloadQt-baacf493e1c968ee2ffa59a8b87754388cb7a61a.zip
Qt-baacf493e1c968ee2ffa59a8b87754388cb7a61a.tar.gz
Qt-baacf493e1c968ee2ffa59a8b87754388cb7a61a.tar.bz2
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.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 7b68732..1db6eb2 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"