X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Faction.cpp;h=2758e77005ee2fb92cd6e94720570aca620306f9;hb=b59bf22d688ac2f6c194b42fe6c656e5218f4778;hp=216cac846f0b80fd1dfce35cdf3dd1d9118bde0c;hpb=fcf3d839b6acc518d634c112c7a3e837a5d0cef2;p=quassel.git diff --git a/src/uisupport/action.cpp b/src/uisupport/action.cpp index 216cac84..2758e770 100644 --- a/src/uisupport/action.cpp +++ b/src/uisupport/action.cpp @@ -99,8 +99,12 @@ QKeySequence Action::shortcut(ShortcutTypes type) const { Q_ASSERT(type); if (type == DefaultShortcut) { +#if QT_VERSION < 0x050000 + return property("defaultShortcut").value(); +#else auto sequence = property("defaultShortcuts").value>(); return sequence.isEmpty() ? QKeySequence() : sequence.first(); +#endif } return shortcuts().isEmpty() ? QKeySequence() : shortcuts().first(); @@ -117,9 +121,13 @@ void Action::setShortcut(const QKeySequence &key, ShortcutTypes type) { Q_ASSERT(type); - if (type & DefaultShortcut) + if (type & DefaultShortcut) { +#if QT_VERSION < 0x050000 + setProperty("defaultShortcut", key); +#else setProperty("defaultShortcuts", QVariant::fromValue(QList() << key)); - +#endif + } if (type & ActiveShortcut) QAction::setShortcut(key); }