add copy paste to edit menu
This commit is contained in:
parent
47887aca4d
commit
39648eed41
2 changed files with 14 additions and 8 deletions
|
@ -259,8 +259,11 @@ private:
|
||||||
QIcon* mapEditedIcon;
|
QIcon* mapEditedIcon;
|
||||||
QIcon* mapOpenedIcon;
|
QIcon* mapOpenedIcon;
|
||||||
|
|
||||||
QAction *undoAction;
|
QAction *undoAction = nullptr;
|
||||||
QAction *redoAction;
|
QAction *redoAction = nullptr;
|
||||||
|
|
||||||
|
QAction *copyAction = nullptr;
|
||||||
|
QAction *pasteAction = nullptr;
|
||||||
|
|
||||||
QWidget *eventTabObjectWidget;
|
QWidget *eventTabObjectWidget;
|
||||||
QWidget *eventTabWarpWidget;
|
QWidget *eventTabWarpWidget;
|
||||||
|
|
|
@ -154,13 +154,16 @@ void MainWindow::initExtraShortcuts() {
|
||||||
shortcut_Open_Scripts->setObjectName("shortcut_Open_Scripts");
|
shortcut_Open_Scripts->setObjectName("shortcut_Open_Scripts");
|
||||||
shortcut_Open_Scripts->setWhatsThis("Open Map Scripts");
|
shortcut_Open_Scripts->setWhatsThis("Open Map Scripts");
|
||||||
|
|
||||||
auto *shortcut_Copy = new Shortcut(QKeySequence("Ctrl+C"), this, SLOT(copy()));
|
copyAction = new QAction("Copy", this);
|
||||||
shortcut_Copy->setObjectName("shortcut_Copy");
|
copyAction->setShortcut(QKeySequence("Ctrl+C"));
|
||||||
shortcut_Copy->setWhatsThis("Copy");
|
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()));
|
pasteAction = new QAction("Paste", this);
|
||||||
shortcut_Paste->setObjectName("shortcut_Paste");
|
pasteAction->setShortcut(QKeySequence("Ctrl+V"));
|
||||||
shortcut_Copy->setWhatsThis("Paste");
|
connect(pasteAction, &QAction::triggered, this, &MainWindow::paste);
|
||||||
|
ui->menuEdit->addAction(pasteAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
QObjectList MainWindow::shortcutableObjects() const {
|
QObjectList MainWindow::shortcutableObjects() const {
|
||||||
|
|
Loading…
Reference in a new issue