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