diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2010-04-29 06:34:25 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2010-04-29 06:38:33 (GMT) |
commit | 69efa1c869694666c66375179b43e2569cf2772b (patch) | |
tree | fdbdb3e901c37e69b0cd78351ef9989764fd4336 /tests | |
parent | 4eb2e50b97a9933ab249517aa42cce9b3b4115e2 (diff) | |
download | Qt-69efa1c869694666c66375179b43e2569cf2772b.zip Qt-69efa1c869694666c66375179b43e2569cf2772b.tar.gz Qt-69efa1c869694666c66375179b43e2569cf2772b.tar.bz2 |
Update the input method sensitivity in case of complex widgets in QGraphicsProxyWidget.
In case of a complex widget embedded in a proxy, we need to update the
input method acceptance whenever the focus changes inside the proxy.
Task-number:QTBUG-8847
Reviewed-by:janarve
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index d5f63d3..6cea834 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -3436,6 +3436,21 @@ void tst_QGraphicsProxyWidget::inputMethod() qApp->sendEvent(proxy, &event); QCOMPARE(lineEdit->inputMethodEvents, i); } + + scene.clear(); + QGraphicsView view(&scene); + QWidget *w = new QWidget; + w->setLayout(new QVBoxLayout(w)); + QLineEdit *lineEdit = new QLineEdit; + lineEdit->setEchoMode(QLineEdit::Password); + w->layout()->addWidget(lineEdit); + lineEdit->setAttribute(Qt::WA_InputMethodEnabled, true); + QGraphicsProxyWidget *proxy = scene.addWidget(w); + view.show(); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(!(proxy->flags() & QGraphicsItem::ItemAcceptsInputMethod)); + lineEdit->setFocus(); + QVERIFY((proxy->flags() & QGraphicsItem::ItemAcceptsInputMethod)); } void tst_QGraphicsProxyWidget::clickFocus() |