Commit Graph

8600 Commits

Author SHA1 Message Date
ispyisail 3ffa0194c7 cmake: Windows translations live in lang/, not l10n/
QET_LANG_PATH was "l10n/" for WIN32, a value that appears nowhere else in
the tree: the MSI shortcuts pass --lang-dir="[INSTALLDIR]lang/", and the
windows-build workflow copies the .qm files into files/lang/. So the
compiled-in default pointed at a directory no packaging creates, leaving
the command-line argument to do all the work.

Align it with what is actually shipped, so the binary-relative lookup
added in the previous commit can find the translations on its own.
2026-07-26 22:41:44 +12:00
ispyisail d4ec9f9c65 Resolve relative compiled-in data paths from the binary, not the CWD
commonElementsDir(), commonTitleBlockTemplatesDir() and languagesPath()
return the compile-time path verbatim when it is not marked
*_RELATIVE_TO_BINARY_PATH. On Windows those paths are relative
("./elements/", "./titleblocks/", "./lang/"), so they resolve against the
process working directory.

That only holds when QET is started from its own installation folder.
Opening a document from a file manager sets the working directory to the
document's folder, and the data is then looked for next to the user's
file. The shortcuts hide this by passing --common-elements-dir,
--common-tbt-dir and --lang-dir explicitly; anything that launches the
binary without them does not (see #554).

Add resolveConfiguredDataPath(): absolute paths are returned unchanged,
and a relative one is tried against the working directory first (so any
setup relying on the old behaviour keeps working), then next to the
executable, then in its parent -- the layout used by the Windows
packaging, where the binary sits in bin/ with the data beside it. This is
the same fallback the no-compile-option branch already performs for
issue #86, which was unreachable whenever the compile option is set.

The *_RELATIVE_TO_BINARY_PATH defines are left alone; they are only set
for macOS in qelectrotech.pro, and the CMake guard that would set them
tests a variable that is never defined.
2026-07-26 22:41:44 +12:00
ispyisail 69c595fdb8 Windows installer: pass the data directories to the .qet file association
The MSI registers both shortcuts with the arguments QET needs to find its
data ("Point directly to qelectrotech.exe with all required arguments"),
but the QElectroTech.Document\shell\open\command registry value was
written without them:

    "[INSTALLDIR]bin\qelectrotech.exe" "%1"

Launching from the Start Menu therefore works, while double-clicking a
.qet file does not: Explorer sets the working directory to the document's
folder, and the compiled-in data paths are relative, so nothing is found
there. The most visible symptom is the interface always coming up in
French, because no translation loads and the source strings are French.

Give the file association the same arguments as the shortcuts.

Reported by mr-rfh in #554, who diagnosed it and arrived at exactly this
registry value by hand.
2026-07-26 22:41:44 +12:00
Laurent Trinques e9a53dbec2 git submodule update --remote elements 2026-07-26 05:44:21 +02:00
Laurent Trinques f9f03c79ea Skip signing the Qt6 MSI, and guard against triggering a signing request from a fork (no SignPath secrets there).
cf. DieterMayerOSS:fix/msi-signing-fork-guard (d3f60c88)
2026-07-24 10:20:01 +02:00
plc-user 7247257a9b add German translations 2026-07-23 19:51:55 +02:00
Laurent Trinques a8c4612fd4 Update translations files and git submodule update --remote elements 2026-07-23 14:08:11 +02:00
Laurent Trinques d02514141c Update qelectrotech.pro for https://github.com/qelectrotech/qelectrotech-source-mirror/pull/513 2026-07-23 14:02:26 +02:00
Laurent Trinques 42d2c824d2 Merge pull request #513 from ispyisail/feature/edz-import
Import EPLAN Data Portal parts (.edz) into element collections
2026-07-23 13:58:56 +02:00
Laurent Trinques 324c818007 Merge pull request #551 from Kellermorph/master
German Translation
2026-07-20 20:17:13 +02:00
Kellermorph 0a4b337115 German Translation 2026-07-20 20:15:28 +02:00
ispyisail 1b8dea3946 Add consent dialog before EPLAN (.edz) import
Shows the licensing/liability warning text agreed on in PR #513
(scorpio810) before the file picker opens. Import stays disabled
until the "I have read and accept these terms" checkbox is ticked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-20 21:11:35 +12:00
Laurent Trinques adb3473a2c Improve Windows Qt5/Qt6 CI test, enable -platform windows:fontengine=freetype add new .bat for Qt6 installer and portable version 2026-07-19 21:15:13 +02:00
Laurent Trinques 3c1eb9b970 New Windows Qt5/Qt6 CI test, enable -platform windows:fontengine=freetype add new .bat for Qt6 installer and portable version 2026-07-19 19:26:25 +02:00
Laurent Trinques fd402bb9b5 Update windows-msi.yml 2026-07-19 19:00:06 +02:00
Laurent Trinques 8e736c59ba New Windows Qt5/Qt6 CI test, enable -platform windows:fontengine=freetype 2026-07-19 18:55:26 +02:00
Laurent Trinques 6941edcdf5 New Windows Qt5/Qt6 CI test 2026-07-19 16:48:42 +02:00
Laurent Trinques e1aa65f1ee Revert "Set QET version to 0.200.1 when built with Qt6"
This reverts commit 608ca984a4.
2026-07-19 13:26:34 +02:00
scorpio810 629bd7cdef Add SQLite3::SQLite3 compat alias, use modern target name
CMake's bundled FindSQLite3 module only creates the SQLite3::SQLite3
target since CMake 4.3; earlier versions (still used by most current
Linux distros) only provide SQLite::SQLite3, which CMake >= 4.3 now
flags as deprecated.

Add the missing alias ourselves right after find_package(SQLite3)
when it isn't already provided, so the project can link against the
modern SQLite3::SQLite3 name on every supported CMake version without
triggering the deprecation warning on newer ones.
2026-07-19 12:30:19 +02:00
Laurent Trinques 88e42a435b Merge pull request #519 from ispyisail/fix/asan-memory-leaks
Fix four memory leaks found by AddressSanitizer
2026-07-19 11:51:47 +02:00
Laurent Trinques 100e924aed Fix: Windows Qt6 CI test 2026-07-19 11:26:19 +02:00
Laurent Trinques 90946537c0 Add windows Qt6 CI test 2026-07-19 11:12:48 +02:00
scorpio810 608ca984a4 Set QET version to 0.200.1 when built with Qt6
Use QT_VERSION_CHECK to detect Qt6 at compile time and report
version 0.200.1 instead of 0.100.1 in that case, so Qt6 builds
are clearly distinguishable from Qt5 builds.
2026-07-19 10:56:12 +02:00
Laurent Trinques 7dbfc5fb61 Update translations files 2026-07-18 12:00:51 +02:00
Laurent Trinques a9474d82b8 Update windows-build.yml 2026-07-18 08:24:58 +02:00
Laurent Trinques 7a87754024 Merge pull request #545 from Kellermorph/terminal-name
Implement slave contact groups — label transfer, terminal assignment and UI fixes
2026-07-18 08:00:23 +02:00
Laurent Trinques 964ec23adc Merge pull request #547 from DieterMayerOSS/fix/remaining-qt6-compile-blockers
Fix the remaining Qt6 compile blockers
2026-07-17 23:29:32 +02:00
Laurent Trinques 2eb6632f6f Merge pull request #546 from DieterMayerOSS/fix/qt5-guiprivate-component
Request the GuiPrivate component only on Qt6
2026-07-17 23:07:12 +02:00
Dieter Mayer 12afadd095 Fix the remaining Qt6 compile blockers
Clears the last five spots that stop master from compiling against Qt6
(all mirrored from the proven qt6-build line):

- qgimanager.h/.cpp: in Qt6 QVector is an alias for QList, so the
  deprecated QList overloads of manage()/release() collide with the
  QVector ones (same signature). Keep them on Qt5 only.
- diagramview.cpp: one unguarded QTextStream::setCodec() call (removed
  in Qt6, which defaults to UTF-8).
- print/projectprintwindow.cpp: QApplication::desktop() was removed in
  Qt6; use QWidget::screen() there, keep the old path on Qt5.
- titleblocktemplate.cpp: QDomDocument::setContent() returns a
  ParseResult in Qt6 whose operator bool is explicit; static_cast keeps
  the bool initialization working on both.

With these, master configures and builds to a running binary with
Qt 6.11 (mingw, BUILD_WITH_KF5=OFF); every change is guarded or
dual-safe, the Qt5 build is unaffected.
2026-07-17 21:01:26 +02:00
Dieter Mayer 683eefdac1 Request the GuiPrivate component only on Qt6
Listing GuiPrivate unconditionally in QET_COMPONENTS breaks the whole
Qt5 configure: find_package(Qt5 COMPONENTS GuiPrivate) looks for a
Qt5GuiPrivateConfig.cmake that has never existed - Qt5 creates the
Qt5::GuiPrivate target implicitly together with Gui. Only Qt6 requires
(and provides) the explicit component.

Move the request into a QT_VERSION_MAJOR-guarded find_package after the
main one, both for the application and for tests/catch (whose targets
link Qt::GuiPrivate via QET_PRIVATE_LIBRARIES). Fixes the msys2/Qt5
Windows CI configure failure:
"Could not find a package configuration file provided by Qt5GuiPrivate".

Verified: Qt 6.11 configure passes and the Qt6::GuiPrivate target is
created (the private-module warning now fires from the guarded call).
The Qt5 path simply no longer requests the component, restoring the
pre-existing implicit behaviour.
2026-07-17 19:25:26 +02:00
Laurent Trinques 5785f57679 Update windows-build.yml 2026-07-17 17:16:53 +02:00
Laurent Trinques 6903b3422a Update windows-build.yml 2026-07-17 16:43:01 +02:00
Laurent Trinques 38fa44dbf0 Update windows-build.yml 2026-07-17 16:36:53 +02:00
Laurent Trinques f9a87d81f2 Update windows-build.yml 2026-07-17 15:49:39 +02:00
Laurent Trinques fddec5cbf4 Update windows-build.yml 2026-07-17 15:41:47 +02:00
Laurent Trinques 6a4554a677 Re-enable multi-threading to load collection
The name of the elements and folders of the collection are not displayed
until we hover the item with the mouse.
This due that QtConcurent::run was disabled at loading of collection in
the goal of use QtConcurrent::run with Qt6.
Run is made to run a function once.
Map is made to run a fonction for each item of a sequence (what we need
in this case).
Remove code of run and re-enable code for map.
2026-07-17 10:44:36 +02:00
joshua ae2972a143 Fix : can't open recent file 2026-07-17 10:29:13 +02:00
scorpio810 ed1b6e9ba0 terminalstripdrawer.cpp: fix two Qt6 compile errors
- Add missing <QHash> include: QHash<QUuid, QVector<QPointF>> was
  only forward-declared transitively under Qt5's heavier headers;
  Qt6's leaner <QPainter> etc. no longer pull it in.

- Replace QPolygonF{points_} with QPolygonF(points_): under Qt6,
  QPolygonF inherits QList<QPointF>'s constructors via 'using
  QList<QPointF>::QList;', including the std::initializer_list<T>
  one. Brace-init-list construction with a single argument first
  considers only initializer-list constructors before falling
  back to regular ones, which trips up overload resolution here
  even though points_ is exactly a QList<QPointF> (QVector is a
  plain alias for QList under Qt6). Plain parenthesised
  construction sidesteps that resolution phase entirely and binds
  directly to QPolygonF(const QList<QPointF>&).
2026-07-17 10:26:43 +02:00
scorpio810 33013477ad physicalterminal.cpp: fix std::min template deduction under Qt6
QVector::size() (== QList::size() under Qt6) returns qsizetype
(64-bit), while 'level' is a plain int. std::min(level,
m_real_terminal.size()-1) therefore tries to deduce a single T
from two different argument types, which fails - GCC reports it
against the unrelated std::min(initializer_list<T>) overload,
but the real issue is the type mismatch between the two-argument
candidates. Under Qt5, QVector::size() returned int, so this
compiled fine.
Force T=int explicitly via std::min<int>(...) and cast size()
down to int (physical terminal counts are always tiny), matching
the pattern already used safely elsewhere in the codebase (e.g.
qetgraphicstableitem.cpp).
2026-07-17 10:26:43 +02:00
scorpio810 287b532953 templatescollection.cpp: fix QDomDocument::ParseResult->bool conversion
Since Qt 6.5, QDomDocument::setContent() returns a ParseResult
struct with an *explicit* operator bool(), so 'bool x =
doc.setContent(...)' (copy-initialization) no longer compiles -
explicit conversions aren't considered there.

This exact issue was already fixed in titleblocktemplate.cpp by
dropping the intermediate bool and testing the call directly in
the if condition (contextual bool conversion in an if() is fine
even for an explicit operator bool), but this second occurrence
in templatescollection.cpp used the same pattern and was missed.
Applying the same fix here for consistency.
2026-07-17 10:26:35 +02:00
scorpio810 6716c267b8 templateview.h: add missing QGraphicsGridLayout/QGraphicsLayoutItem includes
templateview.h only included <QGraphicsView> but uses
QGraphicsGridLayout (tbgrid_ member) and QGraphicsLayoutItem
(indexOf/removeItem signatures) directly. Some Qt5 header
apparently pulled these in transitively; Qt6's leaner headers
don't, so the class fields/methods silently failed to resolve
and the compiler picked bogus 'int*' overloads instead.
Other files in the same directory already get these symbols
either via the <QtWidgets> umbrella header or a direct include,
so this was an isolated gap.
2026-07-17 10:26:26 +02:00
scorpio810 62dc1e7c11 Fix QRegularExpression API misuse in ElementsLocation::setXml (Qt6 path)
The Qt6 branch of the #if QT_VERSION guard swapped QRegExp for
QRegularExpression but kept calling QRegExp-only methods
(exactMatch()/cap()), which QRegularExpression doesn't have.
Use the correct QRegularExpression API instead: match() returns
a QRegularExpressionMatch, tested with hasMatch() and read with
captured(n).
2026-07-17 10:26:17 +02:00
scorpio810 fea4752a06 Fix remaining Qt6 build errors after PR #540
- qetxml.h: add missing <QUuid> include (used in propertyUuid/
  createXmlProperty signatures but never included directly).
- machine_info.cpp: fix ambiguous QString/int operator> in
  send_info_to_debug() for it1/it2/it3; just count every
  matching file found instead of the meaningless comparison.
2026-07-17 10:25:49 +02:00
Laurent Trinques 424a1c945e Try to fix compile with cmake .. -G Ninja -DQT_VERSION_MAJOR=6 -DBUILD_WITH_KF5=OFF -DPACKAGE_TESTS=OFF 2026-07-17 10:25:30 +02:00
Kellermorph b025bd205d Implement slave contact groups — label transfer, terminal assignment and UI fixes 2026-07-17 09:47:32 +02:00
Laurent Trinques 118a62adb2 Merge pull request #540 from DieterMayerOSS/cleanup/qt6-deprecation-warnings
Cleanup/qt6 deprecation warnings
2026-07-16 11:57:13 +02:00
Laurent Trinques 9a35d6c404 Merge pull request #541 from DieterMayerOSS/cleanup/qt6-remaining-warnings
Fix remaining Qt6 build warnings (narrowing, nodiscard, qHash)
2026-07-16 11:56:22 +02:00
Laurent Trinques e84180da21 Merge pull request #542 from DieterMayerOSS/fix/translation-build-race
Run lupdate only via an explicit update_translations target
2026-07-16 11:55:38 +02:00
Laurent Trinques a220a5320b Merge pull request #543 from DieterMayerOSS/doc/qt6-private-headers-dependency
Document qt6-base-private-dev as a Qt6 build dependency
2026-07-16 11:55:16 +02:00
Laurent Trinques 34bf63e237 Merge pull request #544 from DieterMayerOSS/fix/duplicate-folio-element-uuids
Renew element uuids when duplicating a folio
2026-07-16 11:54:48 +02:00