* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************
* Parts of this implementation are taken from KDE's kaction.cpp *
***************************************************************************/
***************************************************************************
* Parts of this implementation are taken from KDE's kaction.cpp *
***************************************************************************/
{
init();
}
Action::Action(const QString &text, QObject *parent, const QObject *receiver, const char *slot, const QKeySequence &shortcut)
{
init();
}
Action::Action(const QString &text, QObject *parent, const QObject *receiver, const char *slot, const QKeySequence &shortcut)
Action::Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver, const char *slot, const QKeySequence &shortcut)
Action::Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver, const char *slot, const QKeySequence &shortcut)
- connect(this, SIGNAL(triggered(bool)), this, SLOT(slotTriggered()));
+ connect(this, &QAction::triggered, this, &Action::slotTriggered);
- if (type == DefaultShortcut)
- return property("defaultShortcut").value<QKeySequence>();
+ if (type == DefaultShortcut) {
+ auto sequence = property("defaultShortcuts").value<QList<QKeySequence>>();
+ return sequence.isEmpty() ? QKeySequence() : sequence.first();
+ }
- if (type & DefaultShortcut)
- setProperty("defaultShortcut", key);
-
+ if (type & DefaultShortcut) {
+ setProperty("defaultShortcuts", QVariant::fromValue(QList<QKeySequence>() << key));
+ }