From 079b3121ce463f5cfebbcc858334b89f271a4c34 Mon Sep 17 00:00:00 2001 From: IChooseYou Date: Mon, 16 Feb 2026 09:04:28 -0700 Subject: [PATCH] Revert "add Qt5 compatibility wrapper for addAction and linux-qt5 CI job" This reverts commit 5e40349768d4c5aa999a45af64ff66b3d94461d5. --- .github/workflows/build.yml | 30 ------------------------------ src/main.cpp | 19 +++++++++---------- src/qt5compat.h | 37 ------------------------------------- 3 files changed, 9 insertions(+), 77 deletions(-) delete mode 100644 src/qt5compat.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2dadc1f..a22408c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -173,33 +173,3 @@ jobs: files: Reclass-x86_64.AppImage env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - linux-qt5: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install Qt5 - uses: jurplel/install-qt-action@v4 - with: - version: '5.15.2' - cache: true - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y ninja-build libgl1-mesa-dev - - - name: Configure - run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release - - - name: Build - run: cmake --build build - - - name: Test - run: xvfb-run ctest --test-dir build --output-on-failure --exclude-regex "test_editor" - env: - QT_QPA_PLATFORM: offscreen diff --git a/src/main.cpp b/src/main.cpp index 33c1df7..b01e3c9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,4 @@ #include "mainwindow.h" -#include "qt5compat.h" #include "generator.h" #include "mcp/mcp_bridge.h" #include @@ -360,14 +359,14 @@ QIcon MainWindow::makeIcon(const QString& svgPath) { void MainWindow::createMenus() { // File auto* file = m_titleBar->menuBar()->addMenu("&File"); - rcx::compat::addAction(file, "&New", QKeySequence::New, this, &MainWindow::newDocument); - rcx::compat::addAction(file, "New &Tab", QKeySequence(Qt::CTRL | Qt::Key_T), this, &MainWindow::newFile); - rcx::compat::addAction(file, makeIcon(":/vsicons/folder-opened.svg"), "&Open...", QKeySequence::Open, this, &MainWindow::openFile); + file->addAction("&New", QKeySequence::New, this, &MainWindow::newDocument); + file->addAction("New &Tab", QKeySequence(Qt::CTRL | Qt::Key_T), this, &MainWindow::newFile); + file->addAction(makeIcon(":/vsicons/folder-opened.svg"), "&Open...", QKeySequence::Open, this, &MainWindow::openFile); file->addSeparator(); - rcx::compat::addAction(file, makeIcon(":/vsicons/save.svg"), "&Save", QKeySequence::Save, this, &MainWindow::saveFile); - rcx::compat::addAction(file, makeIcon(":/vsicons/save-as.svg"), "Save &As...", QKeySequence::SaveAs, this, &MainWindow::saveFileAs); + file->addAction(makeIcon(":/vsicons/save.svg"), "&Save", QKeySequence::Save, this, &MainWindow::saveFile); + file->addAction(makeIcon(":/vsicons/save-as.svg"), "Save &As...", QKeySequence::SaveAs, this, &MainWindow::saveFileAs); file->addSeparator(); - rcx::compat::addAction(file, "&Unload Project", QKeySequence(Qt::CTRL | Qt::Key_W), this, &MainWindow::closeFile); + file->addAction("&Unload Project", QKeySequence(Qt::CTRL | Qt::Key_W), this, &MainWindow::closeFile); file->addSeparator(); file->addAction(makeIcon(":/vsicons/export.svg"), "Export &C++ Header...", this, &MainWindow::exportCpp); file->addSeparator(); @@ -375,12 +374,12 @@ void MainWindow::createMenus() { file->addSeparator(); file->addAction(makeIcon(":/vsicons/settings-gear.svg"), "&Options...", this, &MainWindow::showOptionsDialog); file->addSeparator(); - rcx::compat::addAction(file, makeIcon(":/vsicons/close.svg"), "E&xit", QKeySequence(Qt::Key_Close), this, &QMainWindow::close); + file->addAction(makeIcon(":/vsicons/close.svg"), "E&xit", QKeySequence(Qt::Key_Close), this, &QMainWindow::close); // Edit auto* edit = m_titleBar->menuBar()->addMenu("&Edit"); - rcx::compat::addAction(edit, makeIcon(":/vsicons/arrow-left.svg"), "&Undo", QKeySequence::Undo, this, &MainWindow::undo); - rcx::compat::addAction(edit, makeIcon(":/vsicons/arrow-right.svg"), "&Redo", QKeySequence::Redo, this, &MainWindow::redo); + edit->addAction(makeIcon(":/vsicons/arrow-left.svg"), "&Undo", QKeySequence::Undo, this, &MainWindow::undo); + edit->addAction(makeIcon(":/vsicons/arrow-right.svg"), "&Redo", QKeySequence::Redo, this, &MainWindow::redo); edit->addSeparator(); edit->addAction("&Type Aliases...", this, &MainWindow::showTypeAliasesDialog); diff --git a/src/qt5compat.h b/src/qt5compat.h deleted file mode 100644 index 89dbc30..0000000 --- a/src/qt5compat.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -namespace rcx { namespace compat { - -// QMenu::addAction with shortcut — Qt6 puts shortcut before receiver, -// Qt5 puts it after. These normalize to the Qt6 argument order. - -template -inline QAction* addAction(QMenu* menu, const QString& text, - const QKeySequence& shortcut, - const Obj* receiver, Func slot) -{ -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - return menu->addAction(text, shortcut, receiver, slot); -#else - return menu->addAction(text, receiver, slot, shortcut); -#endif -} - -template -inline QAction* addAction(QMenu* menu, const QIcon& icon, const QString& text, - const QKeySequence& shortcut, - const Obj* receiver, Func slot) -{ -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - return menu->addAction(icon, text, shortcut, receiver, slot); -#else - return menu->addAction(icon, text, receiver, slot, shortcut); -#endif -} - -}} // namespace rcx::compat