Commit Graph

8802 Commits

Author SHA1 Message Date
plc-user 6bf6a17dc9 update German translations 2026-08-10 21:33:24 +02:00
plc-user 550e085b82 Merge pull request #693 from ispyisail/fix/color-editor-crash-bug323
Fix crash changing dynamic text color and confirming with Enter (bugtracker #323)

Works like charm: 
- color is updated immediately
- no additional errors or warnings 
- no crash anymore!
2026-08-10 21:24:04 +02:00
Laurent Trinques 9fd951152a Merge pull request #708 from Kellermorph/fix-german-translation
Update German from Folie to Seite
2026-08-10 18:28:38 +02:00
Kellermorph 7debaa5504 Update German from Folie to Seite 2026-08-10 17:55:59 +02:00
ispyisail b0b5345e15 Commit font/color edits immediately instead of waiting for an unrelated click
plc-user on PR #693: the crash is fixed, but the color/font field and
the on-diagram text no longer update until you leave the properties
list and click in the diagram -- previously it updated as soon as you
clicked OK.

That's a side effect of the crash fix itself. The old, crashing code
returned a *live* QColorDialog as the item view's editor; clicking its
OK button called accept()/hide() on it, and hiding the active editor
happens to trip the base delegate's own focus-lost commit path -- so
the value applied immediately, racily, as a side effect of the same
mechanism that crashed on Enter. The fix (commit 4bd9b6b21) replaced
that with running the dialog synchronously inside createEditor() and
returning an inert placeholder with the result stashed in a property.
Correct for the crash, but it also removed that accidental commit
trigger: the placeholder never had focus to lose, so nothing tells
the view to read the value back until some unrelated interaction
(clicking away) incidentally triggers it.

Fix: explicitly emit commitData()/closeEditor() for the resolved
editor, deferred via QTimer::singleShot(0, ...) since the view only
registers createEditor()'s return value as "the active editor" after
createEditor() itself returns -- emitting synchronously, before
returning, would target a widget the view doesn't know about yet.
Applied to both font and color, since both share the exact same
"resolve synchronously in createEditor(), return an inert
placeholder" shape and thus the exact same gap; font just hadn't been
reported.

Verified with the same standalone harness from the crash fix (real
QTreeView + DynamicTextItemDelegate + QAbstractItemView::edit()),
this time deliberately *not* sending the synthetic Enter keypress the
crash-fix verification needed: clicks the dialog's real OK button,
lets the event loop run, and confirms the picked color lands in the
model on its own. Also reconfirmed the crash fix itself still holds
(clean exit, no synthetic-Enter needed either way now) and did a full
Release build (504/504) with no new warnings.
2026-08-10 20:30:05 +12:00
plc-user d9638ad746 adjust some German texts 2026-08-09 22:47:13 +02:00
plc-user ea8eeb02c3 adjust some German texts 2026-08-09 21:46:53 +02:00
Laurent Trinques 5e4c423a7d Merge pull request #700 from Kellermorph/update-auto-break
Follow up Auto-break conductors
2026-08-09 21:33:30 +02:00
Laurent Trinques 7f75500023 Merge pull request #694 from IBSYSLevi/feature/center-rotation-option-for-textfields
Feature added: Rotation point center property for dynamic text fields
2026-08-09 21:09:19 +02:00
Laurent Trinques cdf5cad1e5 Merge pull request #698 from arummler/master-modernize-signal-slot
Migrate string based signal/slot to method pointer
2026-08-09 21:08:28 +02:00
plc-user 3a3f23b7a8 swap position of ComboBox and static text in config-page 2026-08-09 20:55:01 +02:00
plc-user 1f7107a7b6 Merge pull request #703 from Kellermorph/fix-plc-warnings
Compile-warnings have been fixed as requested.
2026-08-09 20:36:56 +02:00
Andre Rummler 7cb1e7394e Revert accidental German translation changes 2026-08-09 19:35:55 +02:00
Andre Rummler b91aaacad9 Re-adding connects (migrated) which got lost unfortunately during the migration and repeated merging. 2026-08-09 19:25:56 +02:00
Andre Rummler 1f3c28992c Merge remote-tracking branch 'origin/master' into master-modernize-signal-slot 2026-08-09 19:03:29 +02:00
Kellermorph 5e02111600 Fix-PLC-Warnings 2026-08-09 18:27:20 +02:00
Levi Jetzer a3d348fdcd Updated .ts files to resolve potential merge conflicts 2026-08-09 15:37:46 +02:00
Levi Jetzer c1d892c496 Merge remote-tracking branch 'origin/master' into feature/center-rotation-option-for-textfields
# Conflicts:
#	lang/qet_de.ts
#	lang/qet_en.ts
2026-08-09 15:31:52 +02:00
plc-user 5b33c044c5 Merge pull request #660 from ispyisail/feature-rotate-group
Add "rotate group" to actually rotate a selection as a whole
2026-08-09 12:51:37 +02:00
Andre Rummler c7ed3229d0 Migrating more SLOT() macros. 2026-08-09 12:30:15 +02:00
Andre Rummler 79cd91bd1c Merge branch 'master' into master-modernize-signal-slot 2026-08-09 12:20:46 +02:00
Laurent Trinques b7fc0c79cb Merge pull request #679 from arummler/master-fix-division-by-zero
Fixing minimum width calculation for title block
2026-08-09 12:15:29 +02:00
Andre Rummler fca1e0993b Remaining signal/slot migration and clean-up after the latest merge. 2026-08-09 11:51:23 +02:00
Andre Rummler 9f283322a2 Merge branch 'master' into master-modernize-signal-slot 2026-08-09 11:30:27 +02:00
Laurent Trinques 09983efe05 ci(windows-msi): switch cron to monthly, bump artifact retention 2026-08-09 11:23:13 +02:00
Laurent Trinques 76ff69e912 ci(windows-build): switch cron to monthly, bump artifact retention
Weekly cron replaced with a monthly run (1st of each month, 02:00 UTC)
to reduce unnecessary CI load.

retention-days raised from 14 to 40 across all six artifact uploads
(Qt5 + Qt6 tracks) to cover the new monthly interval with a safety
margin -- 14 days was shorter than the gap between two cron runs,
so the latest build's artifacts could expire before the next one
replaced them.
2026-08-09 11:19:48 +02:00
Laurent Trinques 779602372a Merge pull request #662 from arummler/master-fix-slot
Fix broken signal/slot relations
2026-08-09 10:55:42 +02:00
Kellermorph d95e744494 autoBreakConductors: share conductors_handled/used_terminals across batch
When multiple elements are pasted or moved in one batch, each call to
autoBreakConductors() now receives the shared state from the previous
call.  This prevents two elements in the same batch from independently
claiming the same conductor, which would result in a double-delete on
redo().

Requested by ispyisail in PR review.
2026-08-09 09:11:40 +02:00
Laurent Trinques 1317f137c0 Merge pull request #699 from Kellermorph/german-translation
Update German translation
2026-08-09 07:39:52 +02:00
Andre Rummler 201bd4c5f6 Migration of signal/slot to method pointer continued. Mostly simple cases. 2026-08-09 01:34:22 +02:00
Andre Rummler c12137c5a0 Fixing the connect for requestForNewDiagramAt -- typo during on-the-fly migration during merge. 2026-08-09 00:13:51 +02:00
Andre Rummler 5adf61936b Merge branch 'master' into master-modernize-signal-slot 2026-08-08 23:13:42 +02:00
Kellermorph 39b1e836bf Follow up Auto-break conductors 2026-08-08 22:10:47 +02:00
Andre Rummler f076df77da Migrating more signal/slot connects to modern system.
openTitleBlockTemplate needs a lambda: its matching overload has a default bool argument, so its pointer-to-member type
requires two parameters regardless of the default, while the signal provides only one -- no cast alone can both resolve the overload and
connect to a single-argument signal.

setAutoNum(QString)/setAutoNum(int,int) is a sender-side signal overload which needed a qOverload<QString> to match setFolioAutonum's
single-argument slot.
2026-08-08 21:57:53 +02:00
Andre Rummler b3de01d171 Migrating more signal/slot to the new member pointer system. Unlike the earlier signal-side overload fixes (QComboBox/QSpinBox
etc.), these three are ambiguous on the *slot* side:
activateProject(QETProject*)/activateProject(ProjectView*),
closeProject(ProjectView*)/closeProject(QETProject*), and
showError(const QETResult&)/showError(const QString&) each have two declarations on QETDiagramEditor. &QETDiagramEditor::activateProject
etc. alone won't compile with two candidates present; qOverload<T>() picks the one matching the actual signal's argument type, same as
the old SIGNAL()/SLOT() macro text did implicitly.
2026-08-08 21:50:28 +02:00
Andre Rummler 90950075bf Three connects paired a zero-argument signal with a slot that has a default-valued parameter (e.g. void applyEnable(bool = true)).
Default arguments aren't part of a function's pointer-to-member type, so &Class::slot has a type requiring the argument regardless of its
default value -- incompatible with a signal providing none, and &Class::slot alone won't compile against these signals at all.
When migrating to the modern member pointer connect, replaced  with a lambda that calls the slot with no arguments, letting
the default apply exactly as before.

- SelectAutonumW::applyEnable(bool = true), connected to each  NumPartEditorW's changed() signal in both setContext() and
  on_add_button_clicked(). The corresponding disconnect() in on_remove_button_clicked() is removed rather than reimplemented: a
  lambda-based connection can't be matched and removed by a  separately-written disconnect() call, and the explicit disconnect
  was already redundant -- the very next line deletes the part object, which Qt automatically disconnects on destruction (the same
  guarantee setContext()'s own qDeleteAll() cleanup already relies  on).
- PartText::adjustItemPosition(int = 0), connected to QTextDocument::contentsChanged().
- ExportDialog::slot_changeFilesExtension(bool = false), connected to ExportPropertiesWidget::formatChanged().
2026-08-08 21:39:31 +02:00
Andre Rummler a668ccfa90 Migrating the remaining signal/slot connects with an ambigious activated(int) via qOverload<int>,
since QComboBox::activated(QString) still exists pre-Qt6 and makes &QComboBox::activated alone ambiguous:

- StyleEditor: outline_color/line_style/size_weight/filling_color,
  both connect (activeConnections(true)) and disconnect
  (activeConnections(false)) branches. antialiasing's stateChanged(int)
  connect modernized alongside them (single signal, no disambiguation
  needed).
- TitleBlockTemplateCellWidget: cell_type_input_ (two connects to
  different slots), horiz_align_input_, vert_align_input_, logo_input_.

Also modernises QETApp's system tray connect.

In two cases stateChanged already replaced with version guarded checkStateChanged for future proofing.
2026-08-08 21:29:17 +02:00
Kellermorph ad200e28c7 Update German translation 2026-08-08 20:15:07 +02:00
Levi Jetzer 3424ba50bd Fix transform origin not applied on load or delayed activation
setTransformOriginPoint() was only applied inside
parentElementRotationChanged(), so loading an already-rotated element,
or enabling keep_visual_rotation while rotation_point_center was
already true, left the origin at (0, 0) until the next parent rotation.

Apply the origin directly in both setters so it's always in sync.

Added .ts files (de and en) to the commit
2026-08-08 20:06:32 +02:00
Andre Rummler 79da321ddc Missed a necessary overload in the previous commit. 2026-08-08 18:55:01 +02:00
Andre Rummler 293e61abeb Modernizes the signal/slot connect and solves the disambiguities of the remaining currentIndexChanged(int) connects via qOverload<int>, since
QComboBox::currentIndexChanged(QString) still exists pre-Qt6.

TitleBlockTemplateLocationChooser: collections_ -> updateTemplates() (a virtual method; pointer-to-member dispatch still resolves to the
TitleBlockTemplateLocationSaver override at runtime as expected)
TitleBlockTemplateLocationSaver: templates_ -> updateNewName()
TitleBlockPropertiesWidget: m_tbt_cb -> changeCurrentTitleBlockTemplate(int)
XRefPropertiesWidget: m_type_cb -> typeChanged(), m_snap_to_cb ->enableOffsetSB(int), both connect (constructor) and disconnect(destructor)
2026-08-08 18:37:53 +02:00
Andre Rummler 438e2ade3a Modernize and fix buttonClicked connects.
Two QButtonGroup::buttonClicked overload-ambiguity fixes, plus cleanup of the connects sitting alongside them:

TitleBlockDimensionWidget: switched from the deprecated buttonClicked(int) id-based overload to buttonClicked(QAbstractButton*),
disambiguated via qOverload. The slot doesn't use the argument either way, so this is a pure modernization with no behavior change.
ExportPropertiesWidget: same buttonClicked fix for exported_content_choices, plus modernized the adjacent
currentIndexChanged(int) relay (disambiguated via qOverload, since QComboBox::currentIndexChanged(QString) still exists pre-Qt6) and
six QCheckBox::stateChanged(int) relays (single signal, no disambiguation needed).

QCheckBox::stateChanged(int) is deprecated as of Qt 6.7 in favor of checkStateChanged(Qt::CheckState), but this project has no Qt6 minor
version floor pinned in CMakeLists.txt, so stateChanged(int) remains the correct unconditional choice for now. QT_VERSION_CHECK(6, 7, 0) guarded
checkStateChanged was introduced to avoid future warnings.
2026-08-08 18:25:08 +02:00
Andre Rummler bfee5b1cdb Merge branch 'master' into master-fix-slot 2026-08-08 15:16:48 +02:00
Laurent Trinques 3eafe840f1 Merge pull request #656 from ispyisail/feature-last-used-style
Remember last-used shape/text style for new items this session
2026-08-08 14:22:52 +02:00
Laurent Trinques e38493c308 Merge pull request #697 from ispyisail/feature/autonum-inline-increment
Edit increment and preview the next number in the auto-numbering dock (bugtracker #331)
2026-08-08 13:53:23 +02:00
Laurent Trinques 5abf890b24 Merge pull request #695 from ispyisail/fix/dark-theme-element-icons-bug335
Fix invisible element icons on dark themes in two dialogs missed by the earlier fix (bugtracker #335)
2026-08-08 13:50:36 +02:00
Laurent Trinques 037d5a13cd Merge pull request #696 from ispyisail/fix/current-date-preset-bug308
Fix "use current date" preset lost unless the Folio tab is active on save (bugtracker #308)
2026-08-08 13:45:48 +02:00
ispyisail cd7388985e Edit increment and preview the next number in the auto-numbering dock
Bug #331: "Il serait intéressant de pouvoir directement dans la fenêtre
'Sélection numérotation auto' modifier la valeur d'incrément et visualiser
la prochaine numérotation qui sera appliquée. Ceci sans être obligé
d'ouvrir la page de configuration."

The dock (AutoNumberingDockWidget) already let you see and edit a rule's
*current* value inline (added in 52c8ef6b4/031710b5f/ee4ba82d2). The
increment itself, and any preview of where the numbering is headed, was
reachable only through Configurer -> the full project-properties dialog.

Two new widgets per row (conductor/element/folio):

- An increment spin box, read from and written to the same NumerotationContext
  field NumPartEditorW's increase_spinBox already edits in the full dialog --
  same data, second place to reach it.
- A read-only next-value field, computed via
  NumerotationContextCommands::next() -- the identical engine the "Suivant"
  button in the full dialog already uses to step a whole context. Reusing it
  rather than reimplementing the arithmetic means wrap-and-carry between parts
  comes out identical to what actually happens when the number is next
  consumed, and zero-padding matches real rendering
  (NumerotationContext::formatValue(), mirroring
  autonum::setSequentialToList()'s padding rule by hand since that function is
  local to assignvariables.cpp).

NumerotationContext gains replaceIncrease(index, increase), a sibling to the
existing replaceValue() that touches only the increment field.

Every refresh call site in the file (13 of them) previously refreshed just the
value field; they now go through a new refreshRow(category), which refreshes
value + increment + next-value-preview together via a small per-row widget
bundle (rowFor()). This also let resetAutoNum()'s three-way switch collapse to
one line, and refreshValueFields()'s three near-identical blocks collapse to a
loop -- both existing before this change, not new here.

Verified live under Xvfb: created an element numbering rule "K" (Chiffre 1,
value 1, increment 1) via the full dialog, confirmed the dock showed
Valeur=1/Incrément=1/Suivant=2. Changed the dock's own Incrément to 3 --
Suivant updated live to 4, no dialog needed. Changed Valeur to 10 -- Suivant
became 13. Reopened the full configuration dialog and confirmed it read back
the same value_field=10/increase_spinBox=3, i.e. the round trip through
replaceIncrease()/storeContext() does not disturb type, initial value, modulus
or format.

Builds clean, CMake/Ninja Release, Qt 5.15, 820/820, no new warnings.

Fixes: https://qelectrotech.org/bugtracker/view.php?id=331

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 23:10:54 +12:00
ispyisail 5ba08284f5 Fix "use current date" preset being lost unless the Folio tab is active on save
Bugtracker #308: the "current date" preset for a project's default
title block doesn't persist. A later comment on the report pinpointed
it exactly: the setting falls back to "No date" unless the folio tab
remains active when saving settings, and the same happens in Project
Properties.

TitleBlockPropertiesWidget::properties() (and its near-duplicate
sibling propertiesAutoNum(), copy-pasted with the same bug) reads the
date radio buttons like this:

    else if (ui->m_current_date_rb->isVisible() && ui->m_current_date_rb->isChecked()) {
        prop.useDate = TitleBlockProperties::CurrentDate;
        ...

Both the New Project settings page and Project Properties embed this
widget as one page of a QTabWidget (NewDiagramPage, in
configpage/configpages.cpp). QWidget::isVisible() depends on the
whole ancestor chain being visible, not just the widget's own state --
switch to any other tab before clicking OK/Apply and this radio
button's isVisible() goes false even though it's still checked
underneath, silently falling through all three branches. The function
returns a default-constructed TitleBlockProperties for the date
fields (useDate = UseDateValue, date = QDate(), i.e. "no date"),
matching exactly what was reported.

Fix: use isHidden() instead, which reflects only this widget's own
explicit state and mirrors the read side's own check in
setProperties()/initDialog() just above it in the same file -- that
side already uses isHidden(), not isVisible(), for the identical
"is the current-date option even offered here" question.

Verified directly: a standalone Qt program constructing the real
NewDiagramPage, checking "current date", switching the tab widget
away from Folio to Conducteur (reproducing the report's exact
trigger), then calling applyConf() and reading back the QSettings
value. Against the original code this saves date="null"; with the
fix, date="now" -- the same scenario, same tab switch, only the one
line differs. Also confirmed a full Release build (504/504, CMake/
Ninja, Qt 5.15.18) with no new warnings.
2026-08-08 23:02:07 +12:00
Andre Rummler 4a95efbfe6 TitleBlockTemplate::minimumWidth() divided by (100.0 - sum(RelativeToTotalLength)) without guarding against a zero or negative denominator. When a template's relative-to-total-length
columns summed to exactly 100% (e.g. the shipped A4_1.titleblock), this produced qRound(NaN), which fatally aborted under Qt6's stricter qCheckedFPConversionToInteger assertion -- reached via
double-clicking a title block template to edit it.

Introduce TitleBlockTemplate::classifyWidthConstraint(), shared by minimumWidth() and maximumWidth(), returning std::optional WidthConstraintCase> to distinguish three non-finite outcomes:
Unconstrained (RTT columns == 100%, no absolute columns -- an ordinary, valid template), RelativeWidthExceeds100Percent (RTT alone exceeds 100%), and AbsoluteColumnsExceedRemainingWidth (RTT == 100%
with at least one absolute column also present) -- the latter two meaning the template's columns cannot be laid out at any width.
maximumWidth() previously only checked "are all columns absolute", which incorrectly reported "no upper bound" for the two unsatisfiable cases above; it now shares the same classification, so both functions
agree.

Update TitleBlockTemplateView::updateDisplayedMinMaxWidth() to show distinct, accurate tooltip text for all four cases instead of printing the old std::numeric_limits<int>::max()
sentinel or a misleading "no constraint" message for an unsatisfiable template.

Manually verified all four cases: a normal template (finite width), A4_1.titleblock (Unconstrained), an over-100% RTT template
(RelativeWidthExceeds100Percent), and RTT==100% with an absolute column present (AbsoluteColumnsExceedRemainingWidth).

Translations still partially missing.
2026-08-08 12:31:45 +02:00