X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Faction.cpp;h=9bd56edab118c4973ce1bf38f156c40159463dec;hb=7582027d5f569c8487d17959d6aa9e6ca6d2aa33;hp=216cac846f0b80fd1dfce35cdf3dd1d9118bde0c;hpb=c878493af33f5d01e07360bebdbe06131ded5015;p=quassel.git diff --git a/src/uisupport/action.cpp b/src/uisupport/action.cpp index 216cac84..9bd56eda 100644 --- a/src/uisupport/action.cpp +++ b/src/uisupport/action.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2016 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -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); }