diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-01-15 21:53:57 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-17 14:44:30 +0100 |
commit | bf805455d40b4445f61321439d529cd85cb6bc65 (patch) | |
tree | eac94f650f7b04b326c9ff8d8ebf639f6fab4b18 /src/gui/kernel/qkeysequence.h | |
parent | 445c4cb011fd2048e707d82c1ae6945353c6cb1d (diff) |
Fix ### Qt5 for QKeySequence
Change-Id: I32e582d264991e4a42e4ca6678d477835d15dbce
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/gui/kernel/qkeysequence.h')
-rw-r--r-- | src/gui/kernel/qkeysequence.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h index 1127e8afca..53f89bd838 100644 --- a/src/gui/kernel/qkeysequence.h +++ b/src/gui/kernel/qkeysequence.h @@ -154,7 +154,7 @@ public: QKeySequence(StandardKey key); ~QKeySequence(); - uint count() const; // ### Qt 5: return 'int' + int count() const; bool isEmpty() const; enum SequenceMatch { @@ -170,10 +170,11 @@ public: static QKeySequence mnemonic(const QString &text); static QList<QKeySequence> keyBindings(StandardKey key); - // ### Qt 5: kill 'operator QString' - it's evil - operator QString() const; +#if QT_DEPRECATED_SINCE(5, 0) + QT_DEPRECATED operator QString() const { return toString(QKeySequence::NativeText); } + QT_DEPRECATED operator int() const { if (1 <= count()) return operator [](0); return 0; } +#endif operator QVariant() const; - operator int() const; int operator[](uint i) const; QKeySequence &operator=(const QKeySequence &other); #ifdef Q_COMPILER_RVALUE_REFS |