X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Faction.cpp;h=2758e77005ee2fb92cd6e94720570aca620306f9;hp=216cac846f0b80fd1dfce35cdf3dd1d9118bde0c;hb=bd2417d2ac819a46436c4f029c880d7f26b9e2a2;hpb=be23c0c48e37617eebe0be0eb2ea5c6246dc8170 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); }