diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-02-15 02:53:29 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-02-15 02:53:29 (GMT) |
commit | af1ce755f15b10a00dabf240b004eb80d4a7ded1 (patch) | |
tree | 267c14d4a9a488f9948600a8794bd394eb8d1d86 /tests/auto | |
parent | e1d18217134e21be0d896ad3022ef1284d23122d (diff) | |
parent | 5f9f98ec047024fadbfdea334fbea7c357179032 (diff) | |
download | Qt-af1ce755f15b10a00dabf240b004eb80d4a7ded1.zip Qt-af1ce755f15b10a00dabf240b004eb80d4a7ded1.tar.gz Qt-af1ce755f15b10a00dabf240b004eb80d4a7ded1.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Fix inheritance of widget input contexts.
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qinputcontext/tst_qinputcontext.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp index 800f9de..6a047f2 100644 --- a/tests/auto/qinputcontext/tst_qinputcontext.cpp +++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp @@ -88,6 +88,7 @@ private slots: void closeSoftwareInputPanel(); void selections(); void focusProxy(); + void contextInheritance(); void symbianTestCoeFepInputContext_data(); void symbianTestCoeFepInputContext(); void symbianTestCoeFepAutoCommit_data(); @@ -473,6 +474,37 @@ void tst_QInputContext::focusProxy() QCOMPARE(gic->focusWidget(), &proxy); } +void tst_QInputContext::contextInheritance() +{ + QWidget parent; + QWidget child(&parent); + + parent.setAttribute(Qt::WA_InputMethodEnabled, true); + child.setAttribute(Qt::WA_InputMethodEnabled, true); + + QCOMPARE(parent.inputContext(), qApp->inputContext()); + QCOMPARE(child.inputContext(), qApp->inputContext()); + + QInputContext *qic = new QFilterInputContext; + parent.setInputContext(qic); + QCOMPARE(parent.inputContext(), qic); + QCOMPARE(child.inputContext(), qic); + + parent.setAttribute(Qt::WA_InputMethodEnabled, false); + QVERIFY(!parent.inputContext()); + QCOMPARE(child.inputContext(), qic); + parent.setAttribute(Qt::WA_InputMethodEnabled, true); + + parent.setInputContext(0); + QCOMPARE(parent.inputContext(), qApp->inputContext()); + QCOMPARE(child.inputContext(), qApp->inputContext()); + + qic = new QFilterInputContext; + qApp->setInputContext(qic); + QCOMPARE(parent.inputContext(), qic); + QCOMPARE(child.inputContext(), qic); +} + #ifdef QT_WEBKIT_LIB class AutoWebView : public QWebView { |