Compare commits
144 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 99ad9aa459 | |||
| c1c72c5a62 | |||
| eeabea10f0 | |||
| e034cfe9cf | |||
| 2db6c3968a | |||
| 14253930ae | |||
| ec0a9f45d3 | |||
| 1121ccea26 | |||
| 94cc9cfef5 | |||
| 346aad75fd | |||
| 2b8cdd3d67 | |||
| be008fb5f6 | |||
| 82cd4d359a | |||
| 6dca56f823 | |||
| 545006bed2 | |||
| dcec0bf7ff | |||
| 7a97e873d9 | |||
| e6124e941a | |||
| d0cea474a6 | |||
| 3c8ba1b1ca | |||
| e19f523227 | |||
| 5dac26d9c7 | |||
| e7873b40d5 | |||
| cd6c66c3c6 | |||
| ef04497ca6 | |||
| 58000283e6 | |||
| 73b96dd1b8 | |||
| 682c6a0ccb | |||
| d3cf8f2635 | |||
| 6aa14a7536 | |||
| 6ce688a709 | |||
| 28357b0f55 | |||
| e21f49d2cf | |||
| 2a115e4381 | |||
| bab32b3764 | |||
| 5cc2e165bf | |||
| 1c764babd1 | |||
| 8d76354647 | |||
| 31edf30c61 | |||
| f55ba568f6 | |||
| 1410e70d13 | |||
| 7669a95694 | |||
| ee53f20303 | |||
| df5f622418 | |||
| 71ff7f925d | |||
| 2fdc07b81b | |||
| 32bb247d68 | |||
| c586a2d3a3 | |||
| f301196f61 | |||
| f2d297b0d8 | |||
| a8e2a7acff | |||
| 53096fa3be | |||
| bf4d3353ae | |||
| 2e4fa9ae02 | |||
| cd0ae76141 | |||
| bd37f12edc | |||
| b873b05245 | |||
| eb02e1dce0 | |||
| ac1e8b3502 | |||
| 215962873b | |||
| 0555cd9045 | |||
| 02cc4f043b | |||
| 8791d2d202 | |||
| 4625964bb1 | |||
| 7a80ce40b7 | |||
| 342ac3626d | |||
| 19a75186b7 | |||
| 9122f5d687 | |||
| 482fd32dc2 | |||
| 4e0c075575 | |||
| ae42198882 | |||
| a666d2d0ae | |||
| 15e7d39243 | |||
| 5574b4d3e9 | |||
| 918db632ed | |||
| f465b33e2b | |||
| 492528136e | |||
| 564a0e64a4 | |||
| 7f5a42a055 | |||
| 14d4aa772b | |||
| 81419bd27d | |||
| ebefc269af | |||
| c6bfd46981 | |||
| 998c5e8a0d | |||
| ae382f6b12 | |||
| d4061d17fa | |||
| fb8c86ec12 | |||
| d62479e6e4 | |||
| 1a4bb91285 | |||
| aa96d5e7df | |||
| e63c303078 | |||
| a8e408ad39 | |||
| 0eb3e1e436 | |||
| ba6320bff8 | |||
| 86b5d7ac95 | |||
| 19e99aab02 | |||
| 44f0abbb56 | |||
| e7787daa2c | |||
| c7fd3416f6 | |||
| b782a1612a | |||
| 2fdbc3c243 | |||
| a219c3f587 | |||
| 6b3b55b0e1 | |||
| 36d0121038 | |||
| 8235ecdbc9 | |||
| b6e4cd4786 | |||
| fb35027624 | |||
| 08a441d1f6 | |||
| e9840728b4 | |||
| ffbcd12d9b | |||
| 0a124f6695 | |||
| 3f6f99b50f | |||
| 42b64a7f0a | |||
| 361719ca74 | |||
| 181e2b555d | |||
| 420512595d | |||
| 9b4bed361d | |||
| 339bc8700b | |||
| 87d5ae5580 | |||
| 1070179617 | |||
| 6c4711a8d0 | |||
| 8a8a338a2e | |||
| 407cc7a4c2 | |||
| 5cb8930732 | |||
| a24acfac24 | |||
| 8b0b1d10d4 | |||
| 57dfa28674 | |||
| 3848c7821a | |||
| 1572c23d51 | |||
| e234f063f8 | |||
| be21604ad0 | |||
| e1ccc1e568 | |||
| e202b5bc2b | |||
| 2b7e62f901 | |||
| 23e8258ae1 | |||
| 457d265f0a | |||
| cd76b6a1d6 | |||
| b522a94556 | |||
| 399bc0e897 | |||
| de9eeed542 | |||
| c071e92c58 | |||
| d22e4abf96 | |||
| 38b91e8083 | |||
| 19704cf5ca |
@@ -10,9 +10,6 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# =============================================================================
|
||||
# Job 1: Qt5 build (stable track)
|
||||
# =============================================================================
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
@@ -38,7 +35,6 @@ jobs:
|
||||
mingw-w64-ucrt-x86_64-qt5-svg
|
||||
mingw-w64-ucrt-x86_64-qt5-tools
|
||||
mingw-w64-ucrt-x86_64-qt5-translations
|
||||
mingw-w64-ucrt-x86_64-qt5-pdf
|
||||
mingw-w64-ucrt-x86_64-sqlite3
|
||||
mingw-w64-ucrt-x86_64-pkg-config
|
||||
mingw-w64-ucrt-x86_64-kwidgetsaddons
|
||||
@@ -114,7 +110,6 @@ jobs:
|
||||
-DQT_VERSION_MAJOR=5 \
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Qt6=ON \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0077=NEW \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-DCMAKE_CXX_FLAGS="-DQET_EXPORT_PROJECT_DB" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=/ucrt64/bin/ccache \
|
||||
@@ -359,370 +354,33 @@ jobs:
|
||||
path: nsis_root/files/
|
||||
retention-days: 14
|
||||
|
||||
# =============================================================================
|
||||
# Job 2: Qt6 build (EXPERIMENTAL track)
|
||||
#
|
||||
# Version label: the C++ source (sources/qetversion.cpp) intentionally stays
|
||||
# Qt-agnostic — QT_VERSION-based detection inside the binary proved unreliable
|
||||
# (see commit e1aa65f, reverting 608ca984). Here the CI job itself knows with
|
||||
# certainty which Qt major version it configured (-DQT_VERSION_MAJOR=6), so it
|
||||
# is safe to label the *package* "0.200.1" at this level, without touching
|
||||
# QetVersion::currentVersion() or making the binary self-detect its Qt build.
|
||||
# =============================================================================
|
||||
build-windows-qt6:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: UCRT64
|
||||
update: true
|
||||
cache: true
|
||||
install: >-
|
||||
git
|
||||
mingw-w64-ucrt-x86_64-ccache
|
||||
mingw-w64-ucrt-x86_64-gcc
|
||||
mingw-w64-ucrt-x86_64-cmake
|
||||
mingw-w64-ucrt-x86_64-ninja
|
||||
mingw-w64-ucrt-x86_64-qt6-base
|
||||
mingw-w64-ucrt-x86_64-qt6-svg
|
||||
mingw-w64-ucrt-x86_64-qt6-tools
|
||||
mingw-w64-ucrt-x86_64-qt6-translations
|
||||
mingw-w64-ucrt-x86_64-qt6-pdf
|
||||
mingw-w64-ucrt-x86_64-sqlite3
|
||||
mingw-w64-ucrt-x86_64-pkg-config
|
||||
mingw-w64-ucrt-x86_64-nsis
|
||||
mingw-w64-ucrt-x86_64-angleproject
|
||||
|
||||
- name: Cache ccache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: C:\Users\runneradmin\AppData\Local\ccache
|
||||
key: ccache-windows-qt6-${{ github.ref_name }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-windows-qt6-${{ github.ref_name }}-
|
||||
ccache-windows-qt6-
|
||||
|
||||
- name: Configure ccache
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
/ucrt64/bin/ccache --set-config=max_size=500M
|
||||
/ucrt64/bin/ccache --set-config=compression=true
|
||||
/ucrt64/bin/ccache -z
|
||||
echo "=== ccache config ==="
|
||||
/ucrt64/bin/ccache -p
|
||||
|
||||
- name: Patch NSIS Welcome page — fix title font size
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
WELCOME_NSH=$(find /ucrt64 -path "*/Modern UI 2/Pages/Welcome.nsh" | head -1)
|
||||
if [ -z "$WELCOME_NSH" ]; then
|
||||
echo "WARNING: Welcome.nsh not found, skipping font patch"
|
||||
else
|
||||
echo "Patching: $WELCOME_NSH"
|
||||
sed -i '/WelcomePage\.Title\.Font/s/"[0-9]\+" "700"/"10" "700"/' "$WELCOME_NSH"
|
||||
grep 'WelcomePage.Title.Font' "$WELCOME_NSH"
|
||||
echo " OK font size patched to 10"
|
||||
fi
|
||||
|
||||
FINISH_NSH=$(find /ucrt64 -path "*/Modern UI 2/Pages/Finish.nsh" | head -1)
|
||||
if [ -z "$FINISH_NSH" ]; then
|
||||
echo "WARNING: Finish.nsh not found, skipping font patch"
|
||||
else
|
||||
echo "Patching: $FINISH_NSH"
|
||||
sed -i '/FinishPage\.Title\.Font/s/"[0-9]\+" "700"/"10" "700"/' "$FINISH_NSH"
|
||||
grep 'FinishPage.Title.Font' "$FINISH_NSH"
|
||||
echo " OK font size patched to 10"
|
||||
fi
|
||||
|
||||
- name: Build with cmake
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
mkdir build && cd build
|
||||
NPROC=$(nproc)
|
||||
echo "Available CPUs: $NPROC"
|
||||
|
||||
cmake -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH=/ucrt64 \
|
||||
-DQt6_DIR=/ucrt64/lib/cmake/Qt6 \
|
||||
-DQT_VERSION_MAJOR=6 \
|
||||
-DBUILD_WITH_KF5=OFF \
|
||||
-DPACKAGE_TESTS=OFF \
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0077=NEW \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-DCMAKE_CXX_FLAGS="-DQET_EXPORT_PROJECT_DB" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=/ucrt64/bin/ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=/ucrt64/bin/ccache \
|
||||
-DSQLite3_INCLUDE_DIR=/ucrt64/include \
|
||||
-DSQLite3_LIBRARY=/ucrt64/lib/libsqlite3.dll.a \
|
||||
..
|
||||
ninja -j"$NPROC"
|
||||
|
||||
- name: Show ccache stats
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
echo "=== ccache statistics ==="
|
||||
/ucrt64/bin/ccache -s
|
||||
|
||||
- name: Verify exe was built
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
EXE=$(find "$GITHUB_WORKSPACE/build" -maxdepth 3 -iname "qelectrotech.exe" | head -1)
|
||||
if [ -z "$EXE" ]; then
|
||||
echo "ERROR: no qelectrotech.exe found in build/"
|
||||
find "$GITHUB_WORKSPACE/build" -maxdepth 3 -name "*.exe" || true
|
||||
exit 1
|
||||
fi
|
||||
SIZE=$(stat -c%s "$EXE")
|
||||
echo "Exe found: $EXE ($SIZE bytes)"
|
||||
[ "$SIZE" -gt 100000 ] || { echo "ERROR: exe too small"; exit 1; }
|
||||
|
||||
- name: Deploy — copy exe + windeployqt + DLLs
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
NSIS_ROOT="$GITHUB_WORKSPACE/nsis_root"
|
||||
FILES="$NSIS_ROOT/files"
|
||||
BIN="$FILES/bin"
|
||||
mkdir -p "$BIN"
|
||||
|
||||
EXE=$(find "$GITHUB_WORKSPACE/build" -maxdepth 3 -iname "qelectrotech.exe" | head -1)
|
||||
echo "Copying exe: $EXE -> $BIN/QElectroTech.exe"
|
||||
cp "$EXE" "$BIN/QElectroTech.exe"
|
||||
|
||||
cd "$BIN"
|
||||
/ucrt64/bin/windeployqt6 \
|
||||
--release \
|
||||
--no-translations \
|
||||
--no-compiler-runtime \
|
||||
./QElectroTech.exe || true
|
||||
|
||||
echo "=== 3-pass transitive DLL scan ==="
|
||||
set +e
|
||||
for PASS in 1 2 3; do
|
||||
echo "-- Pass $PASS --"
|
||||
for bin_file in "$BIN"/*.dll "$BIN"/*.exe "$BIN"/sqldrivers/*.dll "$BIN"/platforms/*.dll "$BIN"/imageformats/*.dll; do
|
||||
[ -f "$bin_file" ] || continue
|
||||
while IFS= read -r line; do
|
||||
dll_path=$(echo "$line" | awk '{print $3}')
|
||||
[ -f "$dll_path" ] || continue
|
||||
dll_name=$(basename "$dll_path")
|
||||
dst="$BIN/$dll_name"
|
||||
if [ ! -f "$dst" ]; then
|
||||
cp "$dll_path" "$dst"
|
||||
echo " Copied (pass $PASS): $dll_name"
|
||||
fi
|
||||
done < <(ldd "$bin_file" 2>/dev/null | grep -i '/ucrt64/bin/')
|
||||
done
|
||||
done
|
||||
set -e
|
||||
|
||||
DLL_COUNT=$(find "$BIN" -name "*.dll" | wc -l)
|
||||
echo "=== $DLL_COUNT DLLs present after scan ==="
|
||||
ls -lh "$BIN/QElectroTech.exe" || { echo "ERROR: exe missing from bin/"; exit 1; }
|
||||
[ "$DLL_COUNT" -gt 5 ] || { echo "ERROR: too few DLLs"; exit 1; }
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
|
||||
cp /ucrt64/bin/libgcc_s_seh-1.dll "$BIN/"
|
||||
cp /ucrt64/bin/libstdc++-6.dll "$BIN/"
|
||||
cp /ucrt64/bin/libwinpthread-1.dll "$BIN/"
|
||||
SQLITE=$(find /ucrt64/bin -name "libsqlite3*.dll" | head -1)
|
||||
if [ -n "$SQLITE" ]; then
|
||||
cp "$SQLITE" "$BIN/"
|
||||
echo "SQLite3 copied: $(basename $SQLITE)"
|
||||
else
|
||||
echo "WARNING: libsqlite3 not found in /ucrt64/bin/"
|
||||
fi
|
||||
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/QET64.nsi" "$NSIS_ROOT/"
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra.nsh" "$NSIS_ROOT/"
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra_fr.nsh" "$NSIS_ROOT/"
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra_missing.nsh" "$NSIS_ROOT/"
|
||||
cp -r "$GITHUB_WORKSPACE/build-aux/windows/nsis_base/." "$NSIS_ROOT/"
|
||||
|
||||
curl -fsSL \
|
||||
"https://raw.githubusercontent.com/qelectrotech/qelectrotech-source-mirror/refs/heads/master/misc/Lancer%20QET_qt6.bat" \
|
||||
-o "$FILES/Lancer QET_qt6.bat"
|
||||
cp -r "$GITHUB_WORKSPACE/elements" "$FILES/elements" || true
|
||||
cp -r "$GITHUB_WORKSPACE/titleblocks" "$FILES/titleblocks" || true
|
||||
cp -r "$GITHUB_WORKSPACE/examples" "$FILES/examples" || true
|
||||
cp -r "$GITHUB_WORKSPACE/fonts" "$FILES/fonts" || true
|
||||
|
||||
cp -r "$GITHUB_WORKSPACE/lang" "$FILES/lang" || true
|
||||
find "$GITHUB_WORKSPACE/build" -name "*.qm" -exec cp {} "$FILES/lang/" \; 2>/dev/null || true
|
||||
echo "=== .qm files in files/lang/ ==="
|
||||
ls "$FILES/lang/"*.qm 2>/dev/null | wc -l || echo "0 .qm files"
|
||||
|
||||
for f in LICENSE ChangeLog CREDIT README ELEMENTS.LICENSE; do
|
||||
cp "$GITHUB_WORKSPACE/$f" "$FILES/$f" 2>/dev/null || true
|
||||
done
|
||||
|
||||
echo "=== Verification of key files in files/ ==="
|
||||
for f in LICENSE ChangeLog CREDIT README ELEMENTS.LICENSE \
|
||||
qet_uninstall_file_associations.reg register_filetypes.bat "Lancer QET_qt6.bat"; do
|
||||
[ -f "$FILES/$f" ] \
|
||||
&& echo " OK : $f" \
|
||||
|| echo " MISSING: $f"
|
||||
done
|
||||
for d in ico elements lang titleblocks fonts examples bin; do
|
||||
[ -d "$FILES/$d" ] \
|
||||
&& echo " OK : $d/" \
|
||||
|| echo " MISSING: $d/"
|
||||
done
|
||||
|
||||
- name: Extract version for installer name (Qt6 — labelled 0.200.1)
|
||||
shell: msys2 {0}
|
||||
id: qet_version
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
GITCOMMIT=$(git -C "$GITHUB_WORKSPACE" rev-parse --short HEAD)
|
||||
|
||||
A=$(git -C "$GITHUB_WORKSPACE" rev-list HEAD --count)
|
||||
HEAD=$(( A + 473 ))
|
||||
|
||||
# Deliberately NOT parsed from sources/qetversion.cpp: the CI job
|
||||
# already knows for certain it configured Qt6 (-DQT_VERSION_MAJOR=6),
|
||||
# so the "0.200.1" experimental-track label is set here explicitly
|
||||
# rather than relying on in-binary Qt version detection.
|
||||
VERSION="0.200.1"
|
||||
|
||||
FULL_VERSION="${VERSION}-qt6-r${HEAD}-${GITCOMMIT}_x86_64-win64"
|
||||
BASE_VERSION="${VERSION}-qt6"
|
||||
echo "version=$FULL_VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "base_version=$BASE_VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "gitcommit=$GITCOMMIT" >> "$GITHUB_OUTPUT"
|
||||
echo "head=$HEAD" >> "$GITHUB_OUTPUT"
|
||||
echo "VERSION : $VERSION"
|
||||
echo "GITCOMMIT : $GITCOMMIT"
|
||||
echo "HEAD (rev) : $HEAD"
|
||||
echo "FULL : $FULL_VERSION"
|
||||
|
||||
- name: Patch QET64.nsi — version + exe name + absolute paths
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
VERSION="${{ steps.qet_version.outputs.version }}"
|
||||
NSI="$GITHUB_WORKSPACE/nsis_root/QET64.nsi"
|
||||
FILES_WIN=$(cygpath -w "$GITHUB_WORKSPACE/nsis_root/files")
|
||||
SCRIPT="$GITHUB_WORKSPACE/build-aux/windows/patch_nsi.py"
|
||||
|
||||
python3 "$SCRIPT" "$NSI" "$VERSION" "$FILES_WIN"
|
||||
|
||||
echo "=== Verification ==="
|
||||
grep 'SOFT_VERSION' "$NSI" | head -1
|
||||
grep -m2 'nsis_root' "$NSI" | head -2
|
||||
echo "=== Contents of nsis_root/files/ ==="
|
||||
ls "$GITHUB_WORKSPACE/nsis_root/files/"
|
||||
|
||||
- name: Build NSIS installer
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
NSIS_ROOT="$GITHUB_WORKSPACE/nsis_root"
|
||||
cd "$NSIS_ROOT"
|
||||
echo "=== CWD : $(pwd) ==="
|
||||
MSYS2_ARG_CONV_EXCL="*" makensis /V4 QET64.nsi
|
||||
RC=$?
|
||||
echo "=== Contents of nsis_root after makensis ==="
|
||||
ls "$NSIS_ROOT/"
|
||||
[ $RC -eq 0 ] || { echo "ERROR: makensis failed (exit $RC)"; exit 1; }
|
||||
|
||||
- name: Move installer to dist/
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p "$GITHUB_WORKSPACE/dist"
|
||||
INSTALLER=$(find "$GITHUB_WORKSPACE/nsis_root" -maxdepth 1 -iname "installer_*.exe" | head -1)
|
||||
if [ -z "$INSTALLER" ]; then
|
||||
echo "ERROR: no installer .exe found in nsis_root/"
|
||||
ls "$GITHUB_WORKSPACE/nsis_root/"
|
||||
exit 1
|
||||
fi
|
||||
echo "Moving: $INSTALLER -> dist/"
|
||||
mv "$INSTALLER" "$GITHUB_WORKSPACE/dist/"
|
||||
|
||||
- name: Upload build logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: build-logs-qt6
|
||||
path: |
|
||||
build/CMakeFiles/*.log
|
||||
nsis_root/files/bin/
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Zip portable (readytouse)
|
||||
id: zip_portable
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "${{ steps.qet_version.outputs.base_version }}"
|
||||
$head = "${{ steps.qet_version.outputs.head }}"
|
||||
$zipName = "qelectrotech-${version}+git${head}-x86-win64-readytouse.zip"
|
||||
$src = "$env:GITHUB_WORKSPACE\nsis_root\files"
|
||||
$dst = "$env:GITHUB_WORKSPACE\dist\$zipName"
|
||||
$7z = "C:\Program Files\7-Zip\7z.exe"
|
||||
|
||||
New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\dist" | Out-Null
|
||||
& $7z a -tzip -mx=5 -mmt=on $dst "$src\*"
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
|
||||
$sizeMB = [math]::Round((Get-Item $dst).Length / 1MB, 1)
|
||||
Write-Output "ZIP created: $zipName ($sizeMB MB)"
|
||||
"zip_name=$zipName" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
||||
|
||||
- name: Upload portable (files/ without installer)
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: qelectrotech-${{ steps.qet_version.outputs.base_version }}+git${{ steps.qet_version.outputs.head }}-x86-win64-readytouse
|
||||
path: dist/${{ steps.zip_portable.outputs.zip_name }}
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload NSIS installer
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: qelectrotech-windows-installer-qt6
|
||||
path: dist/Installer_*.exe
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload portable (nom fixe pour le workflow MSI)
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: qelectrotech-windows-portable-qt6
|
||||
path: nsis_root/files/
|
||||
retention-days: 14
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Job 3 : Publie les assets nightly (exe + zip, Qt5 et Qt6) sur la release
|
||||
# Job 2 : Publie une release nightly + page GitHub Pages
|
||||
# Ne tourne que sur push master (pas sur les PRs)
|
||||
# ---------------------------------------------------------------------------
|
||||
publish-nightly-assets:
|
||||
needs: [build-windows, build-windows-qt6]
|
||||
deploy-pages:
|
||||
needs: build-windows
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request'
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Download installer artifacts (Qt5 + Qt6)
|
||||
- name: Checkout master (for build-aux scripts)
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
ref: master
|
||||
path: source
|
||||
sparse-checkout: build-aux/generate-page.py
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Download installer artifact
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: qelectrotech-windows-installer*
|
||||
name: qelectrotech-windows-installer
|
||||
path: downloaded/installer/
|
||||
merge-multiple: true
|
||||
|
||||
- name: Download portable artifacts (Qt5 + Qt6)
|
||||
- name: Download portable artifact
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: qelectrotech-*-readytouse
|
||||
@@ -734,6 +392,7 @@ jobs:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
# Fetch existing .exe and .zip asset names and delete them
|
||||
gh release view nightly --repo "$REPO" --json assets \
|
||||
--jq '.assets[] | select(.name | test("\\.(exe|zip)$")) | .name' \
|
||||
| while read -r name; do
|
||||
@@ -758,9 +417,6 @@ jobs:
|
||||
|
||||
> ⚠️ This is a development version; it introduces new features you want, but may cause bugs that have not yet been identified yet.
|
||||
> For stable releases, see the [Releases page](https://github.com/${{ github.repository }}/releases).
|
||||
|
||||
> 🧪 **Qt6 builds are experimental.** Files tagged `-qt6-` are built against Qt6 and are not yet
|
||||
> as tested as the Qt5 track. Expect rough edges; report issues clearly labelled "Qt6".
|
||||
prerelease: true
|
||||
make_latest: false
|
||||
files: |
|
||||
@@ -769,4 +425,4 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# GitHub Pages is generated and deployed by windows-msi.yml
|
||||
# after the MSI upload, so that all URLs (exe/zip/msi, Qt5+Qt6) are known.
|
||||
# after the MSI upload, so that all 3 URLs (exe, zip, msi) are known.
|
||||
|
||||
@@ -16,37 +16,18 @@ on:
|
||||
|
||||
jobs:
|
||||
build-msi:
|
||||
name: Build MSI with WiX v7 (${{ matrix.flavor }})
|
||||
name: Build MSI with WiX v7
|
||||
runs-on: windows-latest
|
||||
# Only runs if Windows Build succeeded (or triggered manually)
|
||||
if: >
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
github.event.workflow_run.conclusion == 'success'
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- flavor: qt5
|
||||
portable_artifact: qelectrotech-windows-portable
|
||||
version_source: qetversion # parsed from sources/qetversion.cpp
|
||||
label_suffix: ""
|
||||
experimental: false
|
||||
- flavor: qt6
|
||||
portable_artifact: qelectrotech-windows-portable-qt6
|
||||
version_source: hardcoded # see note in "Extract version" step
|
||||
label_suffix: "-qt6-EXPERIMENTAL"
|
||||
experimental: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write # Required by SignPath
|
||||
|
||||
outputs:
|
||||
qt5_msi: ${{ steps.export.outputs.msi_name_qt5 }}
|
||||
qt6_msi: ${{ steps.export.outputs.msi_name_qt6 }}
|
||||
|
||||
steps:
|
||||
# ----------------------------------------------------------------
|
||||
# 1. Checkout (to retrieve QElectroTech.wxs and sources)
|
||||
@@ -57,12 +38,14 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 2. Download the portable artifact for this flavor
|
||||
# 2. Download the portable artifact from the main build
|
||||
# Requires windows-build.yml to upload an artifact named
|
||||
# "qelectrotech-windows-portable" (fixed name)
|
||||
# ----------------------------------------------------------------
|
||||
- name: Download portable artifact
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ${{ matrix.portable_artifact }}
|
||||
name: qelectrotech-windows-portable
|
||||
path: artifact\files
|
||||
# workflow_run => use the triggering run's ID
|
||||
# workflow_dispatch => use input run_id if provided, otherwise current run
|
||||
@@ -71,34 +54,23 @@ jobs:
|
||||
repository: ${{ github.repository }}
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 3. Extract version
|
||||
# Qt5: parsed from sources/qetversion.cpp (single source of truth
|
||||
# for the software's own reported version).
|
||||
# Qt6: hardcoded "0.200.1" here — deliberately NOT parsed from the
|
||||
# binary/source, since Qt-version self-detection inside the
|
||||
# compiled code proved unreliable (see commit e1aa65f). The CI
|
||||
# matrix entry already knows for certain which flavor it is
|
||||
# packaging, so the experimental-track label is set explicitly
|
||||
# at the packaging level instead.
|
||||
# 3. Extract version from sources
|
||||
# ----------------------------------------------------------------
|
||||
- name: Extract version
|
||||
id: version
|
||||
shell: pwsh
|
||||
run: |
|
||||
if ("${{ matrix.version_source }}" -eq "hardcoded") {
|
||||
$ver = "0.200.1"
|
||||
# Version from qetversion.cpp (same logic as windows-build.yml)
|
||||
$src = Get-Content "sources\qetversion.cpp" -Raw -ErrorAction SilentlyContinue
|
||||
if ($src -match 'return QVersionNumber\{([^}]+)\}') {
|
||||
$ver = $Matches[1] -replace '\s','' -replace ',','.'
|
||||
} else {
|
||||
$src = Get-Content "sources\qetversion.cpp" -Raw -ErrorAction SilentlyContinue
|
||||
if ($src -match 'return QVersionNumber\{([^}]+)\}') {
|
||||
$ver = $Matches[1] -replace '\s','' -replace ',','.'
|
||||
# Fallback: CMakeLists.txt
|
||||
$cmake = Get-Content "CMakeLists.txt" -Raw
|
||||
if ($cmake -match 'project\s*\([^)]*VERSION\s+([\d]+\.[\d]+\.[\d]+)') {
|
||||
$ver = $Matches[1]
|
||||
} else {
|
||||
# Fallback: CMakeLists.txt
|
||||
$cmake = Get-Content "CMakeLists.txt" -Raw
|
||||
if ($cmake -match 'project\s*\([^)]*VERSION\s+([\d]+\.[\d]+\.[\d]+)') {
|
||||
$ver = $Matches[1]
|
||||
} else {
|
||||
$ver = "0.0.0"
|
||||
}
|
||||
$ver = "0.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,39 +89,39 @@ jobs:
|
||||
$verParts = $ver -split '\.'
|
||||
$verMsi = "$($verParts[0]).$($verParts[1]).$($rev % 65535)"
|
||||
|
||||
$flavorTag = "${{ matrix.label_suffix }}"
|
||||
$verDisplay = "${ver}${flavorTag}-r${rev}-${sha}_x86_64-win64"
|
||||
$verDisplay = "${ver}-r${rev}-${sha}_x86_64-win64"
|
||||
|
||||
echo "VERSION_MSI=$verMsi" >> $env:GITHUB_OUTPUT
|
||||
echo "VERSION_MSI=$verMsi" >> $env:GITHUB_OUTPUT
|
||||
echo "VERSION_DISPLAY=$verDisplay" >> $env:GITHUB_OUTPUT
|
||||
Write-Host "Version MSI : $verMsi"
|
||||
Write-Host "Version display : $verDisplay"
|
||||
|
||||
# Qt platform argument: only Qt5 needs the QTBUG-83161 font-rendering
|
||||
# workaround (GDI backend). Qt6 uses DirectWrite by default and does
|
||||
# not need it. Computed once here so both the bundled "Lancer QET.bat"
|
||||
# and the MSI shortcuts (wix build -d QtPlatformArgs=...) stay in sync.
|
||||
if ("${{ matrix.flavor }}" -eq "qt5") {
|
||||
$qtArgs = "-platform windows:fontengine=freetype"
|
||||
} else {
|
||||
$qtArgs = ""
|
||||
}
|
||||
echo "QT_ARGS=$qtArgs" >> $env:GITHUB_OUTPUT
|
||||
Write-Host "Qt platform args: '$qtArgs'"
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 4. Install WiX v7, accept EULA and install WixUI extension
|
||||
# All done in one step: PATH is updated within the same step
|
||||
# so wix is immediately available for eula and extension commands
|
||||
# ----------------------------------------------------------------
|
||||
- name: Install WiX v7
|
||||
shell: pwsh
|
||||
run: |
|
||||
dotnet tool install --global wix --version 7.0.0
|
||||
|
||||
# Update PATH immediately for the rest of this step
|
||||
$toolsPath = [System.IO.Path]::Combine($env:USERPROFILE, '.dotnet', 'tools')
|
||||
$env:PATH = "$toolsPath;$env:PATH"
|
||||
|
||||
# Also export for subsequent steps
|
||||
echo $toolsPath >> $env:GITHUB_PATH
|
||||
|
||||
# Accept OSMF EULA (official CI/CD method: writes a sentinel file)
|
||||
wix eula accept wix7
|
||||
|
||||
# Install WixUI extension
|
||||
wix extension add WixToolset.UI.wixext/7.0.0
|
||||
|
||||
# Install WixUtil extension (required for custom actions: Binary:Wix4UtilCA_*)
|
||||
wix extension add WixToolset.Util.wixext/7.0.0
|
||||
|
||||
Write-Host "WiX v7 installed, EULA accepted, UI + Util extensions added."
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
@@ -161,6 +133,8 @@ jobs:
|
||||
$wxs = "build-aux\windows\QElectroTech.wxs"
|
||||
if (-not (Test-Path $wxs)) {
|
||||
Write-Error "WXS file not found: $wxs"
|
||||
Write-Host "Contents of build-aux\windows\ :"
|
||||
Get-ChildItem "build-aux\windows\" -ErrorAction SilentlyContinue
|
||||
exit 1
|
||||
}
|
||||
Write-Host "WXS found: $wxs"
|
||||
@@ -171,8 +145,14 @@ jobs:
|
||||
- name: Check artifact structure
|
||||
shell: pwsh
|
||||
run: |
|
||||
Write-Host "=== Contents of artifact\files (2 levels) ==="
|
||||
Get-ChildItem -Path "artifact\files" -Depth 2 |
|
||||
Select-Object FullName | Format-Table -AutoSize
|
||||
|
||||
# Search for qelectrotech.exe in the artifact
|
||||
$exe = Get-ChildItem -Path "artifact\files" -Filter "qelectrotech.exe" -Recurse | Select-Object -First 1
|
||||
if (-not $exe) {
|
||||
# Also try QElectroTech.exe (capital Q)
|
||||
$exe = Get-ChildItem -Path "artifact\files" -Filter "QElectroTech.exe" -Recurse | Select-Object -First 1
|
||||
}
|
||||
if (-not $exe) {
|
||||
@@ -180,6 +160,8 @@ jobs:
|
||||
exit 1
|
||||
}
|
||||
Write-Host "Executable: $($exe.FullName) ($([math]::Round($exe.Length/1MB,1)) MB)"
|
||||
|
||||
# FilesDir = folder containing bin\
|
||||
$binDir = $exe.Directory.FullName
|
||||
$filesDir = Split-Path $binDir -Parent
|
||||
echo "FILES_DIR=$filesDir" >> $env:GITHUB_ENV
|
||||
@@ -187,23 +169,31 @@ jobs:
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 7. Convert LICENSE (GPL-2) to RTF for the WixUI licence screen
|
||||
# RTF is the only format accepted by Windows Installer.
|
||||
# The conversion wraps plain text lines in basic RTF markup.
|
||||
# ----------------------------------------------------------------
|
||||
- name: Convert LICENSE to RTF
|
||||
shell: pwsh
|
||||
run: |
|
||||
$licSrc = "LICENSE"
|
||||
$licRtf = "$env:TEMP\License.rtf"
|
||||
|
||||
if (-not (Test-Path $licSrc)) {
|
||||
Write-Error "LICENSE file not found in repository root"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$lines = Get-Content $licSrc -Encoding UTF8
|
||||
|
||||
# RTF header — Courier New, 9pt, black
|
||||
$rtf = New-Object System.Text.StringBuilder
|
||||
[void]$rtf.AppendLine('{\rtf1\ansi\ansicpg1252\deff0')
|
||||
[void]$rtf.AppendLine('{\fonttbl{\f0\fmodern\fprq1\fcharset0 Courier New;}}')
|
||||
[void]$rtf.AppendLine('{\colortbl;\red0\green0\blue0;}')
|
||||
[void]$rtf.AppendLine('\f0\fs18\cf1')
|
||||
|
||||
foreach ($line in $lines) {
|
||||
# Escape RTF special characters
|
||||
$escaped = $line `
|
||||
-replace '\\', '\\\\' `
|
||||
-replace '\{', '\{' `
|
||||
@@ -211,27 +201,29 @@ jobs:
|
||||
[void]$rtf.AppendLine("$escaped\par")
|
||||
}
|
||||
[void]$rtf.AppendLine('}')
|
||||
|
||||
[System.IO.File]::WriteAllText($licRtf, $rtf.ToString(), [System.Text.Encoding]::ASCII)
|
||||
echo "LICENSE_RTF=$licRtf" >> $env:GITHUB_ENV
|
||||
Write-Host "License.rtf generated: $licRtf"
|
||||
Write-Host "License.rtf generated: $licRtf ($([math]::Round((Get-Item $licRtf).Length/1KB,1)) KB)"
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 8. Replace Lancer QET.bat with the MSI-specific version
|
||||
# The portable version uses relative paths suited for the zip.
|
||||
# The MSI version uses %~dp0 to resolve paths relative to
|
||||
# the installation directory in Program Files.
|
||||
# ----------------------------------------------------------------
|
||||
- name: Replace Lancer QET.bat for MSI
|
||||
shell: pwsh
|
||||
run: |
|
||||
$qtArgs = "${{ steps.version.outputs.QT_ARGS }}"
|
||||
$bat = "$env:FILES_DIR\Lancer QET.bat"
|
||||
$content = "@echo off`r`nstart `"`" `"%~dp0bin\qelectrotech.exe`" --common-elements-dir=`"%~dp0elements/`" --common-tbt-dir=`"%~dp0titleblocks/`" --lang-dir=`"%~dp0lang/`" $qtArgs`r`n"
|
||||
$content = "@echo off`r`nstart `"`" `"%~dp0bin\qelectrotech.exe`" --common-elements-dir=`"%~dp0elements/`" --common-tbt-dir=`"%~dp0titleblocks/`" --lang-dir=`"%~dp0lang/`" -style windowsvista`r`n"
|
||||
[System.IO.File]::WriteAllText($bat, $content, [System.Text.Encoding]::ASCII)
|
||||
Write-Host "Lancer QET.bat replaced for MSI installation (qtArgs: '$qtArgs')."
|
||||
Write-Host "Lancer QET.bat replaced for MSI installation."
|
||||
Write-Host "=== Content of new Lancer QET.bat ==="
|
||||
Get-Content $bat
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 9. Build the MSI (unsigned)
|
||||
# Qt6 (experimental) uses a distinct ProductCode seed so it never
|
||||
# collides with / upgrades over the Qt5 MSI — they must be able to
|
||||
# coexist as clearly separate installs.
|
||||
# ----------------------------------------------------------------
|
||||
- name: Build MSI
|
||||
shell: pwsh
|
||||
@@ -243,22 +235,26 @@ jobs:
|
||||
$wxs = "build-aux\windows\QElectroTech.wxs"
|
||||
$outputName = "QElectroTech-${verDisplay}.msi"
|
||||
|
||||
$seed = "qelectrotech-msi-${{ matrix.flavor }}-$version"
|
||||
# Deterministic ProductCode GUID (UUID v5) based on version.
|
||||
# Same version => same GUID (required for MSI repair/uninstall).
|
||||
# Different version => different GUID (triggers a proper upgrade).
|
||||
$seed = "qelectrotech-msi-$version"
|
||||
$sha1 = [System.Security.Cryptography.SHA1]::Create()
|
||||
$hash = $sha1.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($seed))
|
||||
$hash[6] = ($hash[6] -band 0x0F) -bor 0x50
|
||||
$hash[8] = ($hash[8] -band 0x3F) -bor 0x80
|
||||
$hash[6] = ($hash[6] -band 0x0F) -bor 0x50 # UUID version 5
|
||||
$hash[8] = ($hash[8] -band 0x3F) -bor 0x80 # RFC4122 variant
|
||||
$productCode = "{$([System.Guid]::new([byte[]]$hash[0..15]).ToString().ToUpper())}"
|
||||
|
||||
New-Item -ItemType Directory -Force -Path "dist" | Out-Null
|
||||
|
||||
Write-Host "=== wix build (${{ matrix.flavor }}) ==="
|
||||
Write-Host "=== wix build ==="
|
||||
Write-Host " WXS : $wxs"
|
||||
Write-Host " Version : $version"
|
||||
Write-Host " ProductCode : $productCode"
|
||||
Write-Host " FilesDir : $filesDir"
|
||||
Write-Host " LicenseRtf : $licRtf"
|
||||
Write-Host " Output : dist\$outputName"
|
||||
|
||||
$qtArgs = "${{ steps.version.outputs.QT_ARGS }}"
|
||||
|
||||
wix build $wxs `
|
||||
-arch x64 `
|
||||
-d "Version=$version" `
|
||||
@@ -266,7 +262,6 @@ jobs:
|
||||
-d "ProductCode=$productCode" `
|
||||
-d "FilesDir=$filesDir" `
|
||||
-d "LicenseRtf=$licRtf" `
|
||||
-d QtPlatformArgs="$qtArgs" `
|
||||
-ext WixToolset.UI.wixext `
|
||||
-ext WixToolset.Util.wixext `
|
||||
-o "dist\$outputName"
|
||||
@@ -277,24 +272,35 @@ jobs:
|
||||
}
|
||||
|
||||
$size = [math]::Round((Get-Item "dist\$outputName").Length / 1MB, 1)
|
||||
Write-Host "MSI generated: dist\$outputName ($size MB) OK"
|
||||
Write-Host "MSI generated: dist\$outputName ($size MB) ✓"
|
||||
echo "MSI_NAME=$outputName" >> $env:GITHUB_ENV
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 9b. Upload unsigned MSI as artifact (required by SignPath)
|
||||
# SignPath fetches artifacts directly from GitHub Actions,
|
||||
# so the MSI must be uploaded before the signing request.
|
||||
# We capture the artifact-id output for use by SignPath.
|
||||
# ----------------------------------------------------------------
|
||||
- name: Upload unsigned MSI artifact (pre-signing)
|
||||
id: upload_unsigned
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: qelectrotech-windows-msi-unsigned-${{ matrix.flavor }}
|
||||
name: qelectrotech-windows-msi-unsigned
|
||||
path: dist\*.msi
|
||||
retention-days: 1
|
||||
if-no-files-found: error
|
||||
|
||||
# Qt6 stays on the unsigned/experimental track (no signing request for
|
||||
# this flavor), and forks never have the SignPath secrets, so guard on
|
||||
# both: only qt5, and only in the upstream repo.
|
||||
# (cf. DieterMayerOSS:fix/msi-signing-fork-guard, d3f60c88)
|
||||
# ----------------------------------------------------------------
|
||||
# 9c. Submit signing request to SignPath (OSS organization)
|
||||
# Prerequisites:
|
||||
# - SIGNPATH_API_TOKEN : CI user token from the OSS org
|
||||
# - SIGNPATH_ORGANIZATION_ID : Organization ID of the OSS org
|
||||
# (visible in app.signpath.io → Settings after accepting
|
||||
# the OSS invitation)
|
||||
# The action downloads the signed MSI and places it in
|
||||
# dist/ (overwriting the unsigned one).
|
||||
# ----------------------------------------------------------------
|
||||
- name: Sign MSI via SignPath
|
||||
if: matrix.flavor == 'qt5' && github.repository == 'qelectrotech/qelectrotech-source-mirror'
|
||||
uses: signpath/github-action-submit-signing-request@v2
|
||||
with:
|
||||
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
|
||||
@@ -306,27 +312,33 @@ jobs:
|
||||
wait-for-completion: true
|
||||
output-artifact-directory: 'dist\'
|
||||
|
||||
- name: Upload signed MSI artifact
|
||||
# ----------------------------------------------------------------
|
||||
# 10. Upload the signed MSI artifact
|
||||
# ----------------------------------------------------------------
|
||||
- name: Upload MSI artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: qelectrotech-windows-msi-${{ matrix.flavor }}
|
||||
name: qelectrotech-windows-msi
|
||||
path: dist\*.msi
|
||||
retention-days: 14
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Delete old nightly .msi asset for this flavor
|
||||
# ----------------------------------------------------------------
|
||||
# 11. Delete old .msi asset then upload new MSI to nightly release
|
||||
# ----------------------------------------------------------------
|
||||
- name: Delete old nightly .msi asset
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
$pattern = if ("${{ matrix.flavor }}" -eq "qt6") { "-qt6-EXPERIMENTAL.*\\.msi$" } else { "\\.msi$" }
|
||||
$names = gh release view nightly --repo $env:REPO --json assets --jq ".assets[] | select(.name | test(`"$pattern`")) | .name"
|
||||
foreach ($name in ($names -split "`n" | Where-Object { $_ })) {
|
||||
if ("${{ matrix.flavor }}" -eq "qt5" -and $name -match "-qt6-EXPERIMENTAL") { continue }
|
||||
Write-Host "Deleting old asset: $name"
|
||||
gh release delete-asset nightly $name --repo $env:REPO --yes
|
||||
}
|
||||
shell: pwsh
|
||||
gh release view nightly --repo "$REPO" --json assets \
|
||||
--jq '.assets[] | select(.name | test("\\.msi$")) | .name' \
|
||||
| while read -r name; do
|
||||
echo "Deleting old asset: $name"
|
||||
gh release delete-asset nightly "$name" --repo "$REPO" --yes
|
||||
done
|
||||
echo "Old .msi assets deleted."
|
||||
shell: bash
|
||||
|
||||
- name: Upload MSI to nightly release
|
||||
uses: softprops/action-gh-release@v3
|
||||
@@ -337,40 +349,30 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Export MSI name for page generation
|
||||
id: export
|
||||
shell: pwsh
|
||||
run: |
|
||||
$name = "$env:MSI_NAME"
|
||||
if ("${{ matrix.flavor }}" -eq "qt6") {
|
||||
echo "msi_name_qt6=$name" >> $env:GITHUB_OUTPUT
|
||||
} else {
|
||||
echo "msi_name_qt5=$name" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 12. Summary
|
||||
# ----------------------------------------------------------------
|
||||
- name: Summary
|
||||
if: always()
|
||||
shell: pwsh
|
||||
run: |
|
||||
Write-Host "=== MSI build summary (${{ matrix.flavor }}) ==="
|
||||
Write-Host "=== MSI build summary ==="
|
||||
Write-Host "Version : ${{ steps.version.outputs.VERSION_DISPLAY }}"
|
||||
Write-Host "Experimental : ${{ matrix.experimental }}"
|
||||
Write-Host "WiX : v7.0.0"
|
||||
Write-Host "Signing : SignPath OSS"
|
||||
Write-Host "Runner : ${{ runner.os }} / ${{ runner.arch }}"
|
||||
if (Test-Path "dist\$env:MSI_NAME") {
|
||||
$size = [math]::Round((Get-Item "dist\$env:MSI_NAME").Length / 1MB, 1)
|
||||
Write-Host "MSI : $env:MSI_NAME ($size MB) ✓"
|
||||
} else {
|
||||
Write-Host "MSI : FAILED ✗"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Job 2 : Génère et déploie la page GitHub Pages une fois les DEUX MSI
|
||||
# (Qt5 + Qt6) publiés, pour que toutes les URLs soient connues.
|
||||
# ---------------------------------------------------------------------------
|
||||
deploy-pages:
|
||||
needs: build-msi
|
||||
runs-on: ubuntu-latest
|
||||
if: always() && needs.build-msi.result == 'success'
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Checkout master (for generate-page.py)
|
||||
# ----------------------------------------------------------------
|
||||
# 13. Generate and deploy the GitHub Pages download page
|
||||
# Toutes les URLs sont connues ici (exe, zip, msi).
|
||||
# ----------------------------------------------------------------
|
||||
- name: Checkout (for generate-page.py)
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
ref: master
|
||||
@@ -384,17 +386,15 @@ jobs:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
REPO="${{ github.repository }}"
|
||||
|
||||
# Fetch asset names from the nightly release (source of truth)
|
||||
ASSETS=$(gh release view nightly --repo "$REPO" --json assets --jq '.assets[].name')
|
||||
|
||||
EXE_NAME=$(echo "$ASSETS" | grep -v 'qt6' | grep '\.exe$' | head -1)
|
||||
ZIP_NAME=$(echo "$ASSETS" | grep -v 'qt6' | grep '\.zip$' | head -1)
|
||||
MSI_NAME=$(echo "$ASSETS" | grep -v 'qt6' | grep '\.msi$' | head -1 || echo "")
|
||||
|
||||
EXE_QT6_NAME=$(echo "$ASSETS" | grep 'qt6' | grep '\.exe$' | head -1 || echo "")
|
||||
ZIP_QT6_NAME=$(echo "$ASSETS" | grep 'qt6' | grep '\.zip$' | head -1 || echo "")
|
||||
MSI_QT6_NAME=$(echo "$ASSETS" | grep 'qt6' | grep '\.msi$' | head -1 || echo "")
|
||||
EXE_NAME=$(echo "$ASSETS" | grep '\.exe$' | head -1)
|
||||
ZIP_NAME=$(echo "$ASSETS" | grep '\.zip$' | head -1)
|
||||
MSI_NAME=$(echo "$ASSETS" | grep '\.msi$' | head -1 || echo "")
|
||||
|
||||
BASE="https://github.com/$REPO/releases/download/nightly"
|
||||
INSTALLER_URL="$BASE/$EXE_NAME"
|
||||
@@ -402,13 +402,6 @@ jobs:
|
||||
MSI_URL=""
|
||||
[ -n "$MSI_NAME" ] && MSI_URL="$BASE/$MSI_NAME"
|
||||
|
||||
INSTALLER_QT6_URL=""
|
||||
PORTABLE_QT6_URL=""
|
||||
MSI_QT6_URL=""
|
||||
[ -n "$EXE_QT6_NAME" ] && INSTALLER_QT6_URL="$BASE/$EXE_QT6_NAME"
|
||||
[ -n "$ZIP_QT6_NAME" ] && PORTABLE_QT6_URL="$BASE/$ZIP_QT6_NAME"
|
||||
[ -n "$MSI_QT6_NAME" ] && MSI_QT6_URL="$BASE/$MSI_QT6_NAME"
|
||||
|
||||
SHA="${{ github.event.workflow_run.head_sha || github.sha }}"
|
||||
SHORT="${SHA:0:7}"
|
||||
DATE=$(date -u '+%Y-%m-%d %H:%M UTC')
|
||||
@@ -417,7 +410,6 @@ jobs:
|
||||
|
||||
export DATE SHORT REPO SHA RUN_URL RUN_NUMBER
|
||||
export INSTALLER_URL PORTABLE_URL MSI_URL
|
||||
export INSTALLER_QT6_URL PORTABLE_QT6_URL MSI_QT6_URL
|
||||
|
||||
python3 source/build-aux/generate-page.py
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
[submodule "pugixml"]
|
||||
path = pugixml
|
||||
url = https://github.com/zeux/pugixml.git
|
||||
[submodule "SingleApplication"]
|
||||
path = SingleApplication
|
||||
url = https://github.com/itay-grudev/SingleApplication.git
|
||||
[submodule "elements"]
|
||||
path = elements
|
||||
url = https://github.com/qelectrotech/qelectrotech-elements.git
|
||||
|
||||
@@ -14,50 +14,25 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include(cmake/hoto_update_cmake_message.cmake)
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...4.2)
|
||||
|
||||
project(qelectrotech
|
||||
VERSION 0.100.1
|
||||
DESCRIPTION "QET is a CAD/CAE editor focusing on schematics drawing features."
|
||||
HOMEPAGE_URL "https://qelectrotech.org/"
|
||||
LANGUAGES C CXX)
|
||||
LANGUAGES CXX)
|
||||
|
||||
include(cmake/copyright_message.cmake)
|
||||
|
||||
set(QET_DIR ${PROJECT_SOURCE_DIR})
|
||||
include(cmake/qet_compilation_vars.cmake)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS ${QET_COMPONENTS})
|
||||
qt_standard_project_setup()
|
||||
|
||||
# QT_VERSION_MAJOR is chosen explicitly by whoever configures the build,
|
||||
# via -DQT_VERSION_MAJOR=5 or -DQT_VERSION_MAJOR=6.
|
||||
# Default to Qt5 (current stable) when not specified, so existing
|
||||
# CI/scripts that don't pass this option keep working unchanged.
|
||||
# This must happen BEFORE add_subdirectory(tests) and the fetch_*.cmake
|
||||
# includes below, so every subdirectory and every FetchContent dependency
|
||||
# sees a consistent, already-defined value.
|
||||
if(NOT DEFINED QT_VERSION_MAJOR)
|
||||
set(QT_VERSION_MAJOR 6)
|
||||
endif()
|
||||
|
||||
# Some third-party CMake projects we pull in via FetchContent (e.g.
|
||||
# SingleApplication) don't know about QET_VERSION_MAJOR: they follow Qt's
|
||||
# own "QT_DEFAULT_MAJOR_VERSION" convention instead, and silently default
|
||||
# to Qt5 if it isn't set. Propagate our choice so they stay in sync,
|
||||
# otherwise they can end up linked against a different Qt major version
|
||||
# than the rest of QET, which breaks AUTOMOC with an
|
||||
# INTERFACE_QT_MAJOR_VERSION mismatch at generate time.
|
||||
set(QT_DEFAULT_MAJOR_VERSION ${QT_VERSION_MAJOR} CACHE STRING "Qt version to use (5 or 6)" FORCE)
|
||||
|
||||
# Add sub directories
|
||||
option(PACKAGE_TESTS "Build the tests" NO)
|
||||
option(PACKAGE_TESTS "Build the tests" ON)
|
||||
if(PACKAGE_TESTS)
|
||||
message("Add sub directory tests")
|
||||
add_subdirectory(tests)
|
||||
message("Add sub directory tests")
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
include(cmake/paths_compilation_installation.cmake)
|
||||
@@ -68,130 +43,121 @@ include(cmake/git_last_commit_sha.cmake)
|
||||
include(cmake/fetch_kdeaddons.cmake)
|
||||
include(cmake/fetch_singleapplication.cmake)
|
||||
include(cmake/fetch_pugixml.cmake)
|
||||
include(cmake/qet_compilation_vars.cmake)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
SET(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(
|
||||
QT
|
||||
NAMES
|
||||
Qt5
|
||||
COMPONENTS
|
||||
${QET_COMPONENTS}
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
find_package(
|
||||
Qt${QT_VERSION_MAJOR}
|
||||
COMPONENTS
|
||||
${QET_COMPONENTS}
|
||||
REQUIRED)
|
||||
|
||||
# Qt6 only creates the Qt::GuiPrivate target (used for QPdfEngine::drawHyperlink)
|
||||
# when the GuiPrivate component is explicitly requested. Qt5 has no such
|
||||
# component package and creates the target implicitly with Gui, so only
|
||||
# request it on Qt6 - requesting it on Qt5 fails the whole configure.
|
||||
if(QT_VERSION_MAJOR GREATER_EQUAL 5)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS GuiPrivate)
|
||||
endif()
|
||||
|
||||
find_package(SQLite3 REQUIRED)
|
||||
|
||||
# CMake < 4.3 only creates the SQLite::SQLite3 target (no SQLite3::SQLite3
|
||||
# alias yet), while CMake >= 4.3's bundled FindSQLite3 creates SQLite3::SQLite3
|
||||
# and deprecates the old name. Add the missing alias ourselves so we can use
|
||||
# the modern target name everywhere regardless of the CMake version in use
|
||||
# (this project must keep building on CMake versions below 4.3, e.g. on most
|
||||
# current Linux distros).
|
||||
if(NOT TARGET SQLite3::SQLite3 AND TARGET SQLite::SQLite3)
|
||||
add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3)
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui)
|
||||
|
||||
# The default build only compiles the tracked .ts files to .qm (lrelease).
|
||||
# Refreshing the .ts from the sources (lupdate) is a developer action behind
|
||||
# the explicit "update_translations" target below: running lupdate on every
|
||||
# build rewrote tracked files as a side effect, and under high parallelism
|
||||
# lupdate rewriting a .ts while lrelease read the same file made the build
|
||||
# fail with "Premature end of document".
|
||||
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
||||
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang")
|
||||
#if(QT_VERSION_MAJOR EQUAL 6)
|
||||
# qt6_add_translation(QM_FILES ${TS_FILES})
|
||||
#else()
|
||||
# qt5_add_translation(QM_FILES ${TS_FILES})
|
||||
#endif()
|
||||
|
||||
add_custom_target(update_translations
|
||||
COMMAND $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::lupdate> ${CMAKE_SOURCE_DIR}/sources -ts ${TS_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Updating .ts files from sources/ (lupdate) - developer target, run explicitly"
|
||||
VERBATIM
|
||||
)
|
||||
qt5_add_translation(QM_FILES ${TS_FILES})
|
||||
|
||||
# als laatse
|
||||
include(cmake/define_definitions.cmake)
|
||||
|
||||
qt_add_executable(
|
||||
${PROJECT_NAME}
|
||||
${QET_RES_FILES}
|
||||
${QET_SRC_FILES}
|
||||
${QM_FILES}
|
||||
${QET_DIR}/qelectrotech.qrc
|
||||
)
|
||||
|
||||
if(QMFILES_AS_RESOURCE)
|
||||
qt_add_translations(${PROJECT_NAME} TS_FILES ${TS_FILES} RESOURCE_PREFIX "/lang")
|
||||
# On Windows, WIN32 sets /SUBSYSTEM:WINDOWS to suppress the console window.
|
||||
# Qt automatically links qtmain.lib which provides the WinMain entry point,
|
||||
# so no source code change is needed.
|
||||
if(WIN32)
|
||||
add_executable(
|
||||
${PROJECT_NAME}
|
||||
WIN32
|
||||
${QET_RES_FILES}
|
||||
${QET_SRC_FILES}
|
||||
${QM_FILES}
|
||||
${QET_DIR}/qelectrotech.qrc
|
||||
)
|
||||
else()
|
||||
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
||||
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang")
|
||||
qt_add_translation(QM_FILES ${TS_FILES})
|
||||
add_executable(
|
||||
${PROJECT_NAME}
|
||||
${QET_RES_FILES}
|
||||
${QET_SRC_FILES}
|
||||
${QM_FILES}
|
||||
${QET_DIR}/qelectrotech.qrc
|
||||
)
|
||||
endif()
|
||||
|
||||
find_package(SQLite3 REQUIRED)
|
||||
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
pugixml::pugixml
|
||||
SingleApplication::SingleApplication
|
||||
SQLite::SQLite3
|
||||
${KF6_PRIVATE_LIBRARIES}
|
||||
${QET_PRIVATE_LIBRARIES}
|
||||
)
|
||||
${PROJECT_NAME}
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
pugixml::pugixml
|
||||
SingleApplication::SingleApplication
|
||||
SQLite::SQLite3
|
||||
${KF5_PRIVATE_LIBRARIES}
|
||||
${QET_PRIVATE_LIBRARIES}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${QET_DIR}/sources/titleblock
|
||||
${QET_DIR}/sources/ui
|
||||
${QET_DIR}/sources/qetgraphicsitem
|
||||
${QET_DIR}/sources/qetgraphicsitem/ViewItem
|
||||
${QET_DIR}/sources/qetgraphicsitem/ViewItem/ui
|
||||
${QET_DIR}/sources/richtext
|
||||
${QET_DIR}/sources/factory
|
||||
${QET_DIR}/sources/properties
|
||||
${QET_DIR}/sources/dvevent
|
||||
${QET_DIR}/sources/editor
|
||||
${QET_DIR}/sources/editor/esevent
|
||||
${QET_DIR}/sources/editor/graphicspart
|
||||
${QET_DIR}/sources/editor/ui
|
||||
${QET_DIR}/sources/editor/UndoCommand
|
||||
${QET_DIR}/sources/undocommand
|
||||
${QET_DIR}/sources/diagramevent
|
||||
${QET_DIR}/sources/ElementsCollection
|
||||
${QET_DIR}/sources/ElementsCollection/ui
|
||||
${QET_DIR}/sources/autoNum
|
||||
${QET_DIR}/sources/autoNum/ui
|
||||
${QET_DIR}/sources/ui/configpage
|
||||
${QET_DIR}/sources/SearchAndReplace
|
||||
${QET_DIR}/sources/SearchAndReplace/ui
|
||||
${QET_DIR}/sources/NameList
|
||||
${QET_DIR}/sources/NameList/ui
|
||||
${QET_DIR}/sources/utils
|
||||
${QET_DIR}/sources/dataBase
|
||||
${QET_DIR}/sources/dataBase/ui
|
||||
${QET_DIR}/sources/factory/ui
|
||||
${QET_DIR}/sources/print
|
||||
${QET_DIR}/sources/svg
|
||||
)
|
||||
${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${QET_DIR}/sources/titleblock
|
||||
${QET_DIR}/sources/ui
|
||||
${QET_DIR}/sources/qetgraphicsitem
|
||||
${QET_DIR}/sources/qetgraphicsitem/ViewItem
|
||||
${QET_DIR}/sources/qetgraphicsitem/ViewItem/ui
|
||||
${QET_DIR}/sources/richtext
|
||||
${QET_DIR}/sources/factory
|
||||
${QET_DIR}/sources/properties
|
||||
${QET_DIR}/sources/dvevent
|
||||
${QET_DIR}/sources/editor
|
||||
${QET_DIR}/sources/editor/esevent
|
||||
${QET_DIR}/sources/editor/graphicspart
|
||||
${QET_DIR}/sources/editor/ui
|
||||
${QET_DIR}/sources/editor/UndoCommand
|
||||
${QET_DIR}/sources/undocommand
|
||||
${QET_DIR}/sources/diagramevent
|
||||
${QET_DIR}/sources/ElementsCollection
|
||||
${QET_DIR}/sources/ElementsCollection/ui
|
||||
${QET_DIR}/sources/autoNum
|
||||
${QET_DIR}/sources/autoNum/ui
|
||||
${QET_DIR}/sources/ui/configpage
|
||||
${QET_DIR}/sources/SearchAndReplace
|
||||
${QET_DIR}/sources/SearchAndReplace/ui
|
||||
${QET_DIR}/sources/NameList
|
||||
${QET_DIR}/sources/NameList/ui
|
||||
${QET_DIR}/sources/utils
|
||||
${QET_DIR}/pugixml/src
|
||||
${QET_DIR}/sources/dataBase
|
||||
${QET_DIR}/sources/dataBase/ui
|
||||
${QET_DIR}/sources/factory/ui
|
||||
${QET_DIR}/sources/print
|
||||
${QET_DIR}/sources/svg
|
||||
)
|
||||
|
||||
if(NOT BUILD_WITH_KF5)
|
||||
target_include_directories(
|
||||
${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${QET_DIR}/sources/ui/nokde
|
||||
)
|
||||
endif()
|
||||
|
||||
install(TARGETS ${PROJECT_NAME})
|
||||
|
||||
if (NOT MINGW)
|
||||
install(DIRECTORY ico/breeze-icons/16x16 DESTINATION ${QET_ICONS_PATH})
|
||||
install(DIRECTORY ico/breeze-icons/22x22 DESTINATION ${QET_ICONS_PATH})
|
||||
|
||||
@@ -1,18 +1,3 @@
|
||||
[Qt6 / CMake]
|
||||
Building the Qt6 line with CMake additionally requires the private
|
||||
development headers of QtGui. On Debian/Ubuntu these live in a separate
|
||||
package that is NOT pulled in by qt6-base-dev:
|
||||
|
||||
apt install qt6-base-private-dev
|
||||
|
||||
(other distributions: install your Qt 6 "private headers" development
|
||||
package, e.g. qt6-qtbase-private-devel on Fedora)
|
||||
|
||||
QET needs the private QtGui API (QPdfEngine) for clickable hyperlinks in
|
||||
the PDF export. Without the package, find_package(Qt6 ... GuiPrivate)
|
||||
succeeds but CMake later fails at generate time with:
|
||||
"Imported target Qt6::GuiPrivate includes non-existent path".
|
||||
|
||||
[ca]
|
||||
Dependències:
|
||||
libQt5 (paquets libqt5*)
|
||||
|
||||
@@ -59,9 +59,6 @@ Here are the technical choices made for the software development:
|
||||
|
||||
If you wish to be informed of the latest developments, browse the [archive](https://listengine.tuxfamily.org/lists.tuxfamily.org/qet/) of the project mailing list where all commits (changes) are registered. This archive is publicly available, you don't need any account to access it.
|
||||
|
||||
### Build QElectroTech under Windows
|
||||
To build QElectroTech under microsoft Windows, please follow [these instructions (french)](md/fr/fr_window_build_summary.md)
|
||||
|
||||
|
||||
# Features
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
generate-page.py — Generates gh-pages/index.html for QElectroTech nightly builds.
|
||||
Called from windows-msi.yml deploy-pages job.
|
||||
Called from windows-build.yml deploy-pages job.
|
||||
Environment variables required:
|
||||
DATE, SHORT, REPO, SHA, RUN_URL, RUN_NUMBER,
|
||||
INSTALLER_URL, PORTABLE_URL, MSI_URL (optional)
|
||||
Optional (Qt6 experimental track — omitted entirely if empty):
|
||||
INSTALLER_QT6_URL, PORTABLE_QT6_URL, MSI_QT6_URL
|
||||
"""
|
||||
import os
|
||||
|
||||
@@ -20,10 +18,6 @@ installer_url = os.environ.get("INSTALLER_URL", "")
|
||||
portable_url = os.environ.get("PORTABLE_URL", "")
|
||||
msi_url = os.environ.get("MSI_URL", "")
|
||||
|
||||
installer_qt6_url = os.environ.get("INSTALLER_QT6_URL", "")
|
||||
portable_qt6_url = os.environ.get("PORTABLE_QT6_URL", "")
|
||||
msi_qt6_url = os.environ.get("MSI_QT6_URL", "")
|
||||
|
||||
msi_block = ""
|
||||
if msi_url:
|
||||
msi_block = f"""
|
||||
@@ -32,46 +26,6 @@ if msi_url:
|
||||
<span class="btn-text">Windows Installer .msi<small>.msi — for enterprise / GPO deployment</small></span>
|
||||
</a>"""
|
||||
|
||||
# Qt6 experimental section — only rendered if at least one Qt6 asset exists.
|
||||
qt6_block = ""
|
||||
if installer_qt6_url or portable_qt6_url or msi_qt6_url:
|
||||
qt6_msi_btn = ""
|
||||
if msi_qt6_url:
|
||||
qt6_msi_btn = f"""
|
||||
<a class="btn btn-msi" href="{msi_qt6_url}">
|
||||
<span class="btn-icon">⬇</span>
|
||||
<span class="btn-text">Windows Installer .msi (Qt6)<small>.msi — experimental, for enterprise / GPO deployment</small></span>
|
||||
</a>"""
|
||||
qt6_installer_btn = ""
|
||||
if installer_qt6_url:
|
||||
qt6_installer_btn = f"""
|
||||
<a class="btn btn-primary" href="{installer_qt6_url}">
|
||||
<span class="btn-icon">⬇</span>
|
||||
<span class="btn-text">Windows Installer (Qt6)<small>.exe — experimental, includes all dependencies</small></span>
|
||||
</a>"""
|
||||
qt6_portable_btn = ""
|
||||
if portable_qt6_url:
|
||||
qt6_portable_btn = f"""
|
||||
<a class="btn btn-secondary" href="{portable_qt6_url}">
|
||||
<span class="btn-icon">📦</span>
|
||||
<span class="btn-text">Windows Portable (Qt6)<small>.zip — experimental, no installation required</small></span>
|
||||
</a>"""
|
||||
|
||||
qt6_block = f"""
|
||||
<div class="card">
|
||||
<h2>🧪 Windows — x86_64 — Qt6 track</h2>
|
||||
<div class="warning">
|
||||
⚠️ <strong>Experimental.</strong> These Qt6-based installer, portable and MSI
|
||||
builds are new and not as thoroughly tested as the Qt5 track above. Expect rough
|
||||
edges; please report issues and mention "Qt6" explicitly.
|
||||
</div>
|
||||
<div class="downloads">
|
||||
{qt6_installer_btn}
|
||||
{qt6_msi_btn}
|
||||
{qt6_portable_btn}
|
||||
</div>
|
||||
</div>"""
|
||||
|
||||
html = f"""<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -126,7 +80,7 @@ For production use, download a <a href="https://github.com/{repo}/releases">stab
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>🏹 Windows — x86_64 — Qt5 track</h2>
|
||||
<h2>🏹 Windows — x86_64</h2>
|
||||
<div class="downloads">
|
||||
<a class="btn btn-primary" href="{installer_url}">
|
||||
<span class="btn-icon">⬇</span>
|
||||
@@ -143,7 +97,6 @@ For production use, download a <a href="https://github.com/{repo}/releases">stab
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{qt6_block}
|
||||
</main>
|
||||
<footer>
|
||||
Auto-generated by GitHub Actions ·
|
||||
|
||||
@@ -10,5 +10,5 @@ rem "C:/Users/<USER>/AppData/Local/QElectroTech/QElectroTech"
|
||||
rem Sans l'option --data-dir, les données utilisateur (elements, titleblocks,
|
||||
rem log, ...) de QElectroTech sont stockées dans
|
||||
rem "C:/Users/<USER>/AppData/Roaming/QElectroTech/QElectroTech"
|
||||
set command=bin\qelectrotech.exe --common-elements-dir=elements/ --common-tbt-dir=titleblocks/ --lang-dir=lang/ -platform windows:fontengine=freetype %*
|
||||
set command=bin\qelectrotech.exe --common-elements-dir=elements/ --common-tbt-dir=titleblocks/ --lang-dir=lang/ -style windowsvista %*
|
||||
@start %command%
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
-->
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
|
||||
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
|
||||
<?ifndef QtPlatformArgs ?>
|
||||
<?define QtPlatformArgs="" ?>
|
||||
<?endif?>
|
||||
|
||||
<Package
|
||||
Name="QElectroTech"
|
||||
@@ -61,7 +58,7 @@
|
||||
Directory="DesktopFolder"
|
||||
Name="QElectroTech"
|
||||
Target="[INSTALLDIR]bin\qelectrotech.exe"
|
||||
Arguments="--common-elements-dir="[INSTALLDIR]elements/" --common-tbt-dir="[INSTALLDIR]titleblocks/" --lang-dir="[INSTALLDIR]lang/" $(var.QtPlatformArgs)"
|
||||
Arguments="--common-elements-dir="[INSTALLDIR]elements/" --common-tbt-dir="[INSTALLDIR]titleblocks/" --lang-dir="[INSTALLDIR]lang/" -style windowsvista"
|
||||
Icon="qet.ico"
|
||||
WorkingDirectory="INSTALLDIR" />
|
||||
<RegistryValue Root="HKCU"
|
||||
@@ -76,7 +73,7 @@
|
||||
Directory="ProgramMenuFolder"
|
||||
Name="QElectroTech"
|
||||
Target="[INSTALLDIR]bin\qelectrotech.exe"
|
||||
Arguments="--common-elements-dir="[INSTALLDIR]elements/" --common-tbt-dir="[INSTALLDIR]titleblocks/" --lang-dir="[INSTALLDIR]lang/" $(var.QtPlatformArgs)"
|
||||
Arguments="--common-elements-dir="[INSTALLDIR]elements/" --common-tbt-dir="[INSTALLDIR]titleblocks/" --lang-dir="[INSTALLDIR]lang/" -style windowsvista"
|
||||
Icon="qet.ico"
|
||||
WorkingDirectory="INSTALLDIR" />
|
||||
<RegistryValue Root="HKCU"
|
||||
@@ -97,13 +94,8 @@
|
||||
<RegistryValue Root="HKCR" Key="QElectroTech.Document" Type="string" Value="QElectroTech Project" />
|
||||
<RegistryValue Root="HKCR" Key="QElectroTech.Document\DefaultIcon" Type="string"
|
||||
Value="[INSTALLDIR]ico\qelectrotech.ico" />
|
||||
<!-- Pass the same arguments as the shortcuts above: opening a .qet from
|
||||
Explorer sets the working directory to the document's folder, so a
|
||||
bare command line leaves QET unable to locate its data. Without the
|
||||
lang-dir argument the UI falls back to the source language, which
|
||||
is French. See issue #554. -->
|
||||
<RegistryValue Root="HKCR" Key="QElectroTech.Document\shell\open\command" Type="string"
|
||||
Value=""[INSTALLDIR]bin\qelectrotech.exe" --common-elements-dir="[INSTALLDIR]elements/" --common-tbt-dir="[INSTALLDIR]titleblocks/" --lang-dir="[INSTALLDIR]lang/" $(var.QtPlatformArgs) "%1"" />
|
||||
Value=""[INSTALLDIR]bin\qelectrotech.exe" "%1"" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
|
||||
@@ -62,15 +62,10 @@ message("PROJECT_SOURCE_DIR :" ${PROJECT_SOURCE_DIR})
|
||||
message("QET_DIR :" ${QET_DIR})
|
||||
message("GIT_COMMIT_SHA :" ${GIT_COMMIT_SHA})
|
||||
|
||||
if(BUILD_WITH_KF6 AND BUILD_KF6)
|
||||
message("KF6_GIT_TAG :" ${KF6_GIT_TAG})
|
||||
endif()
|
||||
if(NOT BUILD_WITH_KF6)
|
||||
add_definitions(-DBUILD_WITHOUT_KF6)
|
||||
if(BUILD_WITH_KF5)
|
||||
message("KF5_GIT_TAG :" ${KF5_GIT_TAG})
|
||||
else()
|
||||
add_definitions(-DBUILD_WITHOUT_KF5)
|
||||
endif()
|
||||
message("QET_COMPONENTS :" ${QET_COMPONENTS})
|
||||
message("Qt version :" ${Qt6_VERSION})
|
||||
|
||||
if(QMFILES_AS_RESOURCE)
|
||||
add_definitions(-DQMFILES_AS_RESOURCE)
|
||||
endif()
|
||||
message("QT_VERSION_MAJOR :" ${QT_VERSION_MAJOR})
|
||||
|
||||
@@ -31,8 +31,5 @@ add_definitions(-DQT_MESSAGELOGCONTEXT)
|
||||
# In order to do so, uncomment the following line.
|
||||
#add_definitions(-DTODO_LIST)
|
||||
|
||||
# Build with KF6
|
||||
option(BUILD_WITH_KF6 "Build with KF6" ON)
|
||||
|
||||
# Use translations as a Qt resource
|
||||
option(QMFILES_AS_RESOURCE "Use .qm files as Qt resource" ON)
|
||||
# Build with KF5
|
||||
option(BUILD_WITH_KF5 "Build with KF5" ON)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2006-2026 The QElectroTech Team
|
||||
# Copyright 2006 The QElectroTech Team
|
||||
# This file is part of QElectroTech.
|
||||
#
|
||||
# QElectroTech is free software: you can redistribute it and/or modify
|
||||
@@ -14,42 +14,54 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
option(BUILD_KF6 "Build KF6 libraries, use system ones otherwise" OFF)
|
||||
if(BUILD_KF6)
|
||||
block(PROPAGATE KF6_GIT_TAG)
|
||||
message(STATUS " - fetch_kdeaddons")
|
||||
set(KDE_SKIP_TEST_SETTINGS ON)
|
||||
set(KCOREADDONS_USE_QML OFF)
|
||||
set(KWIDGETSADDONS_USE_QML OFF)
|
||||
set(BUILD_TESTING OFF)
|
||||
set(BUILD_DESIGNERPLUGIN OFF)
|
||||
set(BUILD_QCH OFF)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
message(" - fetch_kdeaddons")
|
||||
|
||||
Include(FetchContent)
|
||||
if(BUILD_WITH_KF5)
|
||||
Include(FetchContent)
|
||||
|
||||
if(NOT DEFINED KF6_GIT_TAG)
|
||||
set(KF6_GIT_TAG v6.22.0)
|
||||
option(BUILD_KF5 "Build KF5 libraries, use system ones otherwise" YES)
|
||||
|
||||
if(BUILD_KF5)
|
||||
|
||||
if(NOT DEFINED KF5_GIT_TAG)
|
||||
#https://qelectrotech.org/forum/viewtopic.php?pid=13924#p13924
|
||||
set(KF5_GIT_TAG v5.77.0)
|
||||
endif()
|
||||
|
||||
# Fix stop the run autotests of kcoreaddons
|
||||
# see
|
||||
# https://invent.kde.org/frameworks/kcoreaddons/-/blob/master/CMakeLists.txt#L98
|
||||
# issue:
|
||||
# CMake Error at /usr/share/ECM/modules/ECMAddTests.cmake:89 (add_executable):
|
||||
# Cannot find source file:
|
||||
# see
|
||||
# https://qelectrotech.org/forum/viewtopic.php?pid=13929#p13929
|
||||
set(KDE_SKIP_TEST_SETTINGS "TRUE")
|
||||
set(BUILD_TESTING "0")
|
||||
FetchContent_Declare(
|
||||
ecm
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/extra-cmake-modules.git
|
||||
GIT_TAG ${KF5_GIT_TAG})
|
||||
FetchContent_MakeAvailable(ecm)
|
||||
|
||||
FetchContent_Declare(
|
||||
kcoreaddons
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git
|
||||
GIT_TAG ${KF6_GIT_TAG})
|
||||
GIT_TAG ${KF5_GIT_TAG})
|
||||
FetchContent_MakeAvailable(kcoreaddons)
|
||||
|
||||
FetchContent_Declare(
|
||||
kwidgetsaddons
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git
|
||||
GIT_TAG ${KF6_GIT_TAG})
|
||||
GIT_TAG ${KF5_GIT_TAG})
|
||||
FetchContent_MakeAvailable(kwidgetsaddons)
|
||||
endblock()
|
||||
else()
|
||||
find_package(KF6CoreAddons REQUIRED)
|
||||
find_package(KF6WidgetsAddons REQUIRED)
|
||||
endif()
|
||||
else()
|
||||
find_package(KF5CoreAddons REQUIRED)
|
||||
find_package(KF5WidgetsAddons REQUIRED)
|
||||
endif()
|
||||
|
||||
set(KF6_PRIVATE_LIBRARIES
|
||||
KF6::CoreAddons
|
||||
KF6::WidgetsAddons
|
||||
)
|
||||
set(KF5_PRIVATE_LIBRARIES
|
||||
KF5::WidgetsAddons
|
||||
KF5::CoreAddons
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2006-2026 The QElectroTech Team
|
||||
# Copyright 2006 The QElectroTech Team
|
||||
# This file is part of QElectroTech.
|
||||
#
|
||||
# QElectroTech is free software: you can redistribute it and/or modify
|
||||
@@ -14,10 +14,14 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
option(BUILD_PUGIXML "Build pugixml library, use system one otherwise" OFF)
|
||||
message(" - fetch_pugixml")
|
||||
|
||||
Include(FetchContent)
|
||||
|
||||
option(BUILD_PUGIXML "Build pugixml library, use system one otherwise" YES)
|
||||
|
||||
if(BUILD_PUGIXML)
|
||||
Include(FetchContent)
|
||||
message(" - fetch pugixml")
|
||||
|
||||
FetchContent_Declare(
|
||||
pugixml
|
||||
GIT_REPOSITORY https://github.com/zeux/pugixml.git
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2006-2026 The QElectroTech Team
|
||||
# Copyright 2006 The QElectroTech Team
|
||||
# This file is part of QElectroTech.
|
||||
#
|
||||
# QElectroTech is free software: you can redistribute it and/or modify
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
message(" - fetch_singleapplication")
|
||||
|
||||
# https://github.com/itay-grudev/SingleApplication/issues/18
|
||||
#qmake
|
||||
#DEFINES += QAPPLICATION_CLASS=QGuiApplication
|
||||
set(QAPPLICATION_CLASS QApplication)
|
||||
|
||||
Include(FetchContent)
|
||||
@@ -23,6 +26,6 @@ Include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
SingleApplication
|
||||
GIT_REPOSITORY https://github.com/itay-grudev/SingleApplication.git
|
||||
GIT_TAG v3.5.4)
|
||||
GIT_TAG v3.2.0)
|
||||
|
||||
FetchContent_MakeAvailable(SingleApplication)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# Copyright 2006 The QElectroTech Team
|
||||
# This file is part of QElectroTech.
|
||||
#
|
||||
# QElectroTech is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# QElectroTech is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.14)
|
||||
message(
|
||||
"_____________________________________________________________________")
|
||||
message("to update Cmake on linux:")
|
||||
message("https://github.com/Kitware/CMake/")
|
||||
message("linux => cmake-3.19.1-Linux-x86_64.sh")
|
||||
message(" sudo ./cmake.sh --prefix=/usr/local/ --exclude-subdir")
|
||||
message("windows good luck :)")
|
||||
endif()
|
||||
@@ -58,10 +58,7 @@ if(WIN32)
|
||||
set(QET_BINARY_PATH "./")
|
||||
set(QET_COMMON_COLLECTION_PATH "elements/")
|
||||
set(QET_COMMON_TBT_PATH "titleblocks/")
|
||||
# "lang/" and not "l10n/": that is where every Windows packaging actually
|
||||
# puts the .qm files (see build-aux/windows/QElectroTech.wxs and the
|
||||
# windows-build workflow), and what the shortcuts pass as --lang-dir.
|
||||
set(QET_LANG_PATH "lang/")
|
||||
set(QET_LANG_PATH "l10n/")
|
||||
set(QET_LICENSE_PATH "./")
|
||||
# Liste des ressources Windows
|
||||
#RC_FILE = qelectrotech.rc
|
||||
|
||||
@@ -16,16 +16,7 @@
|
||||
|
||||
message(" - qet_compilation_vars")
|
||||
|
||||
# Note: GuiPrivate is intentionally NOT in this list. Qt6's CMake config only
|
||||
# creates the Qt::GuiPrivate target when "GuiPrivate" is explicitly requested
|
||||
# as a component, but Qt5 has no Qt5GuiPrivate package at all (the target is
|
||||
# created implicitly with Gui), so requesting it as a component breaks the
|
||||
# whole Qt5 configure. It is requested separately, guarded by
|
||||
# QT_VERSION_MAJOR, after the main find_package.
|
||||
# (Needed for QPdfEngine::drawHyperlink, the PDF internal links.)
|
||||
set(QET_COMPONENTS
|
||||
Core
|
||||
Gui
|
||||
LinguistTools
|
||||
PrintSupport
|
||||
Xml
|
||||
@@ -120,44 +111,10 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/cli_export.h
|
||||
${QET_DIR}/sources/pdf_links.cpp
|
||||
${QET_DIR}/sources/pdf_links.h
|
||||
${QET_DIR}/sources/import/edz/edzarchive.cpp
|
||||
${QET_DIR}/sources/import/edz/edzarchive.h
|
||||
${QET_DIR}/sources/import/edz/edzpart.cpp
|
||||
${QET_DIR}/sources/import/edz/edzpart.h
|
||||
${QET_DIR}/sources/import/edz/edzelementbuilder.cpp
|
||||
${QET_DIR}/sources/import/edz/edzelementbuilder.h
|
||||
${QET_DIR}/sources/import/edz/edzimporter.cpp
|
||||
${QET_DIR}/sources/import/edz/edzimporter.h
|
||||
${QET_DIR}/sources/import/edz/edzsevenzip.cpp
|
||||
${QET_DIR}/sources/import/edz/edzsevenzip.h
|
||||
${QET_DIR}/sources/import/edz/lzma/7zAlloc.c
|
||||
${QET_DIR}/sources/import/edz/lzma/7zArcIn.c
|
||||
${QET_DIR}/sources/import/edz/lzma/7zBuf.c
|
||||
${QET_DIR}/sources/import/edz/lzma/7zCrc.c
|
||||
${QET_DIR}/sources/import/edz/lzma/7zCrcOpt.c
|
||||
${QET_DIR}/sources/import/edz/lzma/7zDec.c
|
||||
${QET_DIR}/sources/import/edz/lzma/7zFile.c
|
||||
${QET_DIR}/sources/import/edz/lzma/7zStream.c
|
||||
${QET_DIR}/sources/import/edz/lzma/Bcj2.c
|
||||
${QET_DIR}/sources/import/edz/lzma/Bra.c
|
||||
${QET_DIR}/sources/import/edz/lzma/Bra86.c
|
||||
${QET_DIR}/sources/import/edz/lzma/BraIA64.c
|
||||
${QET_DIR}/sources/import/edz/lzma/CpuArch.c
|
||||
${QET_DIR}/sources/import/edz/lzma/Delta.c
|
||||
${QET_DIR}/sources/import/edz/lzma/Lzma2Dec.c
|
||||
${QET_DIR}/sources/import/edz/lzma/LzmaDec.c
|
||||
${QET_DIR}/sources/import/edz/lzma/Ppmd7.c
|
||||
${QET_DIR}/sources/import/edz/lzma/Ppmd7Dec.c
|
||||
${QET_DIR}/sources/borderproperties.cpp
|
||||
${QET_DIR}/sources/borderproperties.h
|
||||
${QET_DIR}/sources/bordertitleblock.cpp
|
||||
${QET_DIR}/sources/bordertitleblock.h
|
||||
# ${QET_DIR}/sources/colorbutton.cpp
|
||||
# ${QET_DIR}/sources/colorbutton.h
|
||||
# ${QET_DIR}/sources/colorcombobox.cpp
|
||||
# ${QET_DIR}/sources/colorcombobox.h
|
||||
# ${QET_DIR}/sources/colorcomboboxdelegate.cpp
|
||||
# ${QET_DIR}/sources/colorcomboboxdelegate.h
|
||||
${QET_DIR}/sources/conductorautonumerotation.cpp
|
||||
${QET_DIR}/sources/conductorautonumerotation.h
|
||||
${QET_DIR}/sources/conductornumexport.cpp
|
||||
@@ -367,8 +324,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/editor/graphicspart/partpolygon.h
|
||||
${QET_DIR}/sources/editor/graphicspart/partrectangle.cpp
|
||||
${QET_DIR}/sources/editor/graphicspart/partrectangle.h
|
||||
${QET_DIR}/sources/editor/graphicspart/partplctable.cpp
|
||||
${QET_DIR}/sources/editor/graphicspart/partplctable.h
|
||||
${QET_DIR}/sources/editor/graphicspart/partterminal.cpp
|
||||
${QET_DIR}/sources/editor/graphicspart/partterminal.h
|
||||
${QET_DIR}/sources/editor/graphicspart/parttext.cpp
|
||||
@@ -448,8 +403,6 @@ set(QET_SRC_FILES
|
||||
|
||||
${QET_DIR}/sources/project/projectpropertieshandler.cpp
|
||||
${QET_DIR}/sources/project/projectpropertieshandler.h
|
||||
${QET_DIR}/sources/project/projectusagetracker.cpp
|
||||
${QET_DIR}/sources/project/projectusagetracker.h
|
||||
|
||||
${QET_DIR}/sources/properties/elementdata.cpp
|
||||
${QET_DIR}/sources/properties/elementdata.h
|
||||
@@ -470,6 +423,10 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/PropertiesEditor/propertieseditorwidget.cpp
|
||||
${QET_DIR}/sources/PropertiesEditor/propertieseditorwidget.h
|
||||
|
||||
${QET_DIR}/pugixml/src/pugiconfig.hpp
|
||||
${QET_DIR}/pugixml/src/pugixml.cpp
|
||||
${QET_DIR}/pugixml/src/pugixml.hpp
|
||||
|
||||
${QET_DIR}/sources/qetgraphicsitem/conductor.cpp
|
||||
${QET_DIR}/sources/qetgraphicsitem/conductor.h
|
||||
${QET_DIR}/sources/qetgraphicsitem/conductortextitem.cpp
|
||||
@@ -550,9 +507,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/svg/qetsvg.cpp
|
||||
${QET_DIR}/sources/svg/qetsvg.h
|
||||
|
||||
${QET_DIR}/sources/svg/qetsvg.cpp
|
||||
${QET_DIR}/sources/svg/qetsvg.h
|
||||
|
||||
${QET_DIR}/sources/titleblock/dimension.cpp
|
||||
${QET_DIR}/sources/titleblock/dimension.h
|
||||
${QET_DIR}/sources/titleblock/dimensionwidget.cpp
|
||||
@@ -662,8 +616,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/ui/borderpropertieswidget.h
|
||||
${QET_DIR}/sources/ui/compositetexteditdialog.cpp
|
||||
${QET_DIR}/sources/ui/compositetexteditdialog.h
|
||||
${QET_DIR}/sources/ui/contactgroupselectiondialog.cpp
|
||||
${QET_DIR}/sources/ui/contactgroupselectiondialog.h
|
||||
${QET_DIR}/sources/ui/conductorpropertiesdialog.cpp
|
||||
${QET_DIR}/sources/ui/conductorpropertiesdialog.h
|
||||
${QET_DIR}/sources/ui/conductorpropertieswidget.cpp
|
||||
@@ -712,8 +664,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/ui/marginseditdialog.h
|
||||
${QET_DIR}/sources/ui/masterpropertieswidget.cpp
|
||||
${QET_DIR}/sources/ui/masterpropertieswidget.h
|
||||
${QET_DIR}/sources/ui/plclinkwidget.cpp
|
||||
${QET_DIR}/sources/ui/plclinkwidget.h
|
||||
${QET_DIR}/sources/ui/multipastedialog.cpp
|
||||
${QET_DIR}/sources/ui/multipastedialog.h
|
||||
${QET_DIR}/sources/ui/potentialselectordialog.cpp
|
||||
@@ -778,6 +728,17 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/xml/terminalstriplayoutpatternxml.h
|
||||
)
|
||||
|
||||
if(NOT BUILD_WITH_KF5)
|
||||
list(APPEND QET_SRC_FILES
|
||||
${QET_DIR}/sources/ui/nokde/kautosavefile.cpp
|
||||
${QET_DIR}/sources/ui/nokde/kautosavefile.h
|
||||
${QET_DIR}/sources/ui/nokde/kcolorbutton.cpp
|
||||
${QET_DIR}/sources/ui/nokde/kcolorbutton.h
|
||||
${QET_DIR}/sources/ui/nokde/kcolorcombo.cpp
|
||||
${QET_DIR}/sources/ui/nokde/kcolorcombo.h
|
||||
)
|
||||
endif()
|
||||
|
||||
set(TS_FILES
|
||||
${QET_DIR}/lang/qet_ar.ts
|
||||
${QET_DIR}/lang/qet_ca.ts
|
||||
@@ -796,17 +757,19 @@ set(TS_FILES
|
||||
${QET_DIR}/lang/qet_mn.ts
|
||||
${QET_DIR}/lang/qet_nb.ts
|
||||
${QET_DIR}/lang/qet_nl.ts
|
||||
${QET_DIR}/lang/qet_nl_BE.ts
|
||||
${QET_DIR}/lang/qet_nl_BE.ts
|
||||
${QET_DIR}/lang/qet_no.ts
|
||||
${QET_DIR}/lang/qet_pl.ts
|
||||
${QET_DIR}/lang/qet_pt.ts
|
||||
${QET_DIR}/lang/qet_pt_BR.ts
|
||||
${QET_DIR}/lang/qet_ro.ts
|
||||
${QET_DIR}/lang/qet_rs.ts
|
||||
${QET_DIR}/lang/qet_ru.ts
|
||||
${QET_DIR}/lang/qet_sk.ts
|
||||
${QET_DIR}/lang/qet_sl.ts
|
||||
${QET_DIR}/lang/qet_sr.ts
|
||||
${QET_DIR}/lang/qet_sv.ts
|
||||
${QET_DIR}/lang/qet_tr.ts
|
||||
${QET_DIR}/lang/qet_uk.ts
|
||||
${QET_DIR}/lang/qet_zh.ts
|
||||
)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7b7798233e8251baac7717d4b0f991ad5fdf23a76d9fbe864d363e3b93458560
|
||||
size 529821696
|
||||
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 49 KiB |
@@ -1,101 +0,0 @@
|
||||
Compiler QElectroTech sous microsoft Windows 10 et 11 avec MSYS2
|
||||
================================
|
||||
Ce document décrit les étapes nécessaire afin de compilé QElectroTech sous Windows avec Qt6 et cmake en utilisant MSYS2.
|
||||
|
||||
# MSYS2
|
||||
L'ensemble des outils nécessaire au développement et à la compilation de QElectroTech sous Windows sera installé par l’intermédiaire de [MSYS2](https://www.msys2.org/). Cela comprend entre autre le framework [Qt6](https://www.qt.io/development/qt-framework/qt6), les outils cmake, les dépendances ([kde framework](https://develop.kde.org/docs/), [sqlite](https://sqlite.org/), [pugixml](https://pugixml.org/)), les outils de compilation [minGW](https://www.mingw-w64.org/)...
|
||||
|
||||
>Il sera nécessaire d'utiliser [winget](https://learn.microsoft.com/fr-fr/windows/package-manager/winget/), celui-ci est présent par défaut sous Windows 11, dans le cas de Windows 10, winget peut necessité d'être activé manuellement
|
||||
|
||||
# Installer GIT et MSYS2 avec winget
|
||||
Avec power shell.
|
||||
```
|
||||
winget install Git.Git
|
||||
```
|
||||
puis
|
||||
```
|
||||
winget install MSYS2.MSYS2
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Mise à jour de MSYS2
|
||||
Lors de la première utilisation de MSYS2 il est nécessaire de mettre celui-ci à jour.
|
||||
|
||||
Lancer "MSYS2 MSYS" depuis le menu démarré de Windows.
|
||||
Une fenêtre avec un shell s'ouvre, dans celui-ci lancer la commande :
|
||||
```
|
||||
pacman -Syu
|
||||
```
|
||||
A la fin de la mise à jour MSYS2 MSYS se fermera automatiquement. Ouvrez le à nouveau et relancé la commande
|
||||
```
|
||||
pacman -Syu
|
||||
```
|
||||
|
||||
## Installation des outils de devellopement
|
||||
Toujours dans le shell MSYS2 MSYS lancer la commande suivante.
|
||||
```
|
||||
pacman -S mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-qt6-svg mingw-w64-ucrt-x86_64-qt6-base mingw-w64-ucrt-x86_64-sqlite3 mingw-w64-ucrt-x86_64-pugixml mingw-w64-ucrt-x86_64-kcoreaddons mingw-w64-ucrt-x86_64-kwidgetsaddons mingw-w64-ucrt-x86_64-extra-cmake-modules mingw-w64-ucrt-x86_64-gdb mingw-w64-ucrt-x86_64-qt6-translations mingw-w64-ucrt-x86_64-qt6-tools
|
||||
```
|
||||
> La quantité de paquets à installer est conséquent, en fonction de votre connexion internet cela peut prendre plusieurs dizaine de minute
|
||||
|
||||
L'ensemble des outils est mantenant installé 😀
|
||||
|
||||
# Installer Qt creator
|
||||
Télécharger [l'installateur online de Qt](https://www.qt.io/development/download-qt-installer-oss) et lancer l'installation en suivant les indications de ce dernier.
|
||||
|
||||
>Dans le cas où vous comptez utilisé Qt Creator uniquement pour développez QElectroTech, lors de l'installation choisissez l'option "installation personnalisée" puis dans la page suivante sélectionné uniquement Qt Creator.
|
||||
|
||||
## Configurer Qt creator
|
||||
Ouvrir Qt creator puis rendez vous dans "édition -> préférence -> kit"
|
||||
|
||||
### Versions de Qt
|
||||
|
||||
- Cliquer sur _ajouter_
|
||||
- Renseigner _Chemin de qmake_ (exemple C:\\msys64\\ucrt64\\bin\\qmake.exe).
|
||||
- Dans le champ _Nom :_ ajouter (msys2).
|
||||
|
||||

|
||||
|
||||
### Compilateurs
|
||||
- Cliquer sur _ajouter_ puis choisir _MinGW_.
|
||||
- Renseigner _Emplacement du compilateur C_ (exemple C:\\msys64\\ucrt64\\bin\\g++.exe).
|
||||
- Dans le champ _Nom :_ ajouter (msys2).
|
||||
|
||||

|
||||
|
||||
### Débogueurs
|
||||
- Cliquer sur _ajouter_
|
||||
- Renseigner _Chemin :_ (exemple C:\\msys64\\ucrt64\\bin\\gdb.exe).
|
||||
- Dans le champ _Nom :_ ajouter (msys2).
|
||||
|
||||

|
||||
|
||||
### cmake
|
||||
- Outils -> _Ajouter_
|
||||
- Renseigner _Chemin :_ (exemple C:\\msys64\\ucrt64\\bin\\cmake.exe).
|
||||
- Dans le champ _Nom :_ ajouter (msys2).
|
||||
|
||||

|
||||
|
||||
### KIT
|
||||
Maintenant que tous les prérequis sont fait nous allons crée un kit utilisant les outils fournis par MSYS2. Cliquer sur _Ajouter_, un nouveau kit _manuel_ apparaît, nommer celui-ci par exemple _Qt6 msys2_ puis renseigner le compilateur, le débogueur, la version de Qt et Outils CMake en choisissant à chaque fois ceux que nous venons de créer.
|
||||
puis cliquer sur _appliquer_.
|
||||
|
||||

|
||||
|
||||
Bravo 🥳🥳 vous avez terminé l'installation de la totalité des outils de développement.
|
||||
|
||||
# Clonez le dépôts de QElectrotech
|
||||
Clonez le dépôt de QElectroTech comme vous le faite habituellement, sinon utilisez les commandes suivante dans power shell.
|
||||
|
||||
Crée et/ou se rendre dans le dossier dans lequel vous voulez clonez le dépôt (dans l'exemple nous allons crée un dossier QElectroTech dans C:)
|
||||
|
||||
```
|
||||
mkdir C:\QElectroTech
|
||||
cd C:\QElectroTech
|
||||
|
||||
git clone --recursive https://github.com/qelectrotech/qelectrotech-source-mirror.git
|
||||
```
|
||||
|
||||
Une fois le dépôt cloné lancer Qt creator puis choisir d'ouvrir un projet existant, en choisissant le _CMakeLists.txt_ se trouvant à la racine du projet QElectroTech, enfin dans l'assistant de création de projet choisir comme kit le kit que nous avons créer précédemment.
|
||||
@@ -1,13 +0,0 @@
|
||||
Compiler QElectroTech sous microsoft Windows 10 et 11
|
||||
================================
|
||||
Compiler QElectroTech pour et/ou sous Windows peut être effectué avec plusieurs méthode différente.
|
||||
Ce document énumère uniquement les différentes méthode possible
|
||||
|
||||
N'est mentionné que les étapes nécessaire afin de compilé QElectroTech sous Windows avec Qt6 et cmake. Ce document ne traite pas la compilation avec Qt5 et qmake.
|
||||
|
||||
>QElectroTech 0.100 est la dernière version à utiliser Qt5. Les version suivante sont développé avec Qt6 et utilise cmake au lieu de qmake.
|
||||
|
||||
Il existe deux méthodes pour cela :
|
||||
|
||||
1. [Utiliser msys2 (méthode recommandé)](fr_window_build_msys2.md)
|
||||
2. Télécharger et compiler l'ensemble des dépendances (non rédigé)
|
||||
@@ -8,5 +8,5 @@ rem Met la collection QET en lecture seule
|
||||
attrib +r elements/* /S /D
|
||||
|
||||
rem lance QElectroTech
|
||||
set command=bin\qelectrotech.exe -platform windows:fontengine=freetype --common-elements-dir=elements/ --common-tbt-dir=titleblocks/ --lang-dir=lang/ --config-dir=conf/ --data-dir=conf/ %*
|
||||
set command=bin\qelectrotech.exe -platform windows:fontengine=freetype --common-elements-dir=elements/ --common-tbt-dir=titleblocks/ --lang-dir=lang/ --config-dir=conf/ --data-dir=conf/ -style plastique %*
|
||||
@start %command%
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
@echo off
|
||||
|
||||
rem Se rend dans le dossier qui convient
|
||||
set current_dir=%~dp0
|
||||
cd /d %current_dir%
|
||||
|
||||
rem Met la collection QET en lecture seule
|
||||
attrib +r elements/* /S /D
|
||||
|
||||
rem lance QElectroTech
|
||||
set command=bin\qelectrotech.exe --common-elements-dir=elements/ --common-tbt-dir=titleblocks/ --lang-dir=lang/ --config-dir=conf/ --data-dir=conf/ %*
|
||||
@start %command%
|
||||
@@ -1,119 +0,0 @@
|
||||
# publiccode.yml — QElectroTech
|
||||
# Standard: https://yml.publiccode.tools/ (v0.7)
|
||||
# Place at the root of the main repository (qelectrotech-source-mirror)
|
||||
# Validate before submission: https://publiccode-editor.developers.italia.it/
|
||||
|
||||
publiccodeYmlVersion: "0.4"
|
||||
|
||||
name: QElectroTech
|
||||
applicationSuite: QElectroTech
|
||||
|
||||
url: "https://github.com/qelectrotech/qelectrotech-source-mirror.git"
|
||||
landingURL: "https://qelectrotech.org/"
|
||||
|
||||
releaseDate: "2026-01-25"
|
||||
softwareVersion: "0.100"
|
||||
|
||||
developmentStatus: stable
|
||||
|
||||
softwareType: standalone/desktop
|
||||
|
||||
platforms:
|
||||
- windows
|
||||
- mac
|
||||
- linux
|
||||
- bsd
|
||||
|
||||
# NB: check/adjust against the official category list
|
||||
# (https://yml.publiccode.tools/categories.html) before submission
|
||||
categories:
|
||||
- cad
|
||||
- it-development
|
||||
- engineering
|
||||
|
||||
description:
|
||||
en:
|
||||
shortDescription: >-
|
||||
Free electrical diagram editor, also used for plumbing, hydraulics,
|
||||
pneumatics, automotive wiring and photovoltaic schematics.
|
||||
longDescription: >-
|
||||
QElectroTech (QET) is a free and open source CAD/CAE application to
|
||||
create complex industrial and domestic electrical diagrams. While
|
||||
originally focused on electrical engineering, it is also widely used
|
||||
for plumbing, geothermal, air-conditioning, layout, hydraulics,
|
||||
pneumatics, home automation, automotive wiring, process diagrams
|
||||
(P&ID), photovoltaic installations and many other technical domains.
|
||||
|
||||
|
||||
The software ships with a community-maintained library of over 9000
|
||||
standardized symbols. It runs identically on Windows, macOS, Linux
|
||||
and BSD, and files created on one platform can be opened on another
|
||||
without conversion.
|
||||
|
||||
|
||||
QET has been developed since 2007 and community-maintained since
|
||||
2013. It is notably used as a free alternative to commercial
|
||||
software such as EPLAN or SEE Electrical, by hobbyists, teachers,
|
||||
students, professional electricians and companies worldwide.
|
||||
documentation: "https://qelectrotech.github.io/qelectrotech-doc/index.html"
|
||||
apiDocumentation: ""
|
||||
features:
|
||||
- Multi-domain electrical and schematic diagram creation
|
||||
- Library of over 9000 standardized symbols
|
||||
- Multi-sheet project management with configurable title blocks
|
||||
- DXF import/export (via dxf2elmt)
|
||||
- Bill of materials and terminal strip table generation
|
||||
- "Companion tools: QET-elementScaler (symbol scaling) and qet_tb_generator (terminal block table generation)"
|
||||
- Interface translated into 25 languages
|
||||
- "Cross-platform: Windows, macOS, Linux, BSD"
|
||||
|
||||
legal:
|
||||
license: GPL-2.0-only
|
||||
mainCopyrightOwner: QElectroTech community
|
||||
repoOwner: QElectroTech community
|
||||
|
||||
maintenance:
|
||||
type: community
|
||||
contacts:
|
||||
- name: Laurent Trinques (scorpio810)
|
||||
email: scorpio@qelectrotech.org
|
||||
|
||||
localisation:
|
||||
localisationReady: true
|
||||
availableLanguages:
|
||||
- en
|
||||
- fr
|
||||
- ar
|
||||
- ca
|
||||
- cs
|
||||
- da
|
||||
- de
|
||||
- el
|
||||
- es
|
||||
- hr
|
||||
- hu
|
||||
- it
|
||||
- ja
|
||||
- ko
|
||||
- mn
|
||||
- nb
|
||||
- nl
|
||||
- pl
|
||||
- pt
|
||||
- pt-BR
|
||||
- ro
|
||||
- ru
|
||||
- sk
|
||||
- sl
|
||||
- sr
|
||||
- sv
|
||||
- tr
|
||||
- uk
|
||||
- zh
|
||||
|
||||
dependsOn:
|
||||
open:
|
||||
- name: Qt
|
||||
versionMin: "5.15"
|
||||
- name: KF5 (KDE Frameworks)
|
||||
optional: true
|
||||
@@ -171,9 +171,7 @@ HEADERS += $$files(sources/*.h) \
|
||||
$$files(sources/xml/*.h) \
|
||||
$$files(sources/dxf/*.h) \
|
||||
$$files(sources/qet_elementscaler/*.h) \
|
||||
$$files(sources/svg/*.h) \
|
||||
$$files(sources/import/edz/*.h) \
|
||||
$$files(sources/import/edz/lzma/*.h)
|
||||
$$files(sources/svg/*.h)
|
||||
|
||||
SOURCES += $$files(sources/*.cpp) \
|
||||
$$files(sources/editor/*.cpp) \
|
||||
@@ -217,17 +215,11 @@ SOURCES += $$files(sources/*.cpp) \
|
||||
$$files(sources/xml/*.cpp) \
|
||||
$$files(sources/dxf/*.cpp) \
|
||||
$$files(sources/qet_elementscaler/*.cpp) \
|
||||
$$files(sources/svg/*.cpp) \
|
||||
$$files(sources/import/edz/*.cpp) \
|
||||
$$files(sources/import/edz/lzma/*.c)
|
||||
$$files(sources/svg/*.cpp)
|
||||
|
||||
# Needed for use promote QTreeWidget in terminalstripeditor.ui
|
||||
INCLUDEPATH += sources/TerminalStrip/ui
|
||||
|
||||
# Needed for the EPLAN .edz importer (PR #513) and its bundled lzma/7z sources
|
||||
INCLUDEPATH += sources/import/edz
|
||||
INCLUDEPATH += sources/import/edz/lzma
|
||||
|
||||
# Liste des fichiers qui seront incorpores au binaire en tant que ressources Qt
|
||||
RESOURCES += qelectrotech.qrc
|
||||
|
||||
@@ -238,26 +230,7 @@ RESOURCES += qelectrotech.qrc
|
||||
TRANSLATIONS += lang/*.ts
|
||||
|
||||
# Modules Qt utilises par l'application
|
||||
QT += xml svg network sql widgets printsupport concurrent gui-private
|
||||
|
||||
# KDE Frameworks 5 (KWidgetsAddons, KCoreAddons) are optional.
|
||||
#
|
||||
# Pass CONFIG+=no_kf5 to qmake to build against the Qt-only replacements in
|
||||
# sources/ui/nokde instead. This mirrors the CMake option BUILD_WITH_KF5=OFF
|
||||
# and is the easiest route on Windows/MinGW, where KF5 is awkward to obtain.
|
||||
#
|
||||
# qmake CONFIG+=no_kf5 qelectrotech.pro
|
||||
#
|
||||
# sources/ui/nokde is only added to the include path in that configuration, so
|
||||
# a normal KF5 build is unaffected.
|
||||
no_kf5 {
|
||||
DEFINES += BUILD_WITHOUT_KF5
|
||||
INCLUDEPATH += sources/ui/nokde
|
||||
HEADERS += $$files(sources/ui/nokde/*.h)
|
||||
SOURCES += $$files(sources/ui/nokde/*.cpp)
|
||||
} else {
|
||||
QT += KWidgetsAddons KCoreAddons
|
||||
}
|
||||
QT += xml svg network sql widgets printsupport concurrent KWidgetsAddons KCoreAddons gui-private
|
||||
|
||||
# Private Qt GUI headers (needed for QPdfEngine::drawHyperlink)
|
||||
# gui-private should add this automatically, but some distros need it explicit
|
||||
|
||||
@@ -143,12 +143,8 @@ ElementsLocation ECHSFileToFile::copyElement(ElementsLocation &source, ElementsL
|
||||
//On windows when user drag and drop an element from the common elements collection
|
||||
//to the custom elements collection, the element file stay in read only mode, and so
|
||||
//user can't save the element
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
|
||||
QNtfsPermissionCheckGuard ntfs_guard;
|
||||
#else
|
||||
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
|
||||
qt_ntfs_permission_lookup++;
|
||||
#endif
|
||||
QFile file(destination.fileSystemPath() % "/" % new_elmt_name);
|
||||
if (!file.isWritable()) {
|
||||
if (!file.setPermissions(file.permissions() | QFileDevice::WriteUser)) {
|
||||
@@ -156,9 +152,7 @@ ElementsLocation ECHSFileToFile::copyElement(ElementsLocation &source, ElementsL
|
||||
<< " in ECHSFileToFile::copyElement";
|
||||
}
|
||||
}
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
|
||||
qt_ntfs_permission_lookup--;
|
||||
#endif
|
||||
#endif
|
||||
return ElementsLocation (destination.fileSystemPath() % "/" % new_elmt_name);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,12 @@
|
||||
#include "xmlprojectelementcollectionitem.h"
|
||||
|
||||
#include <QFutureWatcher>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
#include <QtConcurrentMap>
|
||||
#else
|
||||
#include <QtConcurrentRun>
|
||||
#endif
|
||||
|
||||
/**
|
||||
@brief ElementsCollectionModel::ElementsCollectionModel
|
||||
Constructor
|
||||
@@ -289,14 +294,14 @@ void ElementsCollectionModel::loadCollections(bool common_collection,
|
||||
connect(watcher, &QFutureWatcher<void>::progressRangeChanged,
|
||||
this, &ElementsCollectionModel::loadingProgressRangeChanged);
|
||||
connect(watcher, &QFutureWatcher<void>::finished,
|
||||
this, &ElementsCollectionModel::loadingFinished);
|
||||
connect(
|
||||
watcher,
|
||||
&QFutureWatcher<void>::finished,
|
||||
watcher,
|
||||
&QFutureWatcher<void>::deleteLater);
|
||||
this, &ElementsCollectionModel::loadingFinished);
|
||||
connect(watcher, &QFutureWatcher<void>::finished, watcher, &QFutureWatcher<void>::deleteLater);
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
m_future = QtConcurrent::map(m_items_list_to_setUp, setUpData);
|
||||
#else
|
||||
qDebug() << "Help code for QT 6 or later";
|
||||
#endif
|
||||
watcher->setFuture(m_future);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "../editor/ui/qetelementeditor.h"
|
||||
#include "../elementscategoryeditor.h"
|
||||
#include "../import/edz/edzimporter.h"
|
||||
#include "../newelementwizard.h"
|
||||
#include "../qetapp.h"
|
||||
#include "../qetdiagrameditor.h"
|
||||
@@ -33,14 +32,8 @@
|
||||
#include "fileelementcollectionitem.h"
|
||||
#include "xmlprojectelementcollectionitem.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDesktopServices>
|
||||
#include <QDialog>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QFileDialog>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
#include <QPushButton>
|
||||
#include <QTimer>
|
||||
#include <QUrl>
|
||||
#include <QVBoxLayout>
|
||||
@@ -165,8 +158,6 @@ void ElementsCollectionWidget::setUpAction()
|
||||
tr("Nouveau dossier"), this);
|
||||
m_new_element = new QAction(QET::Icons::ElementNew,
|
||||
tr("Nouvel élément"), this);
|
||||
m_import_edz = new QAction(QET::Icons::ElementNew,
|
||||
tr("Importer une pièce EPLAN (.edz)…"), this);
|
||||
m_show_this_dir = new QAction(QET::Icons::FolderOnlyThis,
|
||||
tr("Afficher uniquement ce dossier"),
|
||||
this);
|
||||
@@ -256,8 +247,6 @@ void ElementsCollectionWidget::setUpConnection()
|
||||
this, &ElementsCollectionWidget::newDirectory);
|
||||
connect(m_new_element, &QAction::triggered,
|
||||
this, &ElementsCollectionWidget::newElement);
|
||||
connect(m_import_edz, &QAction::triggered,
|
||||
this, &ElementsCollectionWidget::importEdz);
|
||||
connect(m_show_this_dir, &QAction::triggered,
|
||||
this, &ElementsCollectionWidget::showThisDir);
|
||||
connect(m_show_all_dir, &QAction::triggered,
|
||||
@@ -340,7 +329,6 @@ void ElementsCollectionWidget::customContextMenu(const QPoint &point)
|
||||
{
|
||||
if (!feci->isMacrosCollection()) {
|
||||
m_context_menu->addAction(m_new_element);
|
||||
m_context_menu->addAction(m_import_edz);
|
||||
}
|
||||
m_context_menu->addAction(m_new_directory);
|
||||
if (!feci->isCollectionRoot())
|
||||
@@ -611,108 +599,6 @@ void ElementsCollectionWidget::newElement()
|
||||
&ElementsCollectionWidget::locationWasSaved);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ElementsCollectionWidget::confirmEdzImportTerms
|
||||
Show the EPLAN (.edz) import warning dialog. The user must tick the
|
||||
acknowledgement checkbox before the Import button is enabled.
|
||||
@return true if the user accepted the terms, false otherwise.
|
||||
*/
|
||||
bool ElementsCollectionWidget::confirmEdzImportTerms()
|
||||
{
|
||||
QDialog dialog(this);
|
||||
dialog.setWindowTitle(tr("Avertissement — Importation d'un fichier EPLAN (.edz)"));
|
||||
|
||||
QLabel *text = new QLabel(
|
||||
tr("Le format .edz peut provenir de deux sources différentes :\n"
|
||||
"\n"
|
||||
"• Le portail EPLAN Data Portal (dataportal.eplan.com), soumis "
|
||||
"aux conditions d'utilisation de l'environnement EPLAN Cloud ;\n"
|
||||
"• Le site d'un fabricant de composants (ou d'un distributeur) "
|
||||
"qui met ses fichiers .edz à disposition directement, selon ses "
|
||||
"propres conditions.\n"
|
||||
"\n"
|
||||
"QElectroTech ne peut pas déterminer automatiquement l'origine "
|
||||
"du fichier que vous importez, ni les conditions qui s'y "
|
||||
"appliquent.\n"
|
||||
"\n"
|
||||
"En important ce fichier, vous confirmez que :\n"
|
||||
"\n"
|
||||
"• vous connaissez son origine et êtes autorisé à l'utiliser "
|
||||
"dans ce contexte, au regard des conditions applicables à cette "
|
||||
"source ;\n"
|
||||
"• cette importation est effectuée à vos propres risques et "
|
||||
"responsabilité ;\n"
|
||||
"• ni QElectroTech, ni ses mainteneurs, ni ses contributeurs ne "
|
||||
"peuvent être tenus responsables d'une utilisation non conforme "
|
||||
"de ces données."),
|
||||
&dialog);
|
||||
text->setWordWrap(true);
|
||||
|
||||
QCheckBox *accept_box = new QCheckBox(
|
||||
tr("J'ai lu et j'accepte ces conditions."), &dialog);
|
||||
|
||||
QDialogButtonBox *buttons = new QDialogButtonBox(
|
||||
QDialogButtonBox::Cancel, &dialog);
|
||||
QPushButton *import_button = buttons->addButton(
|
||||
tr("Importer"), QDialogButtonBox::AcceptRole);
|
||||
import_button->setDefault(true);
|
||||
import_button->setEnabled(false);
|
||||
|
||||
connect(accept_box, &QCheckBox::toggled,
|
||||
import_button, &QPushButton::setEnabled);
|
||||
connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
||||
connect(buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(&dialog);
|
||||
layout->addWidget(text);
|
||||
layout->addWidget(accept_box);
|
||||
layout->addWidget(buttons);
|
||||
|
||||
return dialog.exec() == QDialog::Accepted;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ElementsCollectionWidget::importEdz
|
||||
Import an EPLAN Data Portal part (.edz) as a QET element into the directory
|
||||
pointed at by the context menu.
|
||||
*/
|
||||
void ElementsCollectionWidget::importEdz()
|
||||
{
|
||||
ElementCollectionItem *eci = elementCollectionItemForIndex(
|
||||
m_index_at_context_menu);
|
||||
|
||||
if (!eci || eci->type() != FileElementCollectionItem::Type) {
|
||||
return;
|
||||
}
|
||||
FileElementCollectionItem *feci =
|
||||
static_cast<FileElementCollectionItem*>(eci);
|
||||
if (feci->isCommonCollection() || !feci->isDir()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!confirmEdzImportTerms()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const QString edz_path = QFileDialog::getOpenFileName(
|
||||
this, tr("Importer une pièce EPLAN"), QString(),
|
||||
tr("Pièces EPLAN (*.edz)"));
|
||||
if (edz_path.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
EdzImporter importer;
|
||||
if (!importer.importToDirectory(edz_path, feci->fileSystemPath())) {
|
||||
QET::QetMessageBox::critical(
|
||||
this, tr("Import EPLAN"),
|
||||
tr("Impossible d'importer cette pièce :\n%1")
|
||||
.arg(importer.errorString()));
|
||||
return;
|
||||
}
|
||||
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ElementsCollectionWidget::showThisDir
|
||||
Hide all directories except the pointed dir;
|
||||
@@ -944,13 +830,19 @@ void ElementsCollectionWidget::search()
|
||||
}
|
||||
|
||||
//start the search when text have at least 3 letters.
|
||||
if (text.size() < 3) {
|
||||
if (text.count() < 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
hideCollection(true);
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
const QStringList text_list = text.split("+", QString::SkipEmptyParts);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 5.14 or later")
|
||||
#endif
|
||||
const QStringList text_list = text.split("+", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
QModelIndexList match_index;
|
||||
for (QString txt : text_list) {
|
||||
match_index << m_model->match(m_showed_index.isValid()
|
||||
|
||||
@@ -72,8 +72,6 @@ class ElementsCollectionWidget : public QWidget
|
||||
void editDirectory();
|
||||
void newDirectory();
|
||||
void newElement();
|
||||
bool confirmEdzImportTerms();
|
||||
void importEdz();
|
||||
void showThisDir();
|
||||
void resetShowThisDir();
|
||||
void dirProperties();
|
||||
@@ -114,7 +112,6 @@ class ElementsCollectionWidget : public QWidget
|
||||
*m_edit_dir,
|
||||
*m_new_directory,
|
||||
*m_new_element,
|
||||
*m_import_edz,
|
||||
*m_show_this_dir,
|
||||
*m_show_all_dir,
|
||||
*m_dir_propertie;
|
||||
|
||||
@@ -804,15 +804,14 @@ bool ElementsLocation::setXml(const QDomDocument &xml_document) const
|
||||
|
||||
QString path_ = collectionPath(false);
|
||||
QRegularExpression rx("^(.*)/(.*\\.elmt)$");
|
||||
QRegularExpressionMatch match = rx.match(path_);
|
||||
|
||||
if (auto regex_match = rx.match(path_); regex_match.hasMatch())
|
||||
if (rx.exactMatch(path_))
|
||||
{
|
||||
return project()
|
||||
->embeddedElementCollection()
|
||||
->addElementDefinition(
|
||||
regex_match.captured(1),
|
||||
regex_match.captured(2),
|
||||
rx.cap(1),
|
||||
rx.cap(2),
|
||||
xml_document.documentElement());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "../NameList/nameslist.h"
|
||||
#include "../diagramcontext.h"
|
||||
#include "pugixml.hpp"
|
||||
#include "pugixml/src/pugixml.hpp"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QString>
|
||||
|
||||
@@ -87,7 +87,11 @@ void ElementsTreeView::startElementDrag(const ElementsLocation &location)
|
||||
{
|
||||
if (! location.exist()) return;
|
||||
|
||||
auto drag = new QDrag{this};
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
||||
QDrag* drag = new QDrag(this);
|
||||
#else
|
||||
QScopedPointer<QDrag> drag(new QDrag(this));
|
||||
#endif
|
||||
|
||||
QString location_str = location.toString();
|
||||
QMimeData *mime_data = new QMimeData();
|
||||
|
||||
@@ -327,26 +327,6 @@ void FileElementCollectionItem::setUpData()
|
||||
{ search_list.append(context.value(key).toString()); }
|
||||
search_list.append(localName(loc));
|
||||
setData(search_list.join(" "));
|
||||
|
||||
// Tooltip: show what a truncated tree label can't - the full
|
||||
// localized name and the descriptive element information.
|
||||
// Reuses the location/context already parsed for the search
|
||||
// index above; the collection path stays as the last line
|
||||
// (it used to be the whole tooltip).
|
||||
QStringList tip;
|
||||
tip << localName(loc);
|
||||
for (const auto &key : { QStringLiteral("description"),
|
||||
QStringLiteral("manufacturer"),
|
||||
QStringLiteral("manufacturer_reference") })
|
||||
{
|
||||
const QString value = context.value(key).toString();
|
||||
if (!value.isEmpty())
|
||||
tip << value;
|
||||
}
|
||||
tip << collectionPath();
|
||||
tip.removeDuplicates();
|
||||
setToolTip(tip.join(QLatin1Char('\n')));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,7 +363,7 @@ void FileElementCollectionItem::setUpIcon()
|
||||
setIcon(QET::Icons::Folder);
|
||||
} else {
|
||||
if (m_path.endsWith(".qetmak")) {
|
||||
setIcon(QET::Icons::PartRectangle);
|
||||
setIcon(QIcon());
|
||||
} else {
|
||||
ElementsLocation loc(collectionPath());
|
||||
setIcon(loc.icon());
|
||||
|
||||
@@ -186,22 +186,23 @@ QDomElement XmlElementCollection::child(const QDomElement &parent_element,
|
||||
if (parent_element.ownerDocument() != m_dom_document)
|
||||
return QDomElement();
|
||||
|
||||
/* Walk the siblings directly instead of the previous
|
||||
* childNodes()+item(i) double pass: QDomNodeList::item(i) restarts
|
||||
* from the first child every call, which made this loop quadratic
|
||||
* in the number of children. This lookup runs several times per
|
||||
* element instance while loading a project, on the "import"
|
||||
* category that holds every embedded definition. */
|
||||
const QString tag_name = child_name.endsWith(QLatin1String(".elmt"))
|
||||
? QStringLiteral("element") : QStringLiteral("category");
|
||||
for (QDomElement child_element = parent_element.firstChildElement(tag_name) ;
|
||||
!child_element.isNull() ;
|
||||
child_element = child_element.nextSiblingElement(tag_name))
|
||||
//Get all childs element of parent_element
|
||||
QDomNodeList child_list = parent_element.childNodes();
|
||||
QString tag_name(child_name.endsWith(".elmt")? "element" : "category");
|
||||
QList <QDomElement> found_dom_element;
|
||||
for (int i=0 ; i<child_list.length() ; i++)
|
||||
{
|
||||
if (child_element.attribute(QStringLiteral("name")) == child_name)
|
||||
return child_element;
|
||||
QDomElement child_element = child_list.item(i).toElement();
|
||||
if (child_element.tagName() == tag_name)
|
||||
found_dom_element << child_element;
|
||||
}
|
||||
|
||||
if (found_dom_element.isEmpty()) return QDomElement();
|
||||
|
||||
foreach (QDomElement elmt, found_dom_element)
|
||||
if (elmt.attribute("name") == child_name)
|
||||
return elmt;
|
||||
|
||||
return QDomElement();
|
||||
}
|
||||
|
||||
|
||||