TitleBlockTemplateLogoManager never sets read_only_: its constructor
leaves the member uninitialised, and setReadOnly() returns early when
the new value equals the member. The template editor calls
setReadOnly() right after creating the manager, so whenever the
garbage value happened to match, the call did nothing: the add, delete
and rename buttons stayed enabled on a read-only template, and
isReadOnly() returned garbage.
Give the member a default value, false, in the header, matching the
buttons' state after construction. Only
sources/titleblock/templatelogomanager.h changes.
No behaviour change for an editable template: setReadOnly(false) on a
manager that is already editable still returns early. No file-format
change.
Tests: none of their own; an uninitialised read is what a sanitizer
finds, and this one is the same kind as the BorderTitleBlock and
ConductorProfile fixes (#1358, #1359). ctest on macOS, and all
example projects through --resave and --export-svg, unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Beat Hangartner <beat@hangartners.ch>
Edit > Scale element... scales the whole element about its hotspot by a
factor picked from x0.5, x1.5, x2, x2.5, x3, x4. Only the factors that
leave every terminal on the 10 px folio grid are offered, so wires to a
scaled element stay straight. An element whose terminals are off the grid
today is offered only the factors that bring them on to it; if none does,
the dialog says so and OK is disabled.
Drawn parts are scaled with their existing handleUserTransformation(), as
the resize handles do. Texts, dynamic text fields and terminals are set
directly so that font sizes (whole points, 4 pt minimum), terminal name
offsets and line end sizes scale too, which the resize handles do not do.
One undo step restores the element.
Unlike "Import an element to resize", this needs no external program and
works on the element being edited.
Grew out of issue #1338.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue #1375: replacing a symbol meant retyping its label, manufacturer,
part number and the rest by hand. Copy the old symbol (Ctrl+C), select
the new one(s), then Edit > Paste element information, also in the
right-click menu of a selection.
Every field filled in on the copied symbol overwrites the same field on
each selected symbol; fields it leaves empty are left alone, since empty
fields are not written to the clipboard. The label and its formula move
together, so a target whose label comes from a formula takes the copied
label rather than rebuilding its own. A numbering-scheme id is kept only
if the scheme exists in the target project. Plain slaves and folio
reports are skipped: they take their information from what they are
linked to, as in the properties dialog. One undo step.
Enabled only when the clipboard holds exactly one symbol. The clipboard
is parsed once when it changes, not on every selection change.
No default shortcut: Ctrl+Shift+V, suggested in the issue, is already
"Paste at origin". It can be assigned in the shortcut settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The crop rectangle came back as the string "x,y,width,height", which a
script had to split and parse. elementGeometry() returns a map; the
crop now does the same, and an empty map for no such image.
Suggested in the review of #1310.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A picture remembers whether its pivot was placed by hand: a hand-placed
pivot is saved and kept through a resize, a default one is not saved
and recentres after a resize. Two actions changed that flag outside
their undo step:
- applyCrop() marked the pivot as default after moving it to the centre
of the kept region. After Ctrl+Z the pivot was back where the user
had put it, but marked as default, so the next save dropped it.
- dragging the pivot handle marked it as hand-placed. After Ctrl+Z the
pivot was back at the centre but still marked as hand-placed, so a
later resize left it at the handle's anchor corner.
pivotIsCustom becomes a property, and both actions put it into their
undo command next to rawPivot. tst_imagecropundo checks that a project
saved after undoing a crop keeps its hand-placed pivot.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The "general" tab of the element properties starts its description with
tr("Élement\n"), missing the second accent. The French UI shows the typo,
and the misspelt string is the translation key in all 34 lang/qet_*.ts
files (and from there was copied into 11 phrase books).
This fixes the source string to "Élément\n" and renames the key in the
34 .ts files so every existing translation stays attached. Without the
.ts change, the next lupdate run would mark the old entry vanished and
add an empty "Élément" entry: lupdate's similar-text heuristic does not
carry the translation over (checked with Qt 6.11 lupdate on copies of
qet_de/pl/en/fr.ts). With the change, lupdate reports the entry as
already existing and keeps the translation. qet_fr.ts also gets the
corrected spelling as its translation.
No behaviour change besides the one character in the label. The phrase
books keep their copy of the typo for now; they are cleaned up with the
other phrase-book corrections.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Brings in master's DXF blocks (#1339) through #1354. The upright texts
now live in drawSymbol() too, and a turned symbol whose texts stay
horizontal is drawn in full like a mirrored one: an INSERT would turn
its texts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts with the DXF blocks export (#1350) and the picture factory
leak fix. The mirror now lives in drawSymbol(); a mirrored symbol is
drawn in full rather than as an INSERT of its block, since a negative
INSERT scale would mirror its texts too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On GTK desktops (Mint, XFCE, GNOME) Qt hands QColorDialog to GTK's
chooser. Its "Custom" row is a recent-colours list kept by GTK: every
colour picked is pushed in on the left and the oldest drops out, so a
user's saved wire colours are lost (forum topic 3190). It also ignores
the custom colours QET saves (#918) and has no swatch grid for the
double-click to accept (#1172).
Pass DontUseNativeDialog at every colour dialog, so all platforms get
the dialog Windows already shows: 16 custom slots that change only on
"Add to Custom Colors", saved across restarts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Configuration > Personnaliser... (also at the bottom of a toolbar's
right-click menu) opens one window with a tab for each page that sets
how the user works: Barres d'outils, Contenu des barres, Barre de
raccourcis, Raccourcis and Gestes de la souris, like SolidWorks'
Tools > Customize. The tabs are the same pages the configuration
dialog shows, which keeps them. OK applies every tab, Cancel none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The right-drag ring showed the shortcut bar's commands for the selection.
A new Preferences page, "Gestes de la souris", lets the user pick the
ring's commands per selection context, one per direction, and choose 4 or
8 directions. Commands are dropped from the list onto a slot of a ring
editor, or placed with a button; Delete empties a slot.
A context the user never edits keeps following the shortcut bar, and 8
directions stays the default, so nothing changes for anyone who does not
open the page. A picked list is positional: a direction left empty, or
holding a command this build lacks, stays empty instead of shifting the
others. Stored like ShortcutBarSettings: diagrameditor/gestures/<context>
id lists in QSettings, defaults not stored.
tst_gesturesettings covers the defaults, positional lists, the 4/8
setting, the overlay's sectors and empty slots, and the page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Configure QElectroTech > Toolbar contents: pick a toolbar, drag or add
commands from the list on the left, remove them with Delete, reorder,
add separators, and add, rename or delete toolbars of one's own.
Reset to defaults gives a toolbar its original contents back.
Each toolbar is stored as a list of command ids in QSettings
(diagrameditor/toolbars/<objectName>), the same pattern the shortcut
bar uses. A toolbar the user never changed stores nothing and is built
exactly as before; an id no command carries any more is skipped. The
four buttons that are widgets rather than commands (handle size, text
grid, background colour, conductor colour) get ids of their own and
can each be on one toolbar at a time. Stored scripts can go on any
toolbar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fitCells() tried counts from 1, but BorderTitleBlock raises any column
or row count below 3 to 3. With very large cells (A5 portrait with
columns of about 200 px or more) the preset picked 2 columns; the folio
then got 3, came out wider than the sheet, and the dropdown fell back
to "Custom". Start the search, and the capped fallback, at 3, and
refuse a paper that leaves no room for 3 cells of the smallest size.
A5 portrait with 300 px columns now gives 3 x 179 px instead of
2 x 269 px; A4 landscape with the default cells is unchanged
(19 x 58 px). ctest 65/65.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A "Format" choice in the folio dimensions box sets the columns and rows
so the whole folio, title block included, has the size of an ISO A
sheet at the 96 dpi the PDF export uses. A4 landscape keeps 60 px
columns and 80 px rows and comes out as an A4 page in the PDF.
Nothing new is stored: the choice only fills in the columns and rows.
A folio whose size already matches a paper shows that paper; any other
shows "Custom". Changing the title block template after picking a paper
fits the folio again; a template too tall for the paper falls back to
"Custom".
The same box is in Folio properties and in the new-folio defaults of
the project and application settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The displayed pixmap and imageSource (original, crop rectangle,
transparent colours) were two undo values that had to change together,
although the pixmap follows from the source. An action that updated
one and not the other would bring back the bug fixed in #1310.
setImageSource() now recomputes the displayed pixmap, and crop, colour
key, mirror and replace push one undo step on imageSource alone. A
plain QUndoCommand holds the property change, so two identical actions
in a row stay two steps. Loading a project still shows the saved pixmap
as before.
tst_imagecropundo also checks the size of the saved picture after undo
and after redo.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A symbol text on a folio with its width on "Auto" kept every line of a
multi-line text on the left, whatever its alignment: a QTextDocument
with no text width has no width to centre or right-align lines in. It
only worked once the user gave the text a width wide enough.
With the width on Auto and a centre or right alignment, give the
document the width of its longest line. The size of the text does not
change, only where the shorter lines sit. The fit is redone when the
text, the alignment, the width or the font changes; on a font change
the text's anchor is kept, as the font change itself does.
textWidth() now returns the width the user set (-1 for Auto), the value
that is saved, rather than the document's, as IndependentTextItem
already does. Readers (properties panel, resize-handle undo, script
API, project database) see -1 for Auto as before.
Checked: every folio of the 25 example projects renders identically to
master (136 PNGs); a centred and a right-aligned two-line text now
render aligned; changing their font size leaves the same box and anchor
as master, and without the font-change refit the lines wrap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stderr got it in the previous commit; stdout (the JSON of --info, the
messages of the exports) still ended its lines in "\r\n" on Windows
while stderr ended them in "\n". Both streams now give the same bytes
on every system.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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>
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>
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>