diff --git a/include/mainwindow.h b/include/mainwindow.h index b61f8c29..bd88cb3a 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -259,8 +259,11 @@ private: QIcon* mapEditedIcon; QIcon* mapOpenedIcon; - QAction *undoAction; - QAction *redoAction; + QAction *undoAction = nullptr; + QAction *redoAction = nullptr; + + QAction *copyAction = nullptr; + QAction *pasteAction = nullptr; QWidget *eventTabObjectWidget; QWidget *eventTabWarpWidget; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5b7d781f..94584ac1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -154,13 +154,16 @@ void MainWindow::initExtraShortcuts() { shortcut_Open_Scripts->setObjectName("shortcut_Open_Scripts"); shortcut_Open_Scripts->setWhatsThis("Open Map Scripts"); - auto *shortcut_Copy = new Shortcut(QKeySequence("Ctrl+C"), this, SLOT(copy())); - shortcut_Copy->setObjectName("shortcut_Copy"); - shortcut_Copy->setWhatsThis("Copy"); + copyAction = new QAction("Copy", this); + copyAction->setShortcut(QKeySequence("Ctrl+C")); + connect(copyAction, &QAction::triggered, this, &MainWindow::copy); + ui->menuEdit->addSeparator(); + ui->menuEdit->addAction(copyAction); - auto *shortcut_Paste = new Shortcut(QKeySequence("Ctrl+V"), this, SLOT(paste())); - shortcut_Paste->setObjectName("shortcut_Paste"); - shortcut_Copy->setWhatsThis("Paste"); + pasteAction = new QAction("Paste", this); + pasteAction->setShortcut(QKeySequence("Ctrl+V")); + connect(pasteAction, &QAction::triggered, this, &MainWindow::paste); + ui->menuEdit->addAction(pasteAction); } QObjectList MainWindow::shortcutableObjects() const {