mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
fix: Qt5 compat - fix addAction wrapper, qHash for NodeKind, add windows-qt5 CI
This commit is contained in:
28
.github/workflows/build.yml
vendored
28
.github/workflows/build.yml
vendored
@@ -173,3 +173,31 @@ jobs:
|
||||
files: Reclass-x86_64.AppImage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
windows-qt5:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Qt5
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
version: '5.15.2'
|
||||
arch: 'win64_msvc2019_64'
|
||||
cache: true
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Configure
|
||||
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
|
||||
- name: Test
|
||||
run: ctest --test-dir build --output-on-failure --exclude-regex "test_editor|test_windbg_provider|test_com_security"
|
||||
|
||||
@@ -32,7 +32,7 @@ enum class NodeKind : uint8_t {
|
||||
|
||||
} // namespace rcx (temporarily close for qHash)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
inline uint qHash(rcx::NodeKind key, uint seed = 0) { return ::qHash(static_cast<uint8_t>(key), seed); }
|
||||
inline uint qHash(rcx::NodeKind key, uint seed = 0) { return qHash(static_cast<int>(key), seed); }
|
||||
#endif
|
||||
namespace rcx { // reopen
|
||||
|
||||
|
||||
@@ -357,10 +357,12 @@ QIcon MainWindow::makeIcon(const QString& svgPath) {
|
||||
}
|
||||
|
||||
template < typename...Args >
|
||||
inline QAction* Qt5Qt6AddAction(QWidget* parent, const QString &text, const QKeySequence &shortcut, const QIcon &icon, Args&&...args)
|
||||
inline QAction* Qt5Qt6AddAction(QMenu* menu, const QString &text, const QKeySequence &shortcut, const QIcon &icon, Args&&...args)
|
||||
{
|
||||
QAction *result = parent->addAction(icon, text, shortcut);
|
||||
parent->connect(result, &QAction::triggered, std::forward<Args>(args)...);
|
||||
QAction *result = menu->addAction(icon, text);
|
||||
if (!shortcut.isEmpty())
|
||||
result->setShortcut(shortcut);
|
||||
QObject::connect(result, &QAction::triggered, std::forward<Args>(args)...);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user