summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2009-04-23 12:26:19 (GMT)
committerjasplin <qt-info@nokia.com>2009-04-23 12:36:09 (GMT)
commitb51dd5a7b328291c5dbda540ce228e7d867662cb (patch)
tree2ba45f66aec3d27d9881d6ec1d655d31deaf0de2 /tests
parentaa234610048a741cddc991be25b84d235f40e345 (diff)
downloadQt-b51dd5a7b328291c5dbda540ce228e7d867662cb.zip
Qt-b51dd5a7b328291c5dbda540ce228e7d867662cb.tar.gz
Qt-b51dd5a7b328291c5dbda540ce228e7d867662cb.tar.bz2
Revert "Fixed key sequence eating behavior for QShortcut and QAction."
This reverts commit 031adeaf42ddaef8d01338f6c59ba97170be5d53. The patch had some unforeseen side-effects for Creator. It may also affect other existing applications in a similar way. For now, this behavior (eating key sequences for disabled shortcuts) should be achieved using a local workaround in creator. Reviewed-by: mariusSO Task-number: 251246
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qaction/tst_qaction.cpp33
-rw-r--r--tests/auto/qshortcut/tst_qshortcut.cpp7
2 files changed, 4 insertions, 36 deletions
diff --git a/tests/auto/qaction/tst_qaction.cpp b/tests/auto/qaction/tst_qaction.cpp
index 8e4ae86..34f2dfd 100644
--- a/tests/auto/qaction/tst_qaction.cpp
+++ b/tests/auto/qaction/tst_qaction.cpp
@@ -46,7 +46,6 @@
#include <qevent.h>
#include <qaction.h>
#include <qmenu.h>
-#include <qlineedit.h>
//TESTED_CLASS=
//TESTED_FILES=
@@ -75,7 +74,6 @@ private slots:
void setStandardKeys();
void alternateShortcuts();
void enabledVisibleInteraction();
- void invisibleActionWithComplexShortcut();
void task200823_tooltip();
private:
@@ -324,36 +322,5 @@ void tst_QAction::task200823_tooltip()
QCOMPARE(action->toolTip(), ref);
}
-void tst_QAction::invisibleActionWithComplexShortcut()
-{
- QAction action(0);
- action.setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E, Qt::Key_1));
-
- QLineEdit edit;
- edit.addAction(&action);
- edit.show();
- QTest::qWait(100);
-
- QSignalSpy spy(&action, SIGNAL(triggered()));
-
- action.setVisible(true);
- QTest::keyPress(&edit, Qt::Key_E, Qt::ControlModifier);
- QTest::keyRelease(&edit, Qt::Key_E, Qt::ControlModifier);
- QTest::keyPress(&edit, Qt::Key_1, Qt::NoModifier);
- QTest::keyRelease(&edit, Qt::Key_1, Qt::NoModifier);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(edit.text(), QLatin1String(""));
-
- edit.clear();
- spy.clear();
- action.setVisible(false);
- QTest::keyPress(&edit, Qt::Key_E, Qt::ControlModifier);
- QTest::keyRelease(&edit, Qt::Key_E, Qt::ControlModifier);
- QTest::keyPress(&edit, Qt::Key_1, Qt::NoModifier);
- QTest::keyRelease(&edit, Qt::Key_1, Qt::NoModifier);
- QCOMPARE(spy.count(), 0);
- QCOMPARE(edit.text(), QLatin1String("1"));
-}
-
QTEST_MAIN(tst_QAction)
#include "tst_qaction.moc"
diff --git a/tests/auto/qshortcut/tst_qshortcut.cpp b/tests/auto/qshortcut/tst_qshortcut.cpp
index cd80204..69ebf74 100644
--- a/tests/auto/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/qshortcut/tst_qshortcut.cpp
@@ -987,16 +987,17 @@ void tst_QShortcut::keypressConsumption()
cut1->setEnabled(false);
cut2->setEnabled(false);
- edit->clear();
+ // Make sure keypresses is passed on, since all multiple keysequences
+ // with Ctrl+I are disabled
sendKeyEvents(edit, Qt::CTRL + Qt::Key_I, 0); // Send key to edit
QCOMPARE( currentResult, NoResult );
QCOMPARE( ambigResult, NoResult );
- QVERIFY(edit->toPlainText().isEmpty());
+ QVERIFY(edit->toPlainText().endsWith("<Ctrl+I>"));
sendKeyEvents(edit, Qt::Key_A, 'a'); // Send key to edit
QCOMPARE( currentResult, NoResult );
QCOMPARE( ambigResult, NoResult );
- QVERIFY(edit->toPlainText().isEmpty());
+ QVERIFY(edit->toPlainText().endsWith("<Ctrl+I>a"));
clearAllShortcuts();
}