diff options
author | 2023-07-14 16:04:57 +0200 | |
---|---|---|
committer | 2023-07-14 10:04:57 -0400 | |
commit | 4649cf024839d90b5ac202652367ede62d2dacd4 (patch) | |
tree | 4e6ded6091dd94a1a00690eaa9278b04cc949ca2 /src/osd | |
parent | 8e4f4c24c0d31e53060bf25415a1e8f3316932f5 (diff) |
Allow the use of either Qt5 or Qt6 on Linux (#11413)
* Look for MOC in QT_HOME/libexec if not found in QT_HOME/bin
* Use the Qt6* libraries if the Qt version is >= 6
* Switch the include paths for QAction & QActionGroup for Qt >= 6
* Replace the deprecated + operator for keys with |
Diffstat (limited to 'src/osd')
-rw-r--r-- | src/osd/modules/debugger/qt/breakpointswindow.cpp | 4 | ||||
-rw-r--r-- | src/osd/modules/debugger/qt/dasmwindow.cpp | 7 | ||||
-rw-r--r-- | src/osd/modules/debugger/qt/mainwindow.cpp | 7 | ||||
-rw-r--r-- | src/osd/modules/debugger/qt/memorywindow.cpp | 4 |
4 files changed, 20 insertions, 2 deletions
diff --git a/src/osd/modules/debugger/qt/breakpointswindow.cpp b/src/osd/modules/debugger/qt/breakpointswindow.cpp index 60ceae6d16f..16c8af6bdb3 100644 --- a/src/osd/modules/debugger/qt/breakpointswindow.cpp +++ b/src/osd/modules/debugger/qt/breakpointswindow.cpp @@ -8,7 +8,11 @@ #include "util/xmlfile.h" +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include <QtGui/QActionGroup> +#else #include <QtWidgets/QActionGroup> +#endif #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QMenu> #include <QtWidgets/QMenuBar> diff --git a/src/osd/modules/debugger/qt/dasmwindow.cpp b/src/osd/modules/debugger/qt/dasmwindow.cpp index d528be04d14..144e2f32f5d 100644 --- a/src/osd/modules/debugger/qt/dasmwindow.cpp +++ b/src/osd/modules/debugger/qt/dasmwindow.cpp @@ -13,7 +13,12 @@ #include <QtGui/QKeyEvent> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QVBoxLayout> +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include <QtGui/QAction> +#include <QtGui/QActionGroup> +#else #include <QtWidgets/QAction> +#endif #include <QtWidgets/QMenu> #include <QtWidgets/QMenuBar> @@ -86,7 +91,7 @@ DasmWindow::DasmWindow(DebuggerQt &debugger, QWidget *parent) : m_breakpointEnableAct = new QAction("Disable Breakpoint at Cursor", this); m_runToCursorAct = new QAction("Run to Cursor", this); m_breakpointToggleAct->setShortcut(Qt::Key_F9); - m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9); + m_breakpointEnableAct->setShortcut(Qt::SHIFT | Qt::Key_F9); m_runToCursorAct->setShortcut(Qt::Key_F4); connect(m_breakpointToggleAct, &QAction::triggered, this, &DasmWindow::toggleBreakpointAtCursor); connect(m_breakpointEnableAct, &QAction::triggered, this, &DasmWindow::enableBreakpointAtCursor); diff --git a/src/osd/modules/debugger/qt/mainwindow.cpp b/src/osd/modules/debugger/qt/mainwindow.cpp index 5e97376aa7d..dba5d18b9ac 100644 --- a/src/osd/modules/debugger/qt/mainwindow.cpp +++ b/src/osd/modules/debugger/qt/mainwindow.cpp @@ -11,7 +11,12 @@ #include "util/xmlfile.h" #include <QtGui/QCloseEvent> +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include <QtGui/QAction> +#include <QtGui/QActionGroup> +#else #include <QtWidgets/QAction> +#endif #include <QtWidgets/QDockWidget> #include <QtWidgets/QFileDialog> #include <QtWidgets/QMenu> @@ -61,7 +66,7 @@ MainWindow::MainWindow(DebuggerQt &debugger, QWidget *parent) : m_breakpointEnableAct = new QAction("Disable Breakpoint at Cursor", this); m_runToCursorAct = new QAction("Run to Cursor", this); m_breakpointToggleAct->setShortcut(Qt::Key_F9); - m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9); + m_breakpointEnableAct->setShortcut(Qt::SHIFT | Qt::Key_F9); m_runToCursorAct->setShortcut(Qt::Key_F4); connect(m_breakpointToggleAct, &QAction::triggered, this, &MainWindow::toggleBreakpointAtCursor); connect(m_breakpointEnableAct, &QAction::triggered, this, &MainWindow::enableBreakpointAtCursor); diff --git a/src/osd/modules/debugger/qt/memorywindow.cpp b/src/osd/modules/debugger/qt/memorywindow.cpp index a2213846c93..030eb4ab24d 100644 --- a/src/osd/modules/debugger/qt/memorywindow.cpp +++ b/src/osd/modules/debugger/qt/memorywindow.cpp @@ -12,7 +12,11 @@ #include <QtGui/QClipboard> #include <QtGui/QKeyEvent> #include <QtGui/QMouseEvent> +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include <QtGui/QActionGroup> +#else #include <QtWidgets/QActionGroup> +#endif #include <QtWidgets/QApplication> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QMenu> |