Commit Graph

8549 Commits

Author SHA1 Message Date
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
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
Laurent Trinques 8884e79133 Delete QElectroTech.qch files 2026-07-15 06:19:52 +02:00
Dieter Mayer 20a7047b27 Renew element uuids when duplicating a folio
The project panel's "copy and paste" action duplicates a folio through
an XML round-trip (toXml/fromXml), and Element::fromXml adopts the uuid
stored in the XML - so every element on the duplicated folio kept the
uuid of its source element. On-diagram copy/paste already handles this
(PasteDiagramCommand::redo() calls newUuid()), but the folio-duplicate
path bypasses that command.

Since element.uuid is the PRIMARY KEY of the project database, the
duplicated elements failed to insert ("UNIQUE constraint failed:
element.uuid" spam in the log) and silently disappeared from
nomenclature/summary tables, even though they are valid on the folio.

Renew the uuid of every element on the freshly duplicated folio, exactly
as the paste command does. In-memory links established during fromXml
are pointer-based and unaffected; the new uuids are written on save.
2026-07-14 19:48:31 +02:00
Dieter Mayer b7a8759cc6 Document qt6-base-private-dev as a Qt6 build dependency
On Debian/Ubuntu qt6-base-dev ships the Qt6::GuiPrivate CMake config but
the actual private headers live in the separate qt6-base-private-dev
package, so find_package succeeds and CMake only fails later at generate
time with a non-obvious "non-existent path" error. QET genuinely needs
the private QtGui API (QPdfEngine) for clickable hyperlinks in the PDF
export, so document the package instead of degrading the feature.
Observed on Ubuntu 26.04 LTS (Qt 6.10.2); Debian sid and the Qt online
installer ship the headers together.
2026-07-14 19:31:07 +02:00
Dieter Mayer 46f479240e Run lupdate only via an explicit update_translations target
The default build ran both lupdate (qt5_create_translation, which
rewrites the tracked .ts files in the source tree) and lrelease
(qt5_add_translation, which reads the same .ts files). Under high
parallelism lrelease could read a .ts while lupdate was rewriting it,
failing the build with "Premature end of document"; every build also
modified tracked files as a side effect, and each .qm was generated
twice (once into the build dir, once into lang/).

Keep only lrelease in the default build and move lupdate behind an
explicit developer target (cmake --build . --target update_translations).
The target scans sources/ instead of the whole source tree, which also
stops lupdate from parsing unrelated third-party .js files.
2026-07-14 19:29:19 +02:00
Dieter Mayer a0f66d22cc Fix remaining Qt6 build warnings (narrowing, nodiscard, qHash)
Clears the 9 non-deprecation warnings from the Qt6 build:
- qHash(QColor): hash rgba() (unambiguous QRgb) instead of name(), and
  use the size_t seed signature on Qt6 (guarded for Qt5). Fixes the
  ambiguous-overload warning in terminalstripmodel.h.
- Two qsizetype->int narrowings in brace-init: explicit static_cast<int>
  (elementscene.cpp, terminalstrip.cpp).
- main.cpp: keep the QtConcurrent::run QFuture in a [[maybe_unused]]
  variable (nodiscard).
- qetapp.cpp: guard the stylesheet load on QFile::open() succeeding
  (nodiscard) instead of ignoring the result.
2026-07-14 19:27:37 +02:00
Dieter Mayer d5027c4ef9 Replace deprecated QVariant::canConvert(int)
QVariant::canConvert(int) is deprecated in Qt6. Use the non-deprecated
canConvert<T>() template (canConvert<QString>() / canConvert<int>()),
which is available on Qt5 too. Clears the last 2 -Wdeprecated-
declarations warnings.
2026-07-14 19:27:18 +02:00
Dieter Mayer e099fca5ad Guard Qt6-only deprecation replacements for Qt5 compatibility
Three deprecated APIs have replacements that only exist in newer Qt6:
- QLocale::nativeCountryName() -> nativeTerritoryName() (Qt 6.2)
- QDomDocument::setContent() overload -> ParseResult (Qt 6.5)
- qt_ntfs_permission_lookup -> QNtfsPermissionCheckGuard RAII (Qt 6.6)
Each is wrapped in QT_VERSION_CHECK so Qt5 keeps the old path. Clears
4 -Wdeprecated-declarations warnings.
2026-07-14 19:27:18 +02:00
Dieter Mayer f57c921b78 Fix trivial Qt6 deprecations (QString::count, QColor::setNamedColor)
QString::count() (no-arg) is deprecated -> size(); QColor::setNamedColor()
is deprecated -> the QColor(QString) constructor. Both replacements are
non-deprecated on Qt5 too. Clears 2 -Wdeprecated-declarations warnings.
2026-07-14 19:27:17 +02:00
Dieter Mayer c3392bf025 Wrap deprecated QSqlDatabase::exec() in QSqlQuery
QSqlDatabase::exec(const QString&) is deprecated in Qt6. Route the
PRAGMA/CREATE TABLE statements through QSqlQuery(db).exec() instead.
Clears 11 -Wdeprecated-declarations warnings; same statements, same
database connection, no behavioural change.
2026-07-14 19:27:17 +02:00
Dieter Mayer 7e08cd1285 Replace deprecated QVariant::Type with QMetaType in UserProperties
QVariant::type() and the QVariant::Type enum are deprecated in Qt6.
Switch on userType() (non-deprecated, returns the QMetaType id and
works on Qt5 too) with QMetaType enum cases. Clears 6 -Wdeprecated-
declarations warnings; the numeric type ids are unchanged.
2026-07-14 19:27:17 +02:00
Dieter Mayer 1265e51ebe Replace deprecated qAsConst with std::as_const
qAsConst was deprecated in Qt 6.6; std::as_const (C++17, already the
project standard) is the drop-in replacement. Clears 46 -Wdeprecated-
declarations warnings across 18 files. No behavioural change.
2026-07-14 19:27:16 +02:00
Laurent Trinques 5c65bf6486 Merge pull request #539 from DieterMayerOSS/add-qet-de-qm
Add compiled qet_de.qm for the completed German translation
2026-07-12 11:04:40 +02:00
Dieter Mayer 64a0c7abf5 Add compiled qet_de.qm for the completed German translation
Regenerate lang/qet_de.qm from lang/qet_de.ts with lrelease so the
committed binary matches the strings completed in #538
(2621 finished, 0 unfinished for de_DE).
2026-07-12 09:29:35 +02:00
Laurent Trinques 0ef47ce9b9 fix typo on publiccode.yml 2026-07-12 08:27:52 +02:00
Laurent Trinques 96e283a25b fix typo on publiccode.yml 2026-07-12 08:05:58 +02:00
Laurent Trinques f16ebeb2a6 Add publiccode.yml 2026-07-12 07:53:24 +02:00
Laurent Trinques b97a87c889 Merge pull request #537 from DieterMayerOSS/fix-collection-names-base-language
Fall back to the base language for element and folder names
2026-07-11 23:15:12 +02:00
Laurent Trinques 81d0045514 Merge pull request #538 from DieterMayerOSS/complete-german-terminal-translations
Complete German translation of unfinished terminal-label strings
2026-07-11 22:28:19 +02:00
Dieter Mayer b6124b065c Complete German translation of unfinished terminal-label strings
qet_de.ts had 20 unfinished entries in the PartTerminal and
TerminalEditor contexts: 12 empty ones (shown in French at runtime,
since French is the source language of the tr() literals) and 8 that
already carried German text but were still flagged unfinished.

Translate the 12 empty strings, matching the terminology already
established in these contexts (borne/terminal -> "Anschluss",
label -> "Beschriftung", cadre -> "Rahmen", police -> "Schriftart"),
and mark the 8 existing drafts as finished. lrelease now reports
2621 finished and 0 unfinished translations for de_DE.
2026-07-11 21:52:51 +02:00
Dieter Mayer c211b68139 Fall back to the base language for element and folder names
NamesList::name() looked up the display name using the full locale from
langFromSetting() (e.g. "de_DE") and jumped straight to English if it was
absent. Element and folder names in the collection are keyed by 2-letter
codes (<name lang="de">), so a "de_DE" UI showed the whole collection in
English/French even though German names exist.

Try the base language ("de") before the English fallback, mirroring what
setLanguage() already does for the UI translations.
2026-07-11 21:47:04 +02:00
Laurent Trinques 0f129ac504 git submodule update --remote elements 2026-07-11 06:47:58 +02:00
Laurent Trinques e23dc24283 Update translations files 2026-07-11 06:45:03 +02:00
Laurent Trinques 6d7b38c7a1 Merge pull request #536 from Kellermorph/terminal-name
Feature: Add terminal name label display in element editor
2026-07-10 15:11:49 +02:00
Kellermorph b543adcb46 Restore comments 2026-07-10 15:04:04 +02:00
Kellermorph f62ce7e4ca Update terminal name 2026-07-10 14:36:47 +02:00
Kellermorph c884d32dbe Feature: Add terminal name label display in element editor 2026-07-09 14:02:27 +02:00
Laurent Trinques 99ad9aa459 Merge pull request #535 from Kellermorph/translation
Add German translation
2026-07-08 13:33:58 +02:00
Kellermorph c1c72c5a62 Add complete German translation for QElectroTech 2026-07-08 07:09:23 +02:00
Laurent Trinques eeabea10f0 Update translations files 2026-07-08 06:57:07 +02:00
Laurent Trinques e034cfe9cf Merge pull request #534 from Kellermorph/safety-check
feat: add backup dialog when opening an existing project
2026-07-08 06:34:13 +02:00
Kellermorph 2db6c3968a feat: add backup dialog when opening an existing project 2026-07-07 21:42:45 +02:00
Laurent Trinques 14253930ae Merge pull request #509 from Kellermorph/master
Add Custom Guides
2026-07-07 16:34:56 +02:00
Laurent Trinques ec0a9f45d3 Update windows-msi.yml 2026-07-06 18:43:55 +02:00
Laurent Trinques 1121ccea26 Fix ci: update GitHub Actions to latest major versions 2026-07-06 17:57:37 +02:00
Laurent Trinques 94cc9cfef5 Fix ci: update GitHub Actions to latest major versions 2026-07-06 17:54:46 +02:00
Laurent Trinques 346aad75fd Fix ci: update GitHub Actions to latest major versions 2026-07-06 16:49:51 +02:00
Laurent Trinques 2b8cdd3d67 ci: update GitHub Actions to latest major versions 2026-07-06 16:46:54 +02:00