Files
qelectrotech-source-mirror/tests/qttest
ispyisail c0b8472665 Fix bugtracker #345: crash opening a project with an unlinked contact
A contact (slave) not linked to a coil has no element to take its label
from: DynamicElementTextItem::elementUseForInfo() returns null. Since
8985babfe (#978) the composite-text branch of updateLabel() called
element->actualLabel() without checking, so a text built from %{label}
on such a contact crashed QElectroTech while the project was loading
(QETProject::refresh -> Diagram::refreshContents). The project could not
be opened again.

Check the element as the ElementInfo branch above already does; with no
element, %{label} shows empty, as it did before 8985babfe.

Test: tst_resaveunchanged opens a blank project holding one unlinked
contact with a %{label} text. It fails without the fix (the --resave
crashes) and passes with it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 18:48:48 +13:00
..
2020-12-08 21:00:43 +01:00
2020-12-08 21:00:43 +01:00