Files
qelectrotech-source-mirror/tests
Beat Hangartner 1e3c618495 Let free texts keep a width they wrap to
A free text (IndependentTextItem) gets a textWidth property: -1 is the
automatic width (one line, or lines broken by hand, as today); a
positive width makes the text wrap between words. Its top-left corner
stays in place. The property is what a spin box and resize handles will
set in follow-up changes.

File format: the width is saved as text_width on <input>, only when one
is set, so a project without widths is saved byte-identical
(tst_resaveunchanged). An older QElectroTech ignores the attribute and
shows the text on one line, with no load error.

DiagramTextItem::setHtml() no longer widens a centred or right-aligned
rich text to idealWidth() + 40 when the text has a width of its own;
with the automatic width it still does.

Test: tst_freetextwidth (--resave keeps the width only where set,
--export-svg draws the text wrapped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:52:27 +02:00
..
2026-10-04 20:59:17 +02:00
2020-12-08 12:18:20 +01:00