Commit Graph

10223 Commits

Author SHA1 Message Date
Laurent Trinques e107c9444f Merge pull request #1356 from ispyisail/fix/composite-text-variable-insert
Fix composite text dialog not inserting variables (#1348)
2026-10-07 06:42:54 +02:00
Laurent Trinques a79eaf8af6 Merge pull request #1345 from bhangart/fix/unreadable-element-test-windows
Skip tst_unreadableelement where a file cannot be made unreadable
2026-10-07 06:41:12 +02:00
Laurent Trinques 223ace3a40 Merge pull request #1347 from saschbe/fix/background-color-menu-title
fix: name the sheet background color submenu
2026-10-07 06:39:00 +02:00
Laurent Trinques 5c38907204 Merge pull request #1346 from ispyisail/fix/1336-edit-menu-submenus
Fix #1336: split the long Edit menu into submenus
2026-10-07 06:38:22 +02:00
Laurent Trinques 211075f1b3 Merge pull request #1343 from bhangart/feature/element-editor-text-field-handles
Resize text fields in the element editor by dragging a corner
2026-10-07 06:36:48 +02:00
Laurent Trinques e2fd2d1c20 Merge pull request #1342 from bhangart/feature/free-text-resize-handles
Resize free texts by dragging a corner
2026-10-07 06:36:06 +02:00
Laurent Trinques 96fc0b9d4a Merge pull request #1341 from bhangart/feature/free-text-width-spinbox
Set the width of free texts in their properties
2026-10-07 06:35:17 +02:00
Laurent Trinques 60237d7070 Merge pull request #1353 from ispyisail/feat/dxf-block-data
Add symbol part data to DXF blocks as hidden attributes (#1339)
2026-10-07 06:34:16 +02:00
Laurent Trinques 9396a367db Merge pull request #1352 from ispyisail/feat/dxf-block-labels
Add an option to export symbol texts as DXF block attributes (#1339)
2026-10-07 06:33:37 +02:00
Laurent Trinques 7e9b479a57 Merge pull request #1351 from ispyisail/feat/dxf-symbol-blocks
Add an option to export symbols as DXF blocks (#1339)
2026-10-07 06:32:51 +02:00
Laurent Trinques 3d5100789b Merge pull request #1350 from ispyisail/fix/1339-dxf
Fix DXF export of circles, arcs and right-side title blocks (#1339)
2026-10-07 06:31:57 +02:00
Laurent Trinques 36d0b06f0f Merge pull request #1349 from saschbe/fix/image-dark-colours
Preserve imported image colours by default in dark mode
2026-10-07 06:29:32 +02:00
Beat Hangartner 1fdb0ee32e Skip tst_unreadableelement on Windows only
The skip applied wherever setPermissions() failed, which on Linux and
macOS would hide a real failure. Only Windows cannot take read
permission away; elsewhere the call must succeed as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 01:51:00 +02:00
Beat Hangartner 9882a79a93 Refresh the free text handles when the text comes back to a folio
itemChange() removed the corner handles when the text left the scene
but did not bring them back when it returned still selected, which Qt
allows (undoing a scripted delete does it) without a selection change.
Refresh on every scene change. The two handle helpers are protected:
nothing outside the class calls them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 01:51:00 +02:00
Beat Hangartner 2c9900eca8 Make 0 the automatic width in the free text width box
The box showed Auto for -1 while IndependentTextItem::setTextWidth()
treats every value up to 0 as automatic. Typing 0, or the first click
on the up arrow from Auto, then put a width change in the undo history
that changed nothing, left the box on 0, and in live edit every later
change of X, Y, angle, text or size was replaced by that empty command.
Auto is 0 in the box now, like in the setter: no number is the automatic
width, and the first step up is 1 px.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 01:51:00 +02:00
Beat Hangartner 2e4982e871 Drop a check that cannot trigger in the element editor
A dynamic text field is never edited inline in the element editor (it
never sets text interaction flags), so the handles never had to hide
for it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 01:50:05 +02:00
ispyisail b9d459b0e6 Fix composite text dialog not inserting variables under Qt 6 (#1348)
The slot was auto-connected by name to QComboBox::activated(QString),
which Qt 6 removed, so connectSlotsByName() found no signal and picking
a variable in the "Texte composé" dialog did nothing. activated(int)
exists in Qt 5 and Qt 6; the slot never used its argument and reads
currentData() as before.

Same fix as the CompositeTextEditDialog half of #674, which was closed
unmerged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 12:49:37 +13:00
ispyisail aa6abe6e81 Export a symbol's part data as hidden attributes of its DXF block (#1339)
With symbols as blocks, every non-empty information field of a symbol
(label, manufacturer, reference, supplier, quantity...) is written as a
hidden attribute of its INSERT, tagged with the field's name. A CAD
program can then list the parts from the drawing, as with AutoCAD's
attribute extraction; hidden, they change nothing on screen, in any
reader. A field already written as a visible attribute (with
--dxf-attributes) is not repeated. The label formula is left out: it is
how the label is made, not part data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 10:14:13 +13:00
ispyisail 9699b314b0 Add an option to export a symbol's texts as DXF block attributes (#1339)
With symbols as blocks and the new "DXF : textes des symboles en
attributs" option (--dxf-attributes on the command line), a symbol's own
texts (its label, function, comment...) are attributes of its INSERT
instead of loose texts, so a CAD program moves them with the symbol and
can list or edit them. Each is written exactly where, and as, the text
was. A text showing an information field is tagged with its name
(LABEL, FUNCTION...), a typed text TEXT1, TEXT2...; a text's second line
gets _2. The block defines each tag once, placed where the first symbol
has it.

Its own option, off by default, because LibreCAD (2.2.1.5) does not
show attributes: the labels would vanish there. AutoCAD shows them.

The text geometry moves into textLines(), shared with the text loop,
so the attributes and the plain texts cannot drift apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 10:12:20 +13:00
ispyisail c3ed2daca8 Add an option to export symbols as DXF blocks (#1339)
With "DXF : symboles en blocs" ticked in the export dialog, or
--dxf-blocks on the command line, each symbol definition a folio uses is
written once as a DXF block and every placed symbol as an INSERT of it.
A CAD program then selects, counts and replaces a symbol as one object.

The block is drawn by the same code as a symbol drawn in full, as if
the symbol sat unturned at the folio's origin, which is DXF (0,
sheetHeight): that is the block's base point, so the INSERT carries the
symbol's position and quarter-turn and nothing else. Blocks have to come
before any entity, so the export collects them first and dxfBegin()
writes them in its BLOCKS section. Entities in a block keep their own
layers. Off by default; with it off the file is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 09:50:18 +13:00
ispyisail 83f72c95c6 Fix DXF export of circles, arcs and the title block at the right (#1339)
Circles and arcs: drawArcEllipse() split each curve into quarters and
fitted a circular ARC through a point half way between the curve and its
chord, so every circle came out as a flattened diamond. A circle or an
arc of one is now one exact CIRCLE or ARC. R10 has no ELLIPSE entity, so
a true ellipse is a polyline through the curve, one point every 5
degrees. The export also used a different scale on each axis, which made
round things oval; it now uses one, the largest that fits the sheet.

Title block at the right: the DXF laid the horizontal template out in
the narrow vertical strip, squashing it into the top corner. It is now
laid out horizontally and turned a quarter, as draw() turns the painter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 08:13:52 +13:00
saschbe 8ff5fbac0c Preserve imported image colours by default in dark mode 2026-10-06 21:09:41 +02:00
Sasch_be 0421ea1586 fix: name the sheet background color submenu 2026-10-06 20:46:25 +02:00
ispyisail 2867708369 Fix #1336: fold Edit menu families into submenus
The Edit menu had grown to 42 entries and no longer fitted on a laptop
screen; Qt wrapped it into a second column. Select, Group, Rows and
columns and Depth now sit one level down, as Add and Align already did.
Search for a command, Shortcut bar and Repeat move to the end, beside
Search/Replace. No action, label or shortcut changes: Ctrl+A was checked
to still select everything from inside the new Select submenu.

Lignes et colonnes was already built as a submenu for the folio's
context menu; the Edit menu now uses the same one instead of a flat copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 07:43:45 +13:00
Beat Hangartner 210a26b29e Skip tst_unreadableelement where a file cannot be made unreadable
anUnreadableSymbolIsNotACollision() takes every permission away from a
symbol file to check that an unreadable symbol is reported as such, not
as a collision. QFile::setPermissions() cannot do that on Windows, where
Qt only knows the read-only flag, so it returns false and the test
failed there. It now skips, as it already does when run as root, which
reads the file anyway.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-06 17:17:12 +02:00
Beat Hangartner 3c67147824 Resize text fields in the element editor by dragging a corner
In the element editor, a dynamic text field that is the only selected
item gets the corner handles of TextResizeHandles: dragging one sets
the width the field wraps to, keeping the opposite corner in place;
double-clicking a handle goes back to the automatic width. One undo
step per drag, on the editor's undo stack.

ElementScene keeps the handles of the same text when the undo stack
changes: pushing the resize itself calls managePrimitivesGroups()
again, and deleting the handles there would delete them while they are
still emitting.

No file format change (text_width on <dynamic_text> already exists).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 17:17:12 +02:00
Beat Hangartner 2989f6cb4b Resize free texts by dragging a corner
A selected free text gets the corner handles of the previous commit:
dragging one sets the width the text wraps to, keeping the opposite
corner in place; double-clicking a handle goes back to the automatic
width. One undo step per drag, on the folio's undo stack. The handles
are hidden while the text is typed in.

DiagramTextItem shows the handles for a subclass that asks for them
(textResizeHandlesWanted()); only free texts do for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 17:17:11 +02:00
Beat Hangartner b07378bf6e Set the width of free texts in their properties
A "Width" spin box in the properties of a free text sets the width it
wraps to (previous commit). "Auto" (-1) is the automatic width. It also
works with several selected texts, like the size and the angle; texts
with different widths show "Auto" and are left alone unless the box is
changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 17:17:11 +02:00
Laurent Trinques 0708338bce Merge pull request #1332 from bhangart/fix/autonumids-settings-dir
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m49s
Fix tst_elementautonumids on macOS and Windows: pass its settings through QET_SETTINGS_DIR
2026-10-06 16:57:40 +02:00
Laurent Trinques a498e91b53 Merge pull request #1334 from ispyisail/fix/msvc-qprinter-copy
Fix the Windows MSVC build broken by live mode printing (#1333)
2026-10-06 16:36:58 +02:00
Laurent Trinques 4e7cc65cb8 Merge pull request #1329 from ispyisail/fix/readme-kf6-links
Fix broken KDE Frameworks links in README (#1328)
2026-10-06 16:31:22 +02:00
Laurent Trinques 4af441f895 Merge pull request #1326 from ispyisail/feature/customise-shortcuts-page
Add icons, menu locations, key search and copy to the Shortcuts page
2026-10-06 16:29:26 +02:00
Laurent Trinques 1dfb70870f Merge pull request #1325 from ispyisail/feature/customise-command-ids
Add the missing folio editor commands to the Shortcuts page
2026-10-06 16:27:36 +02:00
Laurent Trinques 0e36f4efb6 Merge pull request #1324 from bhangart/fix/dxf-wrapped-text
Export wrapped texts to DXF line by line
2026-10-06 16:25:53 +02:00
Laurent Trinques 1a3a9e59f2 Merge pull request #1323 from bhangart/fix/element-editor-text-field-width-anchor
Keep an element editor text field in place when its width changes
2026-10-06 16:23:53 +02:00
Laurent Trinques 4432f6b5ab Merge pull request #1322 from bhangart/fix/element-editor-width-spinbox
Show "Auto" in the width box of element editor text fields
2026-10-06 16:22:02 +02:00
Laurent Trinques 33b0069e17 Merge pull request #1321 from bhangart/feature/text-resize-handles
Add corner handles to change the width of a text box
2026-10-06 16:19:42 +02:00
Laurent Trinques e4e8cc2892 Merge pull request #1320 from bhangart/feature/free-text-width
Let free texts keep a width they wrap to
2026-10-06 16:18:25 +02:00
Laurent Trinques 164f538d6a Merge pull request #1331 from ispyisail/fix/1306-free-terminal-table
Fix the free terminal table staying empty after a move (#1306)
2026-10-06 16:13:09 +02:00
Laurent Trinques 6a5ff20f51 Merge pull request #1310 from bhangart/fix/image-crop-undo
Undo the crop, colours and original of a picture together with its pixels
2026-10-06 16:12:13 +02:00
ispyisail ce6a88c98c Fix the MSVC build: QPrinter built through ?: in live mode print
MSVC stopped with C2280 at liveserver.cpp:861 (issue #1333): it copies
the result of the ?: expression, and QPrinter cannot be copied. GCC and
Clang build the object in place under C++17, so Linux and CI built.

QPrinter(info) gives the same printer in both cases: info is only set
when printing to a printer, and QPrinter() itself constructs with an
empty QPrinterInfo (qprinter.cpp, QPrinter::QPrinter(PrinterMode)).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 22:32:43 +13:00
ispyisail 306c682112 Fix the free terminal table staying empty after a move (#1306)
In the terminal strip manager, after a free terminal was moved into a
strip, clicking another free terminal showed nothing on the right. It
only came back after selecting a strip first.

The tree remembers whether a free terminal is selected and only tells
the window to update when that, or the selected strip, changes. Moving
a terminal rebuilds the tree, which clears the selection and shows the
empty page, but the "free terminal selected" flag stayed true. The next
click on a free terminal then looked like no change and was ignored.

The flag is now reset when the selection is cleared, and updated on
every change it takes part in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 22:02:11 +13:00
Beat Hangartner 43cc013e54 Fix tst_elementautonumids on macOS: give the binary its settings through QET_SETTINGS_DIR
duplicatesAreNotNumberedWhenSwitchedOff turns two preferences off by
writing <home>/config/QElectroTech/QElectroTech.conf and pointing
XDG_CONFIG_HOME there. Only Linux reads settings from that file. macOS
keeps them in the system preferences, so the binary never saw the two
preferences, numbered the pasted duplicates anyway, and the test failed
on macOS, on master too.

Write the file where QET_SETTINGS_DIR points instead (#1178), and set that
variable for every run of the binary, so no run reads the user's own
settings either.

No file-format change. Tests: tst_elementautonumids fails on master on
macOS and passes with this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Beat Hangartner <beat@hangartners.ch>
2026-10-06 10:53:10 +02:00
ispyisail 2680ae05f4 Fix KDE Frameworks links in README (#1328)
The kcoreaddons and kwidgetsaddons links pointed at a kf6 branch that
does not exist (404). KDE Frameworks 6 is developed on master; link to
the projects' home on invent.kde.org, which the GitHub mirrors name as
their homepage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 21:41:51 +13:00
Beat Hangartner f6ac685ebe Drop a machine-specific path from the DXF test fixture
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:53:49 +02:00
Beat Hangartner 4b187e049f Keep the DXF text lines of master for texts that do not wrap
layoutLines() trimmed the trailing spaces of every line and kept
non-breaking spaces, which the DXF export used to write as plain spaces
(toPlainText()). A DXF R10 file has no code page, so a reader assuming
Windows-1252 could show them as 'Â '. Now a paragraph that does not
wrap gives exactly its line of toPlainText().split('\n') again
(trailing spaces and tabs kept, non-breaking spaces as plain spaces,
<br> as a line break). In a paragraph that wraps, every line loses its
trailing spaces, so spaces that wrap to a line of their own give an
empty line: not written, but it keeps the spacing of the next lines.

Test: tst_textlines compares with toPlainText() for trailing spaces,
tabs, non-breaking spaces, <br> and paragraphs, and checks wrapped
lines (fails before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:53:49 +02:00
Beat Hangartner 069cf1e7b5 Tidy the free text width
- setTextWidth() returns without a signal when the width does not
  change, which is also the case on every load of a text without one.
- Say why IndependentTextItem::textWidth()/setTextWidth() hide the
  non-virtual QGraphicsTextItem functions, and what that means for code
  holding a base pointer.
- The fixture no longer carries a /tmp path from the machine it was
  made on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:50:08 +02:00
Beat Hangartner 315de47a12 Keep the width of free texts in the project database
The independent_text table had the text and rotation of a free text but
not its width, and a width change did not update the row at all -- not
even its width and height, which follow the wrapped text. Add a
text_width column (NULL for the automatic width) and update the row on
textWidthChanged.

Test: tst_scriptfreetextwidth reads the table with qet.query() (fails
before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:50:08 +02:00
Beat Hangartner 5cad0c6159 Keep the text resize handles working after a scene change
A scene drops the event filters of an item that leaves it. The handles
installed theirs once, in the constructor, and only if the text was in
a scene: after the text was removed and added back (undoing a delete
does that), or when the handles were made before the text was in a
scene, they no longer reacted, and a drag moved the text instead.
TextResizeHandles now installs the filters again whenever it enters a
scene.

Tests: dragAfterLeavingTheScene, dragWhenCreatedOutsideAScene (both
fail before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:46:17 +02:00
Beat Hangartner 6a681cde67 Keep an element editor text field in place when its width changes
In the element editor, changing the width of a right-aligned or centred
dynamic text field (with the width box) moved its aligned edge: the
field always grew or shrank from its left edge, so a right-aligned
field's right edge moved. PartDynamicTextField::setTextWidth() now
keeps the point chosen by the alignment in place, with the
prepareAlignment()/finishAlignment() pair setPlainText() and setFont()
already use. Not while the field is read from the .elmt, whose saved
position is the one to keep.

No file format change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:41:16 +02:00