Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/kvilib/core/KviShortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ QShortcut * KviShortcut::create(const QKeySequence & key, QObject * parent, cons
return new QShortcut(key, parent, member, ambiguousMember, context);
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QShortcut * KviShortcut::create(const QKeySequence::StandardKey & key, QObject * parent, const char * member, const char * ambiguousMember, Qt::ShortcutContext context)
{
//qDebug("New StdKey Shortcut %s\n", key.toString().toUtf8().data());
return new QShortcut(key, parent, member, ambiguousMember, context);
}
#endif

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QShortcut * KviShortcut::create(Qt::KeyboardModifier mod, Qt::Key key, QWidget * parent, const char * member, const char * ambiguousMember, Qt::ShortcutContext context)
#else
Expand Down
1 change: 1 addition & 0 deletions src/kvilib/core/KviShortcut.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
ctrlaltca marked this conversation as resolved.
Show resolved Hide resolved
static QShortcut * create(Qt::KeyboardModifier mod, Qt::Key key, QObject * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
#endif
};
Expand Down
Loading