diff --git a/MainWindow.cpp b/MainWindow.cpp index 03d71c5..b58c92a 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -1277,14 +1277,16 @@ void MainWindow::createActions() // // Undo action - undoAction = undoStack->createUndoAction(editMenu, tr("&Undo")); + undoAction = undoStack->createUndoAction(this, tr("&Undo")); undoAction->setShortcut(QKeySequence::Undo); undoAction->setIconVisibleInMenu(false); + undoAction->setShortcutContext(Qt::ApplicationShortcut); //Redo action - redoAction = undoStack->createRedoAction(editMenu, tr("&Redo")); + redoAction = undoStack->createRedoAction(this, tr("&Redo")); redoAction->setShortcut(QKeySequence::Redo); redoAction->setIconVisibleInMenu(false); + redoAction->setShortcutContext(Qt::ApplicationShortcut); // About. aboutAction = new QAction(tr("&About"), this); diff --git a/MainWindow.h b/MainWindow.h index 5e9d1b1..5b70ebf 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -21,7 +21,10 @@ #ifndef MAIN_WINDOW_H_ #define MAIN_WINDOW_H_ -#include +#include +#if QT_VERSION >= 0x050000 + #include +#endif #include #include #include diff --git a/main.cpp b/main.cpp index 490a27c..c68aedc 100644 --- a/main.cpp +++ b/main.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #if USING_QT_5 #include diff --git a/mapmap.pro b/mapmap.pro index 5121ebc..b5a323c 100644 --- a/mapmap.pro +++ b/mapmap.pro @@ -2,10 +2,12 @@ CONFIG += qt debug TEMPLATE = app VERSION = 0.2.1 TARGET = mapmap -QT += gui opengl xml widgets +QT += gui opengl xml +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets DEFINES += UNICODE QT_THREAD_SUPPORT QT_CORE_LIB QT_GUI_LIB HEADERS = \ + Commands.h \ DestinationGLCanvas.h \ MM.h \ MainApplication.h \ @@ -27,10 +29,10 @@ HEADERS = \ Shape.h \ SourceGLCanvas.h \ UidAllocator.h \ - Util.h \ - Commands.h + Util.h SOURCES = \ + Commands.cpp \ DestinationGLCanvas.cpp \ MM.cpp \ MainApplication.cpp \ @@ -52,8 +54,7 @@ SOURCES = \ SourceGLCanvas.cpp \ UidAllocator.cpp \ Util.cpp \ - main.cpp \ - Commands.cpp + main.cpp RESOURCES = mapmap.qrc TRANSLATIONS = resources/texts/mapmap_*.ts