Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

KviShortcut: add new ctor to support QKeySequence::StandardKey with more than one QKeySequence #2689

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ctrlaltca
Copy link
Contributor

On Qt6 the cast from QKeySequence::StandardKey to QKeySequence will create the shortcut only on the first sequence.
From https://doc.qt.io/qt-6/qkeysequence.html#QKeySequence-1 :

The resulting object will be based on the first element in the list of key bindings for the key.

Fix #2685

@@ -48,6 +48,7 @@ class KVILIB_API KviShortcut
#else
static QShortcut * create(const char * key, QObject * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
static QShortcut * create(const QKeySequence & key, QObject * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
static QShortcut * create(const QKeySequence::StandardKey & key, QObject * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's declared but undefined in case of Qt 5?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's defined and implemented only for Qt6. On a second view it seems correct to me, maybe I'm missing something?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shift+delete no longer working to 'cut'?
2 participants