Skip to content

Commit 5048554

Browse files
committed
KviShortcut: add new ctor to support QKeySequence::StandardKey with more than one QKeySequence
1 parent 51f3abb commit 5048554

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/kvilib/core/KviShortcut.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ QShortcut * KviShortcut::create(const QKeySequence & key, QObject * parent, cons
4646
return new QShortcut(key, parent, member, ambiguousMember, context);
4747
}
4848

49+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
50+
QShortcut * KviShortcut::create(const QKeySequence::StandardKey & key, QObject * parent, const char * member, const char * ambiguousMember, Qt::ShortcutContext context)
51+
{
52+
//qDebug("New StdKey Shortcut %s\n", key.toString().toUtf8().data());
53+
return new QShortcut(key, parent, member, ambiguousMember, context);
54+
}
55+
#endif
56+
4957
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
5058
QShortcut * KviShortcut::create(Qt::KeyboardModifier mod, Qt::Key key, QWidget * parent, const char * member, const char * ambiguousMember, Qt::ShortcutContext context)
5159
#else

src/kvilib/core/KviShortcut.h

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class KVILIB_API KviShortcut
4848
#else
4949
static QShortcut * create(const char * key, QObject * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
5050
static QShortcut * create(const QKeySequence & key, QObject * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
51+
static QShortcut * create(const QKeySequence::StandardKey & key, QObject * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
5152
static QShortcut * create(Qt::KeyboardModifier mod, Qt::Key key, QObject * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
5253
#endif
5354
};

0 commit comments

Comments
 (0)