diff options
author | axis <qt-info@nokia.com> | 2010-02-16 09:00:23 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-02-16 09:00:23 (GMT) |
commit | 9d174f13e48730ac06aa429e0f011a02b333025e (patch) | |
tree | 6075fa3c24880dd6fc548f03395a5809739f67de /tests/auto/qlineedit | |
parent | 4790ab735f96a13027e7292ff5b49195224f0af9 (diff) | |
parent | e024cc10a97b9518b2dd577175feb66258d7ac05 (diff) | |
download | Qt-9d174f13e48730ac06aa429e0f011a02b333025e.zip Qt-9d174f13e48730ac06aa429e0f011a02b333025e.tar.gz Qt-9d174f13e48730ac06aa429e0f011a02b333025e.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into master-s60
Conflicts:
qmake/generators/symbian/symmake.cpp
tests/auto/qlineedit/tst_qlineedit.cpp
tests/benchmarks/benchmarks.pro
Diffstat (limited to 'tests/auto/qlineedit')
-rw-r--r-- | tests/auto/qlineedit/tst_qlineedit.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index fcca58a..6dc2c82 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -274,6 +274,7 @@ private slots: #ifndef QT_NO_CONTEXTMENU void taskQTBUG_7902_contextMenuCrash(); #endif + void taskQTBUG_7395_readOnlyShortcut(); protected slots: #ifdef QT3_SUPPORT @@ -3457,10 +3458,8 @@ void tst_QLineEdit::task210502_caseInsensitiveInlineCompletion() completer.setCompletionMode(QCompleter::InlineCompletion); lineEdit.setCompleter(&completer); lineEdit.show(); -#ifdef Q_WS_X11 - // to be safe and avoid failing setFocus with window managers - qt_x11_wait_for_window_manager(&lineEdit); -#endif + QTest::qWaitForWindowShown(&lineEdit); + QApplication::setActiveWindow(&lineEdit); lineEdit.setFocus(); QTRY_VERIFY(lineEdit.hasFocus()); QTest::keyPress(&lineEdit, 'a'); @@ -3661,5 +3660,26 @@ void tst_QLineEdit::taskQTBUG_7902_contextMenuCrash() } #endif +void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut() +{ + //ReadOnly QLineEdit should not intercept shortcut. + QLineEdit le; + le.setReadOnly(true); + + QAction action(QString::fromLatin1("hello"), &le); + action.setShortcut(QString::fromLatin1("p")); + QSignalSpy spy(&action, SIGNAL(triggered())); + le.addAction(&action); + + le.show(); + QTest::qWaitForWindowShown(&le); + QApplication::setActiveWindow(&le); + le.setFocus(); + QTRY_VERIFY(le.hasFocus()); + + QTest::keyClick(0, Qt::Key_P); + QCOMPARE(spy.count(), 1); +} + QTEST_MAIN(tst_QLineEdit) #include "tst_qlineedit.moc" |