From 58ae0a343ae6d750938235e73b95a88eae756bce Mon Sep 17 00:00:00 2001 From: Dmitry Pinaev Date: Sun, 22 Nov 2026 22:00:52 +0100 Subject: [PATCH 1/2] Fix the example builds with MSVC and Qt 5 The calculator example failed with C3493: 'outPortIndex' was not captured by a lambda. The custom painter example failed with C2065: 'M_PI' is undeclared. Capture the variable and use a local pi constant. --- examples/calculator/LongProcessingRandomNumber.hpp | 2 +- examples/custom_painter/CustomConnectionPainter.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/calculator/LongProcessingRandomNumber.hpp b/examples/calculator/LongProcessingRandomNumber.hpp index 04275dbef..d359db115 100644 --- a/examples/calculator/LongProcessingRandomNumber.hpp +++ b/examples/calculator/LongProcessingRandomNumber.hpp @@ -86,7 +86,7 @@ class LongProcessingRandomNumber : public MathOperationDataModel Q_EMIT computingStarted(); PortIndex const outPortIndex = 0; - QTimer::singleShot(_totalDurationMs, this, [this, n1, n2]() { + QTimer::singleShot(_totalDurationMs, this, [this, n1, n2, outPortIndex]() { if (n1 && n2) { double a = n1->number(); double b = n2->number(); diff --git a/examples/custom_painter/CustomConnectionPainter.cpp b/examples/custom_painter/CustomConnectionPainter.cpp index f30170872..e377f0666 100644 --- a/examples/custom_painter/CustomConnectionPainter.cpp +++ b/examples/custom_painter/CustomConnectionPainter.cpp @@ -99,7 +99,8 @@ void CustomConnectionPainter::drawArrow(QPainter *painter, QPointF const &tip, Q // Arrow parameters qreal arrowSize = 10.0; - qreal arrowAngle = M_PI / 6.0; // 30 degrees + constexpr qreal pi = 3.14159265358979323846; + qreal arrowAngle = pi / 6.0; // 30 degrees // Calculate arrow points QPointF arrowP1 = tip From 8d93fffdd94e47971c40ab520442c67da38d2606 Mon Sep 17 00:00:00 2001 From: Dmitry Pinaev Date: Sun, 22 Nov 2026 22:00:52 +0100 Subject: [PATCH 2/2] Run Windows Qt 5 and Qt 6 separately and build the static library in CI Both Windows matrix entries had the same name, so the Qt 5 job never ran. Give each entry its own name. Add a job that builds the static library on Windows. It builds the tests only, with examples off, and uses Qt 6.9.2. --- .github/workflows/cmake_build.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake_build.yml b/.github/workflows/cmake_build.yml index 21c83edd4..05eea3d62 100644 --- a/.github/workflows/cmake_build.yml +++ b/.github/workflows/cmake_build.yml @@ -21,7 +21,9 @@ jobs: toolchain: - linux-gcc - macos-clang - - windows-msvc + - windows-msvc-qt5 + - windows-msvc-qt6 + - windows-msvc-static configuration: - Release @@ -41,20 +43,31 @@ jobs: modules: "" use_qt6: "ON" - - toolchain: windows-msvc + - toolchain: windows-msvc-qt5 os: windows-latest compiler: msvc qt_version: "5.15.2" modules: "" use_qt6: "OFF" - - toolchain: windows-msvc + - toolchain: windows-msvc-qt6 os: windows-latest compiler: msvc qt_version: "6.9.2" modules: "qt5compat" use_qt6: "ON" + # Static library. One job is enough: the tests link it and see the + # NODE_EDITOR_STATIC define, so the examples are skipped to save time. + - toolchain: windows-msvc-static + os: windows-latest + compiler: msvc + qt_version: "6.9.2" + modules: "qt5compat" + use_qt6: "ON" + shared: "OFF" + examples: "OFF" + steps: - name: Checkout Code uses: actions/checkout@v2 @@ -80,7 +93,7 @@ jobs: arch: x64 - name: Configure (${{ matrix.configuration }}) - run: cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DBUILD_DOCS=OFF -DUSE_QT6=${{ matrix.use_qt6 }} + run: cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DBUILD_DOCS=OFF -DUSE_QT6=${{ matrix.use_qt6 }} -DBUILD_SHARED_LIBS=${{ matrix.shared || 'ON' }} -DBUILD_EXAMPLES=${{ matrix.examples || 'ON' }} - name: Build with ${{ matrix.compiler }} run: cmake --build build --config ${{ matrix.configuration }}