diff options
author | Chani Armitage <chanika@gmail.com> | 2009-12-02 16:56:40 (GMT) |
---|---|---|
committer | Leonardo Sobral Cunha <leo.cunha@nokia.com> | 2009-12-02 16:56:40 (GMT) |
commit | 0fc7c731b47d7984ab8039f70561ad559a0bd36d (patch) | |
tree | f1742ce73d82e63fb7605c71c5464e6f56765df6 /tests/auto/qkeysequence | |
parent | ae0c72025c78e4fa4f8aa793e3b83f245a7837a7 (diff) | |
download | Qt-0fc7c731b47d7984ab8039f70561ad559a0bd36d.zip Qt-0fc7c731b47d7984ab8039f70561ad559a0bd36d.tar.gz Qt-0fc7c731b47d7984ab8039f70561ad559a0bd36d.tar.bz2 |
fix QKeySequence::fromString
now emacs-style shortcuts are parsed correctly, like in the
constructor, and they share the code too.
Merge-request: 1279
Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Diffstat (limited to 'tests/auto/qkeysequence')
-rw-r--r-- | tests/auto/qkeysequence/tst_qkeysequence.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp index bc9ae6c..a299d54 100644 --- a/tests/auto/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp @@ -119,6 +119,7 @@ private slots: void symetricConstructors_data(); void symetricConstructors(); void checkMultipleNames(); + void checkMultipleCodes(); void mnemonic_data(); void mnemonic(); void toString_data(); @@ -265,6 +266,18 @@ void tst_QKeySequence::checkMultipleNames() QVERIFY( oldK == newK ); } +//TODO: could test third constructor, or test fromString on all constructor-data +void tst_QKeySequence::checkMultipleCodes() +{ + QKeySequence seq1("Alt+d, l"); + QKeySequence seq2 = QKeySequence::fromString("Alt+d, l"); + QVERIFY( seq1 == seq2 ); + + QKeySequence seq3("Alt+d,l"); + QKeySequence seq4 = QKeySequence::fromString("Alt+d,l"); + QVERIFY( seq3 == seq4 ); +} + /* * We must ensure that the keyBindings data is allways sorted * so that we can safely perform binary searches. |