diff options
author | Laszlo Papp <lpapp@kde.org> | 2022-06-24 17:57:22 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-07-09 11:23:49 +0000 |
commit | 1ea0d399b3787d486d6fc59aaaf498cbf6bd66b2 (patch) | |
tree | b736b0e40cdbfbf28a688875bb166a287d7a4929 /src/widgets/widgets/qkeysequenceedit.h | |
parent | 2cfabed1ff9c822458c467ff072e7a3a6c0fbf3d (diff) |
QKeySequenceEdit: Add a finishing key combinations property
Different shortcut editors seem to have different preferences. By
default, QWidget seems to utilise Tab, Backtab, Return and Enter for
navigation purposes. However, some shortcut editors would like to be
able to record these keys as part of combinations to use in the
application.
Therefore, leave it with the application developers to decide what key
combinations they would like to use for finishing the key sequence edit.
This should provide enough flexibility for application developers to
customize their shortcut editor behavior.
[ChangeLog][QtWidgets][QKeySequenceEdit] Added a property to allow
defining the finishing key combinations.
Fixes: QTBUG-103844
Fixes: QTBUG-103843
Change-Id: Id84644086ca7a4f11618d510e59698a43735b99b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/widgets/qkeysequenceedit.h')
-rw-r--r-- | src/widgets/widgets/qkeysequenceedit.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/widgets/qkeysequenceedit.h b/src/widgets/widgets/qkeysequenceedit.h index f7ef0e00ec..15b40133b1 100644 --- a/src/widgets/widgets/qkeysequenceedit.h +++ b/src/widgets/widgets/qkeysequenceedit.h @@ -20,6 +20,7 @@ class Q_WIDGETS_EXPORT QKeySequenceEdit : public QWidget NOTIFY keySequenceChanged USER true) Q_PROPERTY(bool clearButtonEnabled READ isClearButtonEnabled WRITE setClearButtonEnabled) Q_PROPERTY(qsizetype maximumSequenceLength READ maximumSequenceLength WRITE setMaximumSequenceLength) + Q_PROPERTY(QList<QKeyCombination> finishingKeyCombinations READ finishingKeyCombinations WRITE setFinishingKeyCombinations) public: explicit QKeySequenceEdit(QWidget *parent = nullptr); @@ -32,6 +33,9 @@ public: void setClearButtonEnabled(bool enable); bool isClearButtonEnabled() const; + void setFinishingKeyCombinations(const QList<QKeyCombination> &inishingKeyCombinations); + QList<QKeyCombination> finishingKeyCombinations() const; + public Q_SLOTS: void setKeySequence(const QKeySequence &keySequence); void clear(); |