Compare commits

...

198 Commits

Author SHA1 Message Date
Laurent Trinques 73075a5154 Snap enable DQET_ENABLE_SPACEMOUSE=ON
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 2m31s
2026-09-24 17:20:38 +02:00
Laurent Trinques 9875de85d7 Merge pull request #635 from ispyisail/feature-3dmouse-spnav
3D mouse (SpaceMouse/SpacePilot) pan/zoom via libspnav — Linux phase (discussion #599)
2026-09-24 16:49:00 +02:00
Laurent Trinques 48883b320e Merge branch 'master' into feature-3dmouse-spnav 2026-09-24 15:45:33 +02:00
Laurent Trinques b93d8d8baa Merge pull request #704 from arummler/master-feature-renum-elements-rebased
Autonumbering: renumbering of elements
2026-09-24 15:17:38 +02:00
Laurent Trinques ae41dd7686 Merge branch 'master' into master-feature-renum-elements-rebased 2026-09-24 15:17:17 +02:00
Laurent Trinques 7fbbb71aac Merge pull request #1018 from ispyisail/revive/785-info-flags-case-insensitive
Fix element flags written as True or 1 showing unticked
2026-09-24 13:08:28 +02:00
Laurent Trinques 232724bf82 Merge pull request #1017 from ispyisail/revive/752-rotate-texts-no-dialog-in-ctor
Move the rotate-texts dialog out of its undo command
2026-09-24 13:06:23 +02:00
Laurent Trinques 12f826e969 Merge pull request #1016 from ispyisail/revive/729-backup-prompt-drops-files
Fix projects opened during the start-up restore prompt being lost
2026-09-24 13:04:19 +02:00
Laurent Trinques 245aafb0d1 Merge pull request #1015 from ispyisail/revive/526-free-terminal-move
Fix the terminal strip's move button getting stuck disabled (#409)
2026-09-24 13:02:43 +02:00
Laurent Trinques 0d231ef548 Merge pull request #1014 from arummler/fix-explicit-file-open
Fix warning about reading XML without explicit file opening.
2026-09-24 13:00:47 +02:00
ispyisail 3513f692fd Read the remaining element flags through QET::infoFlagIsTrue()
5b0785fcc routed most reads of auto_num_locked, potential_isolating and
exclude_from_bom through QET::infoFlagIsTrue(), which accepts the same
spellings as the parts-list query (true/1/yes/on, trimmed, any case).
Four checkbox reads still compared against a literal lowercase "true":
the "exclude from parts list" box in the folio properties panel, and all
three flags in the element editor.

A value such as "True" or "1" from a hand-written .elmt/.qet was
therefore left out of the parts list, but shown unticked in both panels,
and pressing Apply there wrote back "false" and flipped the flag.

Revives the unconverted part of PR #785.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 22:34:42 +12:00
Laurent Trinques 5a27f3cf80 Merge pull request #1013 from ispyisail/fix/273-skip-open-backup
Fix bugtracker #273: skip crash-recovery backups of an unchanged project
2026-09-24 12:33:18 +02:00
Andre Rummler d3a9adbe44 Fix warning about reading XML without explicit file opening. This was implicit up to now and will go away in future Qt versions. 2026-09-24 12:32:47 +02:00
ispyisail 8ab4e24b61 Take the modal dialog out of RotateTextsCommand's constructor
RotateTextsCommand called QDialog::exec() from inside its constructor, so
the command could not be built without a human answering a dialog. That
made it untestable headlessly, undrivable from any script or test harness,
and it is why bugtracker #312 (PR #707) shipped with its save/reload
round-trip unverified -- the symptom could not be reproduced without a GUI.

The command now takes the angle as a parameter and does no asking. Two
statics carry the interactive half:

  hasSelectedTexts(diagram)  -- is there anything to rotate
  askRotation(rotation)      -- open the dialog, false if cancelled

The single call site in QETDiagramEditor asks first, then builds the
command, so the user-visible behaviour is unchanged: same dialog, same
title, same no-dialog-on-empty-selection. Keeping askRotation() in this
class also keeps the QObject tr() context, so existing translations of
"Orienter les textes sélectionnés" are not invalidated.

Also guards undo()/redo() against a null m_anim_group. When nothing is
selected the constructor calls setObsolete(true) without ever creating the
animation group, and QUndoStack::push() calls redo() before discarding an
obsolete command -- a latent null dereference on that path.

Verified headlessly, which was the point: driving the command through a
scratch --test-ops op on examples/741.qet (67 conductors), rotation
attributes written on save go 0 -> 67 with the #707 fix present and stay
at 0 with it reverted, while the reverted build instead writes userx on
all 67. That is bugtracker #312 reproduced and fixed under test for the
first time.
2026-09-24 22:30:20 +12:00
Laurent Trinques 2d2bf5ca2b Merge pull request #1012 from ispyisail/fix/340-ms-shell-dlg-pdf-font
Fix bugtracker #340: Windows texts in 'MS Shell Dlg 2' render as Arial
2026-09-24 12:27:50 +02:00
ispyisail 2f6ab8f63b Don't drop files handed to a starting instance while the backup prompts are up
QETApp's constructor ends with checkBackupFiles(), which opens modal
dialogs -- the "restore these files?" prompt, and the crash report offer.
Those dialogs run their own event loop, so the constructor does not return
until the user answers them.

main() still has work to do at that point. In particular this, a few lines
later:

    QObject::connect(&app, &SingleApplication::receivedMessage,
                     &qetapp, &QETApp::receiveMessage);

While the prompts are up that connection does not exist yet. A second
instance launched during the window -- double-clicking a project, or
xdg-open, while the first copy is still asking about restore files --
hands its file names over, SingleApplication accepts and delivers them,
and nothing is listening. The message is discarded and the second process
has already exited, so the file is simply lost with no error.

Deferring checkBackupFiles() to the event loop lets the constructor return
promptly. main() finishes wiring up, and the prompts appear immediately
afterwards exactly as before.

Verified with a stale restore file present, sending a project to the
running instance while the restore prompt is displayed: before, the file
was dropped and never appeared, even after answering the prompt; after, it
opens. The restore and backup prompts still appear and still work.

Note this is only observable together with the fix for bugtracker #248 --
before that, no file passed to a running instance was opened under any
circumstances.
2026-09-24 22:26:38 +12:00
ispyisail 2266497b0b Write the move button tooltips in French, the tr() source language
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 22:20:43 +12:00
Shane Ringrose dcb79b6553 fix(terminal-strip): free-terminal move button disabled and unresponsive
Three bugs stacked to produce the symptom in issue #409 (move button does
nothing):

1. selectionChanged() was declared in freeterminaleditor.h but had no body
   and was never connected to the selection model, so the move button had no
   awareness of whether a terminal was selected. The button could appear
   enabled with nothing selected, then silently return early in
   on_m_move_pb_clicked() at the real_t_vector.isEmpty() guard.

2. The dataChanged→setDisabledMove(true) connection was a one-way trap: any
   cell edit (including accidentally opening and closing a type/function
   combo, or toggling LED back to its current value) permanently disabled the
   move button until reload() was called. There was no tooltip explaining why
   the button was greyed out, so the user had no way to recover.

3. FreeTerminalModel::setData() for LED_CELL had no change guard, unlike
   LABEL_CELL which checks label != value. Clicking the LED combo while it
   was already at the same value still emitted dataChanged and triggered the
   disable.

Fix:
- Implement selectionChanged() to enable the move controls only when at
  least one row is selected AND there are no pending (yellow) edits.
- Connect it to both selectionModel::selectionChanged and model::dataChanged
  so the button state is always consistent with actual UI state.
- Route reload()'s re-enable through selectionChanged() instead of calling
  setDisabledMove(false) directly, so the selection state is respected
  immediately after a move.
- Add a tooltip to m_move_pb explaining the disabled state.
- Add the missing change guard to LED_CELL in setData().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-24 22:20:43 +12:00
ispyisail 745b4a936c Fix bugtracker #273: skip crash-recovery backups of an unchanged project
writeBackup() rebuilds the whole project's XML with toXml() on the GUI
thread before handing the file write to a worker thread. On a big project
that freezes the interface for seconds (bugtracker #273, and #329, where
the interval was raised from 2 to 20 minutes to make it rarer). It ran
right after every project was opened, and then every 20 minutes whether
or not anything had changed.

Only write a backup when something changed since the last one: the undo
stack moved, setModified(true) was called, or the embedded element or
title block collections changed. A project just opened from a file starts
clean, since the file is already what a crash would restore. New projects
and projects restored from a backup are backed up at once, as before.

Measured on examples/industrial.qet (50 folios), each backup blocks the
GUI thread for about 0.28 s on a fast machine; with a 2 s test interval,
the old code backed up on every tick, the new code only after a change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 21:57:42 +12:00
ispyisail 7ac3719c37 Fix bugtracker #340: map "MS Shell Dlg" aliases on Qt 6/Windows
"MS Shell Dlg 2" is a Windows font alias, not a font, and projects and
settings saved on Windows carry it. Qt 5's GDI backend let Windows resolve
it to Tahoma; Qt 6's DirectWrite backend does not know the alias and falls
back to Arial, so those texts render heavier on screen and in exported PDFs.

Register the substitutions Windows itself uses, before any application
object exists so the headless export and scripting paths get them too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 21:41:00 +12:00
Laurent Trinques ddfa234943 Merge pull request #1011 from Kellermorph/save-sheet-colour
Remember the sheet background colour between runs
2026-09-24 10:50:34 +02:00
Kellermorph 9af562fcbd Remember the sheet background colour between runs
Picking a sheet (folio) background colour in the diagram editor was lost
on every restart. Diagram::background_color is a static initialised to
white and PaletteGraphicsView's s_custom_bg a static bool, and neither
was ever written anywhere -- Diagram::toXml() carries no colour attribute
either -- so closing and reopening a project always came back on the
default and the choice had to be made again.

Store it in QSettings under diagrameditor/sheet_background_* as a pair of
values rather than one: the colour, and whether it was picked explicitly.
Both halves are needed. "#ffffff, follow the system" and "#ffffff, always
white" are the same colour and two behaviours -- the first is what the
views invert on a dark palette -- so keeping only the colour would
silently turn one into the other on the next start, which is the reported
problem one step removed.

The colour is written as HexRgb on purpose. The SVG export gives
Diagram::background_color an alpha of 0 to render a transparent
background and never puts it back, and that transient value must not be
persisted as a permanently transparent sheet.

Applied from main() after the headless export and scripting branch -- those
return before reaching it and must keep rendering on plain white, the rule
ProjectPrintWindow already enforces for printing -- and before QETApp is
constructed, since that constructor already loads the projects given on
the command line. The GUI export dialog is left alone: it renders through
drawBackground(), so what you see is what you export, as it already was
within a session.

Saved at the moment the colour is applied rather than at shutdown, so
neither the print window's temporary white nor the SVG export's alpha can
reach it. The button's constructor now mirrors the stored state instead of
always claiming "system colour", and the "recently used" list is stored
alongside it.

Covered by tst_sheetbackgroundsetting, which pins the custom flag and the
dropped alpha -- the two rules a single stored colour would lose.
2026-09-24 10:30:01 +02:00
Laurent Trinques c85276f61b Merge pull request #1009 from ispyisail/fix/1002-resize-handle-artefacts
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 6m31s
Fix green fragments left behind when moving or zooming an element (#1002)
2026-09-24 10:17:53 +02:00
ispyisail f3a31c291f Fix green fragments left by text resize handles when moving an element
The two width-resize handles added in #591 were free scene items, moved
with setPos() from inside DynamicElementTextItem::paint(). Moving an item
while the view is painting is outside what QGraphicsView's partial
repaint tracks: the handle was drawn only where the current repaint band
overlapped it, and its old position was not reliably cleared. Moving or
zooming a selected element left green slivers on the folio (#1002).
Since 29d16c333 the handles show on every text of a selected element,
so any ordinary element move triggered it.

Make the handles children of the text instead. Qt then moves and
repaints them together with the element, in local coordinates, and
their position only needs updating when the text's size changes, which
documentSizeChanged reports (text, font, width, undo of a resize).
This also takes paint() out of the handle logic entirely.

Reproduced on Linux (Xvfb), so the issue is not Windows-specific.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 19:46:26 +12:00
Laurent Trinques a06220e8dc Merge pull request #1008 from ispyisail/fix/1004-element-preview-cache
Fix #1004: element preview stays stale after editing until the collection reloads
2026-09-24 09:28:33 +02:00
Laurent Trinques 79990e40ee git submodule update --remote elements 2026-09-24 04:26:56 +02:00
Laurent Trinques e1e7ea4888 Merge pull request #1006 from ispyisail/i18n/ui-phrasebooks-29-languages
Add translation suggestions for the interface to 29 phrase books
2026-09-24 04:24:08 +02:00
Laurent Trinques 54b8fe5df4 Merge pull request #1007 from elevatormind/restore-sqlite-dependencies
Restore last sqlite dependencies
2026-09-24 04:02:28 +02:00
Laurent Trinques be0d214b75 Merge pull request #1005 from ispyisail/fix/1002-conductor-color-equipotential
Fix #1002: conductor colour toolbar swatch only recolours one wire segment
2026-09-24 04:01:13 +02:00
ispyisail 2f988e6e2c Refresh cached element preview after saving from the editor
Editing an element already in the user collection, saving, and closing
the editor left the old thumbnail in the elements panel until the
whole collection was reloaded. ElementsLocation::icon() serves the
preview from two caches keyed by path+uuid -- ElementPictureFactory's
in-memory picture cache and ElementsCollectionCache's on-disk SQLite
cache -- and neither was ever told the file changed.

QETElementEditor::toLocation() writes the new XML and returns;
ElementsCollectionWidget::locationWasSaved() then refreshes the panel
item, but it reads the icon through the same two stale caches, so the
refresh was a no-op. slot_reloadElementDrawings() already shows the
correct invalidation call for ElementPictureFactory; this wires the
same pattern, plus a matching refresh of ElementsCollectionCache's
row, into the save path itself.

Fixes the preview half of #1004. The paste-cursor-jump half of that
report is a live design disagreement between two recent commits from
a different contributor and is written up separately rather than
fixed here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-24 12:09:01 +12:00
Magnus Hellströmer 9786006ca4 fix(database): align sqlite3 forward declarations 2026-09-23 21:45:16 +02:00
ispyisail 91e8956734 Add translation suggestions for the interface to 29 phrase books
Fills lang/phrase/qet_fr_xx.qph for every language QET ships, following
on from discussion #873. A phrase book is never compiled into what
ships -- a translator opens it in Qt Linguist and sees a suggestion
already filled in, to accept or correct.

Only ever appends. phrasebook.write() skips any source string already
in the file (case-insensitive), so no existing entry -- human or
machine -- is touched. 24 languages had no phrase book at all before
this; the other 5 (da, de, nl, ru, sv) keep every line they had.

Built and run with tools/qet-i18n in the qelectrotech-docker harness
(DeepSeek Flash). Companion to qelectrotech-elements#82, which does the
same for the element collection.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-24 07:34:47 +12:00
ispyisail 6fad3390df Fix issue #1002: conductor-colour toolbar swatch skips the rest of the potential
ConductorColorToolButton::applyColor() only recoloured the selected
Conductor objects. A wire drawn across a junction is several separate
Conductor segments sharing one electrical potential, so selecting one
segment and picking a colour left the rest of the wire its old colour
-- visible only by falling back to F2/double-click, which already
expands to relatedPotentialConductors() for exactly this reason
(ConductorPropertiesDialog, and QetScriptApi::setConductorProperty).

Expand each selected conductor to its potential before building the
undo command, matching that existing pattern.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-24 07:08:31 +12:00
Magnus Hellströmer 231ab990c3 Revert "refactor: use VACUUM INTO for database export"
This reverts commit 27dea3ffab.
2026-09-23 20:18:25 +02:00
Laurent Trinques f10275cb22 Merge pull request #997 from ispyisail/revive/659-preserve-links
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 2m15s
Preserve master/slave links when pasting or duplicating a folio
2026-09-23 18:40:34 +02:00
Laurent Trinques 3d0e7a27a3 Merge pull request #998 from ispyisail/revive/785-case-insensitive-flags
Make auto_num_locked/potential_isolating case-insensitive
2026-09-23 18:38:38 +02:00
Laurent Trinques f14278324c Merge pull request #995 from ispyisail/revive/713-collection-cancel-race
Cancel the collection-loading map before waiting on it in ~ElementsCollectionModel
2026-09-23 18:36:17 +02:00
Laurent Trinques d5318eb7b4 Merge pull request #996 from ispyisail/revive/682-nonfinite-coordinates
Reject non-finite values in QET::attributeIsAReal()
2026-09-23 18:34:57 +02:00
Laurent Trinques f10ef3ded7 Merge pull request #994 from ispyisail/revive/664-element-info-orphan
Fix element_info orphan row causing UNIQUE constraint errors on undo
2026-09-23 18:33:05 +02:00
Laurent Trinques 6f7ea63589 Merge pull request #1000 from ispyisail/fix/933-german-source-strings
Fix bugtracker #933: German source string and comments in templates code
2026-09-23 18:26:45 +02:00
Laurent Trinques 9a6029a2bb Merge pull request #1001 from Kellermorph/plc-table-size
Plc table size
2026-09-23 18:24:15 +02:00
Laurent Trinques bc0ca56c7e Merge pull request #999 from ispyisail/fix/ci-missing-libsqlite3-dev
CI: install libsqlite3-dev, required by PR #983's find_package(SQLite3)
2026-09-23 18:22:47 +02:00
Laurent Trinques 1d4c0326d4 Merge pull request #1003 from qelectrotech/revert-986-no-sqlite
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m55s
Revert "fix: harden project database export"
2026-09-23 13:51:07 +02:00
Laurent Trinques d889a384aa Revert "fix: harden project database export" 2026-09-23 13:50:49 +02:00
Kellermorph 3457a88e81 Open the PLC master properties dialog at three times its width
Element::editProperty() gave PropertiesEditorDialog no size of its own,
so the dialog fell back to its sizeHint, which is sized for the compact
general-purpose editors it usually hosts. A PLC master instead shows a
six-column IO table that grows horizontally, and the dialog came out
too narrow to read those columns in.

For a master whose type is PLC, resize the dialog to three times its
natural width before exec(), keeping the natural height. The width is
clamped to the available screen so it cannot run off the display, and
every other element type opens exactly as before.
2026-09-23 10:28:00 +02:00
Kellermorph 4e361f93fe Let the PLC master IO table columns be resized, and remember the layout
The IO table of MasterPropertiesWidget -- the panel that opens when a
PLC master placed on a schematic is edited -- set every section to
QHeaderView::Stretch. Stretch spreads the sections evenly over the
widget and disables section dragging altogether, so the column
boundaries were permanently fixed: they could be neither widened nor
narrowed, and only the width of the whole panel had any effect.

Use QHeaderView::Interactive instead, with movable sections and a set
of default widths, so the columns can be dragged as they are everywhere
else in the application. The layout reached this way is written to
QSettings under masterpropertieswidget/plc-table-header-state on every
sectionResized and sectionMoved, and restored the next time the table
is built -- the same header-state trick the free and linked element
trees of this widget already use, except saved automatically rather
than only from the context menu.
2026-09-23 10:27:50 +02:00
ispyisail 6a8838e719 Fix bugtracker #933: German source string and comments in templates code
sources/ElementsCollection/fileelementcollectionitem.cpp had a German
tr() source string ("Makros") in a project whose source language is
French/English elsewhere. Renamed to "Macros" (identical in both
languages, so no translation catalog change is needed). Translated
three German-language comments in elementscollectionmodel.cpp and
diagramview.cpp to English.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 17:31:38 +12:00
ispyisail 774f803626 CI: install libsqlite3-dev for find_package(SQLite3 REQUIRED)
PR #983 added a hard SQLite3 system dependency to CMakeLists.txt, but
the workflow only installed libqt6sql6-sqlite (Qt's runtime driver
plugin), not the C headers/library find_package(SQLite3) needs. Every
PR based on current master has been failing CI with "Could NOT find
SQLite3" since #983 merged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 17:02:36 +12:00
ispyisail 5b0785fcce Make auto_num_locked/potential_isolating case-insensitive
Reviving the still-relevant part of #785, closed 2026-09-10 purely to
clear a review backlog, not on merit. Investigated fresh against
current master -- one of the original PR's three targets turned out
to already be fixed independently: element_nomenclature_view's SQL
predicate for exclude_from_bom already does
"COALESCE(LOWER(TRIM(ei.exclude_from_bom)), '') NOT IN ('true', '1',
'yes', 'on')" (projectDataBase::createElementNomenclatureView()).

auto_num_locked and potential_isolating had no equivalent: five call
sites across terminal.cpp, terminalnumberingdialog.cpp and
elementinfowidget.cpp compared the raw stored string against the
literal "true" with QString::operator==, silently treating "True",
"TRUE", a trailing space, or any value written by something other
than this app's own checkbox as off -- with no error and no visible
difference from the checkbox being genuinely unticked.

Added QET::infoFlagIsTrue(), matching the same accepted spellings
("true"/"1"/"yes"/"on", case-insensitive, trimmed) the SQL predicate
already uses, and switched all five call sites to it.

Verified the exact comparison logic in isolation, outside any QET
build: 15 cases including "True", "TRUE", padded whitespace, "1",
"yes", "on", and their false counterparts -- all correctly
discriminated. Qt 6.10.2, ctest 13/13.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 16:47:07 +12:00
Laurent Trinques ed0f800ab5 Update linux-build.yml
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 2m20s
2026-09-23 06:40:53 +02:00
ispyisail de9b3eae06 Preserve master/slave links when pasting or duplicating a folio
Reviving #659, closed 2026-09-10 purely to clear a review backlog
(#630), not on merit. Rebuilt fresh against current master rather than
merged from the old branch (elementspanelwidget.cpp had drifted enough
that a textual merge risked silently losing content, as it did earlier
in this same session for a different revival). Builds discussion #607.

Cutting/copying a linked group of elements -- a relay coil with its
contacts, a PLC master with its slave I/O elements -- dropped the
master/slave link entirely. Traced end to end: Element::toXml() writes
each partner's uuid into <link_uuid>, Element::fromXml() reads it back
into a deferred, unresolved buffer (tmp_uuids_link), and the only code
that ever resolves that buffer is initLink(QETProject *) -- called
only from Diagram::refreshContents(), itself only called from full
project load and macro-block insertion. Neither DiagramView::paste()
nor ElementsPanelWidget::duplicateDiagram() ever call it, so
tmp_uuids_link is populated correctly and never resolved: the link is
silently dropped. duplicateDiagram() already knew this and worked
around it by calling clearPendingLinks() -- correct to not link back
to a stale source, but it meant folio duplication never preserved a
link either.

Added Element::initLink(const QList<Element *> &candidates) --
resolves against a caller-supplied list instead of a project-wide
search. The scoping is the subtle part: right after the XML round-trip
and before uuids are renewed, a pasted/duplicated element's
tmp_uuids_link still holds its source's original partner uuid, which
at that exact moment still equals the not-yet-renewed uuid of that
partner's own copy, if it was carried along in the same batch.
Resolving only within the batch is what stops a linked pair pasted
together from matching an original element left elsewhere that
happens to still carry that same soon-to-be-replaced uuid. If only one
half of a linked group is in the batch, its entry finds no match and
is dropped -- the same "leave it unlinked" outcome as before.

Wired into PasteDiagramCommand::redo(), before the existing newUuid()
loop and gated by the same first_redo flag. Wired into
duplicateDiagram() the same way, replacing its clearPendingLinks()
call (initLink() clears tmp_uuids_link internally, matched or not).

Verified live -- the original PR's own test plan left both of these
unchecked, so this closes that gap rather than repeating it. Built a
project with a linked PLC master/slave pair (qet-mcp's link_elements),
then drove the real interaction under Xvfb:

  Ctrl+A, Ctrl+C, Ctrl+V:
    originals   95ad58fc <-> e728632c   (unchanged)
    pasted      513e6bf8 <-> 29aa60b4   (linked to each other)

  Right-click folio > "Copier et coller":
    originals   95ad58fc <-> e728632c   (unchanged)
    duplicated  0a33ccb4 <-> 3264fe66   (linked to each other)

Neither copy links back to an original or comes in unlinked. Qt 6.10.2,
ctest 13/13.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 16:37:45 +12:00
ispyisail 032f2249a3 Reject non-finite values in QET::attributeIsAReal()
Reviving the still-relevant third of #682 (closed 2026-09-18 purely to
clear a review backlog, not on merit). Investigated fresh against
current master rather than merged wholesale -- two of the original
PR's three findings turned out to already be resolved independently:

- Element::valideXml() and Terminal::valideXml() already reject a
  non-finite x/y (qIsFinite checks, with comments citing this exact
  class of bug) -- added by someone else since #682 was written.
  Verified live: a project with x="nan" on an element loads and
  exports cleanly on current master, 3.1s, no hang.
- The illegal-XML-control-byte segfault in QDomDocument::setContent()
  does not reproduce either. Tested both bytes from the original
  report (0x00, 0x0E) against a real Qt6 build: both are now refused
  cleanly (XmlParsingFailed, exit 0), no crash. Qt6's QDom parses
  differently to the Qt5 one #682 was written and tested against.

What's still genuinely open: QET::attributeIsAReal() itself --
QString::toDouble()'s output parameter reports success for "nan"/
"inf"/"-inf", and this shared helper (26+ call sites across the
codebase, per #682's own count) had no finiteness check independent of
element.cpp/terminal.cpp's own since-added ones. Confirmed several
call sites are not behind either of those two gates -- notably
elementpicturefactory.cpp's line/rect/ellipse/circle/arc parsing for a
symbol's own drawing (a corrupted .elmt, not just a corrupted project
file), which was and remains reachable through this helper alone.

Qt 6.10.2, ctest 13/13.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 16:25:39 +12:00
ispyisail 1890cee801 Cancel the collection-loading map before waiting on it in ~ElementsCollectionModel
Reviving #713, closed 2026-09-21 purely to clear a maintainer review
backlog (#630), not on merit; not superseded. The crash #713 was
originally named after (bugtracker #291) was already fixed separately
by 39ac5716c, merged 14 Aug -- confirmed still on master. What's left,
and what this revives, is the one-line follow-up #713 itself narrowed
to after that: m_future.cancel() before the wait.

Without it, ~ElementsCollectionModel()'s wait runs the whole queued
QtConcurrent::map() to completion, so cancelling the open-element
dialog blocks until every remaining item has been processed -- a
visible hang on the button pressed precisely to stop the work.
cancel() drops the not-yet-started items so the wait is short, while
still waiting for whatever item is already in flight (needed so it
can't dereference this object after it's gone).

Qt 6.10.2, ctest 13/13. The responsiveness gain itself is reasoned
from QFuture's documented cancel()/waitForFinished() semantics rather
than timed -- same as the original PR's own stated verification.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 16:20:38 +12:00
ispyisail 3eea3059bf Fix element_info orphan row causing UNIQUE constraint errors on undo
Reviving #664, closed 2026-09-18 purely to clear a maintainer review
backlog (#630), not on merit; not superseded. Rewritten fresh against
current master rather than merged from the old branch -- that branch
predates the Qt6-only switch and much of dataBase/projectdatabase.cpp's
later rewrite, and the two had diverged too far for a textual merge to
be trustworthy.

projectDataBase::removeElement() only ran DELETE FROM element WHERE
uuid=:uuid. It never touched element_info, even though every element
also has a row there (element_uuid is its PRIMARY KEY, with a FOREIGN
KEY back to element.uuid that isn't enforced by this connection -- no
ON DELETE CASCADE in effect). So deleting an element left its
element_info row orphaned.

Re-adding an element with that same uuid later -- undo of that same
deletion, or a redo replaying it -- goes through addElement(), which
INSERTs into both tables. The element insert succeeds (that row really
was removed). The element_info insert hits the orphaned row's primary
key and fails, silently: the error is logged and swallowed, so the
element re-enters the scene with no element_info row at all, and
nothing later re-syncs it.

removeDiagram() already cascades this cleanup when a whole folio is
removed (a later, unrelated addition) -- confirmed on current master --
but that path never runs for a single element removed on its own,
which is the case this fixes.

Verified on the built binary, not just read: placed an element, deleted
it (Ctrl+A, Delete), undid the deletion (Ctrl+Z). Reverting just this
fix and repeating the identical sequence reproduces the exact reported
error:

  Debug: projectDataBase::addElement insert element info error :
  QSqlError("1555", "Unable to fetch row",
  "UNIQUE constraint failed: element_info.element_uuid")

With the fix, the same sequence produces nothing. Qt 6.10.2, ctest
13/13.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 16:13:04 +12:00
Laurent Trinques 6d8459d647 Merge pull request #983 from ispyisail/fix-sql-readonly-cte-bypass
Enforce read-only SQL with SQLite, not a first-word check
2026-09-23 03:22:00 +02:00
ispyisail 28acbadaf0 Merge remote-tracking branch 'upstream/master' into pr983-rebase-check
# Conflicts:
#	sources/dataBase/projectdatabase.cpp
#	tests/qttest/CMakeLists.txt
2026-09-23 13:16:48 +12:00
Laurent Trinques 4456d08b91 Merge pull request #988 from elevatormind/chore/remove-obsolete-google-tests
Chore/remove obsolete google tests
2026-09-23 02:55:16 +02:00
Laurent Trinques aae7a8bde3 Merge pull request #980 from ispyisail/scripting-api-feature-complete
Scripting API: make it feature-complete, sync misc/qet-mcp
2026-09-23 02:47:25 +02:00
Laurent Trinques 4bcf5834e4 Merge pull request #984 from ispyisail/feature/scripting-opt-in
Scripting off by default, with a prompt and a setting to turn it on
2026-09-23 02:40:18 +02:00
Laurent Trinques f6889af99c Merge pull request #987 from elevatormind/fix/tests-pugixml-link
fix(tests): link pugixml to crash dump test
2026-09-23 02:34:54 +02:00
Laurent Trinques 9e5af6440b Merge pull request #989 from ispyisail/fix/titleblock-unset-variable-bug973
Fix bugtracker #973: unset title-block custom variable shows its own name
2026-09-23 02:33:56 +02:00
Laurent Trinques b97bccecd3 Merge pull request #990 from ispyisail/fix/diagramcontext-trims-whitespace-value
Preserve an all-whitespace context value through save and reload
2026-09-23 02:32:09 +02:00
Laurent Trinques 14cf3e403f Merge pull request #982 from Kellermorph/fix-copy
Fix copy
2026-09-23 02:22:11 +02:00
Laurent Trinques 1f0ed43006 Merge pull request #985 from ispyisail/fix/query-row-cap
A query stored in a project file can hang QElectroTech for ever
2026-09-23 02:19:28 +02:00
Laurent Trinques fc2a200ca2 Merge pull request #993 from ispyisail/feature/duplicate-offset-dialog-991
Add Ctrl+D: duplicate the selection, offset by a configured grid step
2026-09-23 02:17:36 +02:00
Laurent Trinques ccf96e0537 Merge pull request #986 from elevatormind/no-sqlite
fix: harden project database export
2026-09-23 02:15:29 +02:00
ispyisail fa213d90d9 Add Ctrl+D: duplicate the selection, offset by a configured grid step (#991)
Split from #913's second suggestion. There was no shortcut for the common
"duplicate with offset" convention; the nearest existing feature,
"Collage multiple", is a different workflow (a dialog for repeating a
paste in a grid pattern, not a one-shot duplicate).

Ctrl+D copies the selection and places it immediately, offset by a
configured spacing and direction -- no interactive follow-the-cursor
step, unlike Ctrl+V. The first press (or after the setting is explicitly
reopened) shows DuplicateOffsetDialog: spacing in grid steps, direction
up/down/left/right. Every later press reuses whatever was confirmed then,
silently, so a row of copies is one key held down and tapped, not a
dialog every time -- unattended, repeatable stamping is the actual point
of a duplicate shortcut, which a dialog or an interactive placement step
on every press would defeat. A separate "Configurer la duplication..."
entry reopens the dialog on demand to change the setting later. Cancel
leaves the diagram untouched -- verified, not assumed: qet_diff against
the saved file shows 0 added.

Chaining ("keep tapping to lay out a row") needs no special handling:
QET already reselects whatever a paste just added
(PasteDiagramCommand::redo()), so the next Ctrl+D naturally continues
from the copy just placed rather than the original.

The offset is applied by hand rather than by asking paste()/fromXml() to
place the copy at a target position. Both of those feed the position
through Diagram::snapToGrid(), which reads
QApplication::keyboardModifiers() and rounds to the nearest PIXEL instead
of the grid whenever Ctrl is held -- and Ctrl is always held here, this
action's own shortcut being Ctrl+D. Measured before settling on this:
routing the offset through paste() first produced copies off-grid on both
axes, by an amount that tracked the selection's own bounding-box geometry
rather than being a fixed error -- caught by qet-mcp's qet_elements
against the saved file, not by eye. fromXml() is instead called with no
position argument at all (leaves every item at its source coordinates,
landing the copy on top of the originals -- (0,0) is not a position, this
is "keep the source coordinates"), and the offset is added directly with
setPos(). A plain addition cannot be off by a rounding rule that never
runs.

Conductors are not in the hand-translated set: fromXml() itself does not
reposition them either -- they load after elements are already in their
final place and take their geometry from their terminals, which have
already moved with the elements that own them. Verified this holds: drew
a conductor by hand between two elements (drag, not click-click),
selected both, Ctrl+D, and the new conductor correctly joins the two new
elements via qet_conductors -- not the originals, not a mix.

Verified end-to-end on a built binary via qet-mcp, not by eye:

  before          L2 (303,207)  L9 (512,196)     -- deliberately off-grid
  spacing=2, down    (303,227)     (512,216)      -- +0,+20 exactly
  same again, 2nd    (303,247)     (512,236)      -- +0,+20 again, chained

Both elements land exactly the configured offset from their immediate
source regardless of the selection's own alignment. Qt 6.10.2, ctest
11/11.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 11:30:30 +12:00
ispyisail 84add7b3ef Preserve an all-whitespace context value through save and reload
A property value that is entirely whitespace -- reported in #973 as a
workaround (setting a title-block custom variable to a single space, the
only way to give it a value other than blank before that bug was fixed in
#989) -- did not survive a save/reload cycle. Two independent causes, both
needed for the round trip to actually work:

1. DiagramContext::toXml() called .trimmed() on every stored value before
   writing it, unconditionally. For ordinary content this only strips
   accidental leading/trailing whitespace, but for a value that IS
   whitespace it collapses the entire thing to "", indistinguishable from
   a value that was never set.

2. QDomDocument::setContent(), used to parse the project file, discards a
   text node that is entirely whitespace by default. Confirmed in
   isolation, outside any QET code: parsing "<a> </a>" with the default
   ParseOptions gives QDomElement::text() == ""; adding
   ParseOption::PreserveSpacingOnlyNodes gives " ". So even once (1) stops
   destroying the value on save, the very next load throws it away again.

Fix (1) only trims when the trimmed result isn't empty, i.e. leaves an
all-whitespace value untouched. Fix (2) adds PreserveSpacingOnlyNodes to
the one setContent() call that parses a project file
(QETProject::readProjectXml()) -- not the other ~19 call sites in the
codebase (clipboard paste, element/macro loading, translations, autonum
context), which read different, narrower documents and are not implicated
in this report.

Blast radius of (2): every place that walks a QDomNode's children already
filters on isElement() (see QET::findInDomElement()), so the extra
whitespace-only text-node siblings this keeps around are inert wherever
current code already expected only elements. The one place it isn't inert
is exactly the bug -- calling .text() on an element whose entire content
is whitespace.

Verified end-to-end, not just at one stage: a single-space title-block
variable now survives two successive --resave cycles unchanged (confirmed
byte-for-byte in the saved XML), and renders as blank space rather than
literal placeholder text or a vanished value. Re-saved all 24 shipped
examples with and without this change and diffed: 23 byte-identical, the
one that differs (schema_indus.qet) differs only in element uuids -- and
resaving it twice with the SAME unpatched binary produces that same kind
of diff, confirming it is pre-existing non-determinism in files that
predate persisted uuids, unrelated to this change. Qt 6.10.2, ctest 11/11.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 09:20:31 +12:00
ispyisail 36fb048a80 Fix bugtracker #973: unset title-block custom variable shows its own name
BorderTitleBlock::updateDiagramContextForTitleBlock() skips merging a
page-level custom variable into the title block's render context whenever
its value is empty -- added by PR #572 to fix #531, where an empty
page-level value was shadowing a real project-level one of the same name.

But skipping the merge removes the key from the context entirely, and
TitleBlockTemplate::interpreteVariables() only replaces "%name"/"%{name}"
when "name" is an actual key in that context -- anything absent is left as
its own literal placeholder text. Folio Properties auto-adds every one of
a template's custom variables to the Custom tab with an empty value (#271/
#495) precisely so the user only has to fill in what's missing; until they
do, that variable now renders as e.g. "%label1" instead of blank.

Reproduced two ways: a synthetic fixture, and examples/2612_ats_singlephase.qet
itself, which already carries three such auto-added-but-unset properties
("label1", "label2", "label3") and renders all three literally on current
master.

Fix: skip the empty page-level value only when a project-level one already
exists to show through (preserving #531's guarantee); otherwise still merge
it in empty, so the placeholder resolves to blank rather than falling out
of the context altogether.

Verified against the shipped example (--export-png, before/after crop of
the rendered title block): "%label1"/"%label2"/"%label3" now blank. A
variable never added to the Custom tab at all ("%client", also present in
the same example) is unaffected -- nothing was ever configured for it, and
that is a separate, narrower case. Qt 6.10.2, ctest 11/11.

A related but distinct issue -- DiagramContext::toXml() trims a stored
value before saving, so an all-whitespace value is written as empty --
explains a second symptom from the same report (a single-space "workaround"
value vanishing after the project is reopened) but touches every
context-backed property, not just title blocks, and is left for a separate
fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 09:08:21 +12:00
Magnus Hellströmer a7ae17a1b4 chore: remove obsolete Google test projects 2026-09-22 20:34:40 +02:00
Magnus Hellströmer a1675d7dea fix(tests): link pugixml to crash dump test 2026-09-22 20:02:01 +02:00
Magnus Hellströmer 13a37e1f59 fix: harden project database export
Use a bound VACUUM INTO path and remove the stale SQLite
handle declaration. Fix shell continuations in Windows CI and
Debian installation instructions.
2026-09-22 19:05:05 +02:00
Laurent Trinques 6fc7e4a090 Merge pull request #965 from elevatormind/no-sqlite
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m54s
Remove SQLite library dependency while retaining project db export
2026-09-22 18:51:00 +02:00
ispyisail 08b83f23e3 qet-mcp: say what to do when QElectroTech refuses to run scripts
#984 switches JavaScript scripting off by default, and five tools here
drive QElectroTech through --run: qet_query, qet_continuity, qet_check,
qet_project_new, qet_edit. Against such a build they all stop working, and
what came back was exit code 3 and a paragraph of French naming a settings
dialog nobody driving an MCP server is looking at.

Nothing needed building to make them work again -- _run_qet() inherits its
environment, so QET_ENABLE_SCRIPTING=1 in the "env" block of the client's
own configuration already reaches QElectroTech. Verified both ways against
a #984 binary: without it qet_query returns ok=false exit=3, with it
ok=true and the rows.

So this is about saying so. The refusal is now recognised and answered with
an instruction the caller can act on, keyed on QElectroTech naming the
variable with exit 3 as a fallback for a future build that words it
differently. Two older hints fitted the same symptom and were overwriting
it -- "the binary never ran the script ... is it a build with --run
support?" sends the reader to check the one thing that is fine -- so both
now yield to whatever the launch already reported. qet_check builds its
answer fresh rather than layering onto the launch result, so it carries the
reason across explicitly; without that every check read "no result came
back", which is true and tells nobody why.

The server does not set the variable itself, on purpose. A switch a program
turns on for itself is not a switch: whoever configured this server and
pointed it at a QElectroTech binary made that choice, and their interactive
QElectroTech keeps whatever its own setting says. README says this, and the
registration example now shows the env block with both variables in it.

Six tests, faking subprocess.run so they cost no launch. Two are structural
rather than behavioural: one fails if either older hint goes back to
assigning over the specific one, the other reads which tools actually pass
script= to _run_qet and fails if the hint's list of them drifts. Both were
mutation-checked by reintroducing exactly those mistakes.

176 tests pass with QET_BINARY, QET_ELEMENTS, QET_EXAMPLES and
QET_ENABLE_SCRIPTING set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 04:35:46 +12:00
ispyisail 3fa5e0a475 Stop a query in a project file from hanging QElectroTech for ever
A <graphics_table>'s <query> is stored in the .qet and executed when the
project loads. SQLite produces rows lazily, so the cost of that query is
not bounded by anything the project contains -- it is bounded by how long
the loop reading the rows is willing to run. A recursive CTE takes one line
to make that forever:

  WITH RECURSIVE c(n) AS (SELECT 1 UNION ALL SELECT n+1 FROM c) SELECT n ...

Put that in the <query> of any project's summary table and opening the file
pins a core at 100% and grows ProjectDBModel::m_record until memory runs
out. Measured on examples/industrial.qet with the query swapped, built from
master:

  clean     --export-bom   3.6 s, 396 rows, exit 0
  poisoned  --export-bom   killed at 90 s, still going, no output

No scripting, no MCP, no flag beyond an ordinary export. Opening the file in
the editor is the same code path.

QetScriptApi::query() has the identical loop, and the script engine's own
30 s interrupt does not reach it: that aborts JavaScript, and this is C++
inside a single call. Left alone it hung a --run for 45 s until the harness
killed it.

Both loops now stop at projectDataBase::MaxResultRows (100000) and say so.
That is a backstop, not a page size: the largest table in the shipped
examples is 396 rows, and a caller that reaches 100000 has been handed
something it should not run to completion. It is not silent either way --
the model logs the offending query text, and qet.query() sets queryError(),
so a truncated result is never mistaken for a complete one.

  clean     --export-bom   3.6 s, 396 rows, exit 0   (unchanged)
  poisoned  --export-bom   20.2 s, 396 rows, exit 0, warning names the query
  qet.query(recursive CTE) 3.8 s, 100000 rows, queryError() set

Reverting each cap restores the hang, so both checks discriminate.

Related to #983, which fixes a different flaw reachable through the same
stored query. Neither depends on the other.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 04:16:21 +12:00
ispyisail 8334a9a27f Scripting is off until asked for, and says how to turn it on
A script reaches the whole project and, through the export calls, the
filesystem. That is a capability most people installing an electrical CAD
program never asked for, and leaving it on by default hands it to them
anyway. So QET_HAS_SCRIPTING builds now ship with it switched off.

QetSettings::scriptingEnabled() is the single answer, read by all three
places that need it, with QET_ENABLE_SCRIPTING=1 overriding the stored
value. The override is not decoration: a CI job or a batch run has no
dialog to tick, and a machine whose HOME is created fresh for each run has
nowhere to keep the setting either. It beats a stored "false" on purpose,
so a box unticked once cannot lock a build server out of --run for good.
Only the exact value "1" counts.

  --run          refuses with exit 3 and a message naming both ways in.
  Projet > Exécuter un script...  asks once, and turns the setting on if
                 the answer is yes. Asking beats grey: a disabled menu
                 entry says something exists and nothing about how to have
                 it, and this is the pattern people already know from
                 macro security in office software.
  Configurer QElectroTech > Général > Projets  has the checkbox, for
                 turning it back off. While the environment forces
                 scripting on, the box is disabled and says why, and
                 applyConf() then leaves the stored value alone rather
                 than quietly overwriting it.

runOnProject() checks as well, after both callers have. It is the one
function that actually evaluates JavaScript, so it is the one place a
future caller cannot forget to ask; the callers check first only to give a
better answer than it can.

Verified on the built binary, all four states, with an isolated HOME:

  stored   env  result
  absent    -   refused, exit 3
  true      -   script runs, exit 0
  false     -   refused, exit 3
  false     1   script runs, exit 0

tst_scriptingsetting covers the same matrix hermetically, in its own
QSettings scope, and was mutation-checked: flipping the default to true
turns defaultsToOff() red.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 04:06:33 +12:00
ispyisail 4a636b14e3 qet-mcp: confine tool paths to a workspace, and never clobber silently
Two security reviews of #980 landed on the same gap: every path in a tool
call is chosen by the model, and nothing checked where those paths pointed.
That made the server a read/write primitive for anything the process could
reach -- read any project on the disk, export one somewhere else, overwrite
an unrelated file, embed an arbitrary local image or PDF. The sandboxed HOME
each QElectroTech launch gets isolates settings, not the filesystem.

Data paths are now confined to a workspace: QET_MCP_WORKSPACE (os.pathsep
separated), defaulting to the directory the server was started in, which is
what an MCP host normally sets anyway. QET_MCP_ALLOW_ANY_PATH=1 turns the
check off; it exists so that is a visible choice rather than the default.
Paths are resolved before comparison, so a symlink planted inside the
workspace is judged by where it points -- the case a string-prefix check
gets wrong.

Two arguments are deliberately exempt: "binary" and "elements_dir". Those
are configuration, chosen once by whoever runs the server, and both normally
live in /usr or a build tree. Confining them would reject the ordinary case
while stopping nothing -- they are not where a model gets to point the
server at /etc.

Enforcement sits at the dispatcher, where model-supplied arguments enter,
not inside each tool. Importing the module and calling tool_export() from
Python stays unconfined and is meant to: that is the caller's own code with
the caller's own paths.

Separately, an existing "output" is now refused unless the call passes
"overwrite": true. qet_project_new already worked this way; qet_export,
qet_edit and qet_element_build now match it. Replacing a file is the one
step this server cannot undo.

17 tests cover it, including the symlink escape, the traversal, the
overwrite gate and the operation-level file paths that add_image and
add_pdf_page carry one level down. Two of them compare the policy table
against the tool schemas, because a write tool missing from either list
fails silently in opposite directions. Two more drive a real server process
over stdio, which is the only thing that shows a call is gated rather than
merely gate-able. Mutation-checked: removing the confinement fails 8, and
desynchronising the two lists fails the drift pair.

170 tests pass, with QET_BINARY, QET_ELEMENTS and QET_EXAMPLES set so none
are skipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 03:36:29 +12:00
ispyisail f777be05b4 Enforce read-only SQL with SQLite, not with a first-word check
projectDataBase::isReadOnlySelect() decides whether a query only reads
by looking at its first keyword and rejecting internal semicolons.
SQLite has allowed a CTE prefix in front of a data-modifying statement
since 3.8.3, so

    WITH x AS (SELECT 1) DELETE FROM element

begins with WITH, contains no semicolon, passes the check, and deletes
every row. UPDATE and INSERT go through the same way.

This is not only reachable from the custom-query box. ProjectDBModel::
fromXml() reads a <graphics_table>'s saved <query> straight out of the
.qet and fillValue() executes it, so a project file can carry the
statement. Reproduced against a build of this branch's parent, with no
scripting and no CLI flag beyond the export itself: a project whose
stored table query was replaced with the DELETE above exported a bill
of materials of 0 rows instead of 14, exit code 0, nothing logged. A
silently empty or -- with UPDATE -- silently altered BOM is the kind of
output someone orders parts from.

Fixed by asking SQLite about the statement it actually compiled.
sqlite3_prepare_v2() compiles without running, sqlite3_stmt_readonly()
reports on the compiled statement rather than on how it was spelled,
and the prepare tail catches a second statement structurally. The same
project now exports its 14 rows again and logs a reason for the
refusal, while an ordinary WITH ... SELECT in a project file still runs
untouched -- the fix is not "ban CTEs".

isReadOnlySelect() stays in front of it rather than being replaced:
SQLite considers ATTACH, BEGIN and several PRAGMAs read-only too, since
none of them change the contents of the database, so dropping the
statement-type allowlist would have widened what is accepted while
fixing what is executed.

The check lives in its own translation unit depending on nothing but
QString and SQLite, so tests/qttest/tst_sqlreadonly.cpp can link it
alone and exercise the security property without standing up a
QETProject: 18 assertions covering the three CTE-prefixed writes named
in the review, bare writes, trailing statements, comment-only input
(which compiles to a null statement sqlite3_stmt_readonly() must not be
handed) and a null connection (refused, not waved through). Confirmed
the suite discriminates by deliberately disabling the new check and
watching exactly the nine write-refusal assertions go red while the
accept cases stayed green.

ctest 13/13, qet-coherence-check and qet-pdflink-check clean on the
example corpus.

Reported in PR #980's review thread by @elevatormind and confirmed
against this code by @scorpio810; fixed here on its own because the
flaw is in already-released code and needs none of that branch to
reach.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 03:23:40 +12:00
Kellermorph 8ee3f90047 Fix multi-second Ctrl+V stall and cursor jump on paste
Two issues on the interactive paste path:

1. Stall: DiagramEventAddPaste's constructor called Diagram::fromXml()
   with no database batching, so every addItem() emitted dataBaseUpdated()
   and each connected table model re-ran its full SQL query. A typical
   paste (~40 elements + ~40 conductors) triggered ~77 rebuilds of the
   table models -- measured at ~2.1 s of pure fromXml time on a large
   project. Project loading already batches this via
   setUpdateBlocked()/blockSignals() (QETProject::readProjectXml); the
   paste path now does the same: block during fromXml, one updateDB()
   after. Measured fromXml: 2114 ms -> 143 ms.

2. Cursor jump: m_initial_cursor was set to the group origin but the
   physical cursor stayed at the Ctrl+V press location, so the first
   mouseMoveEvent computed a large delta and the items jumped on first
   touch. Warp the cursor to the group origin after placement so the
   baseline and the actual cursor position match.
2026-09-22 15:38:22 +02:00
Kellermorph 41e1e8172c Keep paste at original XML position instead of moving to cursor
Commit dd0c194a3 (#913) moved the pasted group to the cursor position
at construction time. The desired behaviour is that items appear at
their original XML coordinates (where they were copied from) so the
user starts from the origin. The grid-snapped movement baseline and
the context-menu restoration from that commit are kept.
2026-09-22 15:03:10 +02:00
Laurent Trinques 1212f48c6d Merge pull request #979 from Kellermorph/colour-programm
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m48s
Add custom application color picker in global settings
2026-09-22 13:49:42 +02:00
Laurent Trinques e01f46c5b0 Merge pull request #981 from ispyisail/fix-974-report-link-colour
Fix report-link colour/style mismatch detection (#974)
2026-09-22 13:38:40 +02:00
ispyisail bf7f49f334 Merge remote-tracking branch 'upstream/master' into review-635-fix
# Conflicts:
#	CMakeLists.txt
#	cmake/developer_options.cmake
#	cmake/qet_compilation_vars.cmake
#	sources/qetapp.cpp
2026-09-22 23:10:34 +12:00
ispyisail 3cec02b3f3 Fix report-link colour/style mismatch detection (bugtracker #974)
LinkElementCommand::redo() already had a check meant to catch exactly
this -- two report-linked conductors whose properties disagree -- and
ask the user which to keep via PotentialSelectorDialog. It never
worked: it built ONE combined list from three unrelated fields
(tension_protocol, wire_color, wire_section) and tested that whole
list for string equality, so a tension-protocol value could never
equal a wire-colour value even when every field individually matched
across every conductor. Worse, "wire_color"/"wire_section" are
ConductorProperties::m_wire_color/m_wire_section, a separate free-text
documentation pair that says nothing about how the wire is actually
drawn -- that's "color"/"style" -- so the one field #974 is actually
about was never compared at all.

Fixed by comparing each relevant field (text/num, function, tension
protocol, colour, line style) separately. Downloaded the reporter's
actual project, confirmed the mismatched wire reads color="#0000ff" on
one side of a "Folio suivant"/"Folio precedent" link and
color="#55aa00" on the other, with the link's other four conductors
matching correctly (ruling out a rendering artifact) -- see PR #980's
checkContinuity() extension, which now flags this class of mismatch on
sight.

Extracted the comparison into its own static
reportLinkNeedsPotentialChoice(), for the same reason
ConductorCreator::needsPotentialChoice() already exists as its own
method: a caller with nobody there to answer a modal dialog needs to
check first and decline, and the condition must not drift away from
the one redo() actually applies.

Fixing the comparison surfaced a real, previously-latent hang in this
session's own qet.linkElements(): PotentialSelectorDialog::exec() is a
plain QDialog::exec(), not routed through QET::QetMessageBox, so
headless --run has nobody to answer it. Measured directly -- hung
until killed with the property-comparison fix alone, clean refusal
after adding the guard. linkElements() now calls
reportLinkNeedsPotentialChoice() before constructing the command and
declines with a clear reason, the same choice addConductor() already
makes about ConductorCreator's own equivalent dialog.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 23:00:05 +12:00
ispyisail a2e384761c Sync misc/qet-mcp: report-link tests updated for the #974 fix
link_elements() now correctly refuses a mismatched report link instead
of allowing it (see the two preceding commits), so the
report_link_mismatch reproduction can no longer be built by linking
two already-differently-coloured conductors -- that path is refused
before it happens. Updated to patch a saved file's XML directly
instead (the same technique test_continuity_detects_a_tampered_
potential already uses), since a file QElectroTech's own edits produce
can no longer end up in this state at all. Adds
test_link_elements_refuses_a_mismatched_report_link to cover the
refusal itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 22:52:58 +12:00
ispyisail 4283ddad10 linkElements: refuse a report link that would pop a modal dialog
Fixing LinkElementCommand's property comparison (previous commit)
means it now correctly detects a report-link colour/style mismatch --
which means it now correctly pops PotentialSelectorDialog for one,
same as the GUI. Under headless --run there is nobody to answer a
plain QDialog::exec(), so this hangs forever; confirmed directly with
a timeout before adding this guard.

qet.linkElements() now checks LinkElementCommand::
reportLinkNeedsPotentialChoice() before constructing the command and
declines with a clear reason pointing at checkContinuity() and
setConductorProperty(), the same choice addConductor() already makes
about ConductorCreator's own equivalent ambiguous-potential dialog.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 22:52:48 +12:00
ispyisail 1046b97080 Fix report-link colour/style mismatch detection (bugtracker #974)
LinkElementCommand::redo() already had a check meant to catch exactly
this -- two report-linked conductors whose properties disagree -- and
ask the user which to keep via PotentialSelectorDialog. It never
worked: it built ONE combined list from three unrelated fields
(tension_protocol, wire_color, wire_section) and tested that whole
list for string equality, so a tension-protocol value could never
equal a wire-colour value even when every field individually matched
across every conductor. Worse, "wire_color"/"wire_section" are
ConductorProperties::m_wire_color/m_wire_section, a separate free-text
documentation pair that says nothing about how the wire is actually
drawn -- that's "color"/"style" -- so the one field #974 is actually
about was never compared at all.

Fixed by comparing each relevant field (text/num, function, tension
protocol, colour, line style) separately. Downloaded the reporter's
actual project, confirmed the mismatched wire reads color="#0000ff" on
one side of a "Folio suivant"/"Folio precedent" link and
color="#55aa00" on the other, with the link's other four conductors
matching correctly (ruling out a rendering artifact) -- see PR #980's
checkContinuity() extension, which now flags this class of mismatch on
sight.

Extracted the comparison into its own static
reportLinkNeedsPotentialChoice(), for the same reason
ConductorCreator::needsPotentialChoice() already exists as its own
method: a caller with nobody there to answer a modal dialog needs to
check first and decline, and the condition must not drift away from
the one redo() actually applies.

Fixing the comparison surfaced a real, previously-latent hang in this
session's own qet.linkElements(): PotentialSelectorDialog::exec() is a
plain QDialog::exec(), not routed through QET::QetMessageBox, so
headless --run has nobody to answer it. Measured directly -- hung
until killed with the property-comparison fix alone, clean refusal
after adding the guard. linkElements() now calls
reportLinkNeedsPotentialChoice() before constructing the command and
declines with a clear reason, the same choice addConductor() already
makes about ConductorCreator's own equivalent dialog.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 22:52:38 +12:00
ispyisail a766f9a975 Sync misc/qet-mcp: report_link_mismatch check, NEXT_REPORT/PREVIOUS_REPORT fixtures
Brings misc/qet-mcp up to date with checkContinuity()'s new
report_link_mismatch finding: updated qet_continuity's description,
and two new tests reproducing #974 with the shipped 02going_arrow.elmt/
01coming_arrow.elmt pair (no custom fixtures needed -- this element
type already ships).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 22:37:43 +12:00
ispyisail 68503e2a7d checkContinuity: catch cross-folio report-link colour/style mismatches
New report_link_mismatch finding (severity "warning", not "error" the
way potential_mismatch is): a next_report/previous_report folio-jump
pair whose conductors disagree on colour, style, num, or any of the
other checked properties. Unlike potential_mismatch, this one is not
proof of external tampering -- LinkElementCommand::isLinkable() only
ever checks type and freedom (see its own doc comment), never conductor
properties, so nothing in QElectroTech copies one side's colour onto
the other when a report link is made or keeps them in sync afterwards.
This is a real, unenforced gap reachable through completely ordinary
use, not a defect a script or the GUI could introduce.

Reproduces qelectrotech/qelectrotech-source-mirror#974 exactly:
downloaded the reporter's actual project, traced the mismatched wire to
a "Folio suivant"/"Folio precedent" link pair, and confirmed via query
that the two sides read color="#0000ff" and color="#55aa00" while the
link's other four conductors (0V/Low/High/Ground) matched -- ruling out
a rendering artifact. Verified fresh with a synthetic reproduction
(tests in misc/qet-mcp) using the shipped 02going_arrow.elmt/
01coming_arrow.elmt pair, giving exactly one finding, not one per
folio-link conductor.

Also fixes a real gap in the existing potential_mismatch check while
here: checked_properties was missing "color" and "style" entirely,
checking only "conductor_color" (ConductorProperties::m_wire_color, a
separate free-text documentation field, typically empty) -- meaning
the same-folio version of this exact bug class would have gone
undetected too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 22:36:45 +12:00
ispyisail 3b05f5cf13 Sync misc/qet-mcp with the extended scripting API
Brings misc/qet-mcp up to date with the scripting API additions in
this branch: qet_edit gains ops for tables, PLC master IO tables and
PLC-slave linking, manual conductor segment routing, polygon and path
shapes, PDF page import, and project-wide search & replace; a new
qet_continuity tool exposes the electrical continuity/ERC-style checks.

Adds the test suite that did not exist here before (150 tests: unit
validation, JSON-RPC protocol, and Integration/PlcIntegration/
CorpusIntegration runs against a built binary) plus the two minimal
PLC fixture .elmt files it needs (no shipped element has masterType/
slaveType "plc" to test against).

Also removes a __pycache__/*.pyc that had been committed by mistake,
and ignores __pycache__/*.pyc going forward.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 22:03:04 +12:00
ispyisail 2906a48aab Add electrical continuity checking to the scripting API
qet.checkContinuity(folioIndex) runs two structural checks against the
live Terminal/Conductor object graph -- Terminal::conductors() and
Conductor::relatedPotentialConductors(), the same primitive
setConductorProperty() already uses -- rather than a heuristic read of
the saved XML:

- unconnected_terminal (info): a terminal with no conductor at all.
  Deliberately low severity -- routine (a spare relay contact, an
  unused optional pin), not necessarily a mistake.
- potential_mismatch (error): two conductors electrically on the same
  potential (following bridged terminal strips and linked report
  elements, matching setConductorProperty()'s own scope) disagreeing
  on num/conductor_color/conductor_section/function/bus/cable.
  QElectroTech's own edits always keep every member of a potential
  identical, so any divergence found here came from hand-edited XML,
  a legacy file, or an external tool -- verified with a test that
  patches a saved file's XML directly to introduce exactly that.

Documented plainly what this does NOT check and why: pin electrical
direction/power conflicts and No/Nc/Common contact shorts, since
QElectroTech's terminal data model (Generic/Inner/Outer/No/Nc/Common --
contact role within one relay, not signal direction) does not carry
the information either would need. This is continuity/consistency
checking, not full ERC.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail a542b911e9 Add project-wide search & replace to the scripting API
qet.searchAndReplace(kind, field, pattern, replacement, useRegex,
caseSensitive) finds and replaces a substring or regular expression
within one text field across every folio, as a single undo step --
kind is element_info, conductor or text. Unlike a script loop over
elementInfo()/setElementInfo() (or the conductor/text equivalents)
doing the same thing one item at a time, each pushing its own undo
entry, this wraps the whole run in one macro.

This is deliberately NOT a wrapper around QET's own "Search and
replace" panel (SearchAndReplaceWorker): that one is a batch
overwrite-with-sentinel template built for picking items from an
interactive tree, a poor fit for a script that can already say
precisely which items it means. This does what the name plainly says
instead -- an actual substring/regex replace within each item's
current value.

Found and fixed while writing the first conductor-kind test: a hub
topology (several conductors sharing one terminal, e.g. a star wiring)
made the conductor branch pick terminal1 unconditionally to address a
Conductor object through setConductorProperty() -- for a hub member
conductor, terminal1 is the shared, ambiguous hub terminal itself
(findConductor() correctly refuses to address a conductor through a
terminal carrying more than one), so every conductor touching that hub
silently failed to update, returning a changed count of 0 with no error
for a genuinely matching project. Fixed by preferring whichever of
terminal1/terminal2 carries exactly that one conductor.

Also caught during testing: an empty macro (a run that matches
nothing) still gets pushed onto the undo stack by QUndoStack::endMacro()
-- it is not silently discarded the way the earlier revision assumed --
leaving a confusing no-op "Rechercher et remplacer" undo entry. Fixed
by counting matches in a dry run first and never touching the undo
stack at all when that count is zero.

textContent() is a new small getter alongside the existing
setTextContent(), filling a gap this needed (reading an independent
text's current content) that is independently useful too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 9cee71bde2 Add PDF page import to the scripting API
qet.addPdfPage() renders one page of a PDF file to an image and
places it, through the same QPdfDocument::render() call, white-
background compositing (a transparent page would otherwise show
whatever is under it, unlike every other placed image) and
DiagramImageItem/AddGraphicsObjectCommand underneath as the "add PDF"
toolbar action's own file/page-selection dialogs.

Only reachable in a build with the QtPdf module (Qt >= 6.4) -- some
Qt6 distributions omit it entirely (see diagrameventaddpdf.h). The
method is still always declared and compiled, guarded internally
instead of with the class itself: a script asking whether qet.addPdfPage
exists must never get "not a function" for a reason it has no way to
discover. Refuses with a clear reason when the module is missing, the
page number is out of range, the file cannot be loaded, or the
resulting render is degenerate.

Verified against a real 2-page PDF (this session installed qt6-pdf-dev,
which was missing here) that the two rendered pages differ in content
and that dpi scales the rendered pixel size linearly, not just that the
call returns something.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 687837d7a3 Add polygon and path shapes to the scripting API
addShape()'s own "polygon" only ever produces the degenerate two-point
form -- it shares addShape()'s p1/p2 constructor and nothing else.
addPolygon()/setShapePolygon() take an arbitrary point list through
QetShapeItem's public setPolygon(), pushed via the existing "polygon"
Q_PROPERTY the same way a point-handle drag would.

addPath()/setShapePathNodes() add the Path shape type: a polygon's
points plus, per node, a kind (corner/smooth/symmetric) and optional
bezier in/out handles, the same model the pen tool and node-edit mode
build. PathNode holds std::optional<QPointF> members and isn't
Q_PROPERTY-friendly, so setShapePathNodes() reuses PromoteShapeCommand's
before/after XML snapshot mechanism instead -- the same fallback
QetShapeItem::associatedUndoCommand() already uses for the identical
reason on a PathAnchor/PathControlIn/PathControlOut handle drag.

setShapeClosed() opens or closes a polygon or path through the existing
"close" Q_PROPERTY. shapePolygon()/shapePathNodes() read a shape's
current geometry back in scene coordinates, refusing (empty) on the
wrong shape type.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail ea1f65107e Add manual conductor routing to the scripting API
Conductor::moveSegment(index, dx, dy) is the same primitive
handlerMouseMoveEvent()/handlerMouseReleaseEvent() apply on a drag --
move both axes on the target segment (each of ConductorSegment's
moveX()/moveY() silently no-ops on the wrong axis or a static,
terminal-anchored segment), recompute the path, and push one
ChangeConductorCommand undo step via the existing saveProfile().

Caught while writing the first test for it: moveSegment() never set
modified_path, so Conductor::toXml() skipped writing <segment> children
and a manually rerouted conductor silently reverted to auto-routing on
the very next save -- the change took effect in the running scene but
never reached disk. Fixed by setting the flag, the same as every other
path-modifying call site already does.

qet.conductorSegments() lists a conductor's segments (endpoints in
scene coordinates, orientation, static/movable) so a script can find
the index it wants; qet.moveConductorSegment() applies the move and
refuses a static segment or an out-of-range index.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 6380e2a46b Add PLC master IO table and PLC-slave group-index linking
addPlcIO/setPlcIO/removePlcIO edit a PLC master's IO table (type,
address, function text, comment) directly through setElementData(),
the same as MasterPropertiesWidget's own PLC IO editor -- and, like it,
these are not undoable: MasterPropertiesWidget::associatedUndo()
deliberately returns nullptr for PLC masters, since their linking is
managed through the IO table rather than the link-tree widget it would
otherwise build an unlink-all command from.

linkElements() gains an optional groupIndex so a PLC slave can be
linked onto one specific IO row instead of leaving the row
unspecified. LinkElementCommand only reads the group index it is given
when the command's own element is the Slave -- when built from the
Master side (a=master, b=slave, the usual call shape) it looks in a
per-slave map this call never populates, and setGroupIndex() is
silently a no-op. Fixed by building the command from whichever of the
two elements is actually the Slave, matching what PlcLinkWidget does.
elementLinkGroupIndex() reads the result back.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 219273a8e5 Add table placement to the scripting API
QetGraphicsTableFactory::create() only reads settings already set on an
AddTableDialog and never depended on the dialog being shown, so make it
public alongside setTableName()/setAdjustTableToFolio()/
setAddNewTableToNewDiagram() on AddTableDialog -- this lets the scripting
API build and configure a dialog headlessly instead of exec()'ing one.

qet.addTable() requires a non-empty query: ElementQueryWidget and
SummaryQueryWidget both default to zero selected columns, so an empty
query silently produced a table with no rows rather than a sensible
default. qet.tables()/deleteTable() list and remove by a position-sorted
index. qet.setTablePosition() repositions one, since newTable() always
places a new table at a fixed (50, 50) and a folio with more than one
needs to move all but the first itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 8a2d31d835 Let a script group, bridge and sort a terminal strip's real terminals
stripRealTerminals(strip)              index, owning element, current
                                          physical position, neighbours
  groupTerminals(strip, indices)         merge onto one physical position
  bridgeTerminals(strip, indices)        wire together without merging
  sortTerminalStrip(strip)               canonical physical order

Each goes through the same command the terminal strip editor's own
group/bridge/sort buttons push (GroupTerminalsCommand,
BridgeTerminalsCommand, SortTerminalStripCommand), so a script's changes
undo like the editor's.

groupTerminals() replicates the editor's own receiver-selection heuristic
line for line rather than picking the first terminal named: the physical
position that already carries the most real terminals receives the
others, not necessarily the one at index 0. Verified with a case built to
distinguish the two: three terminals grouped first (one position, three
real terminals), then a fourth, previously-alone terminal grouped with
one of those three, named first in the call -- the alone terminal moved
onto the three-terminal position, ending at four, not the other way
around.

bridgeTerminals() refuses through TerminalStrip::isBridgeable() itself,
the same check the editor's bridge button applies, rather than
re-deriving what "the same level" means. Real terminals are addressed by
index into stripRealTerminals(), the strip's own order; grouping shifts
later physical-position indices down, so the header says to re-list
after a change that adds or removes one, the same rule already
documented for texts, shapes and images.

Verified end to end on four placed terminal elements: added to a strip,
grouped two, refused a group of one and an out-of-range index, bridged
the remaining two, sorted, undo restoring order without disturbing the
grouping (sort doesn't touch it, so it shouldn't), and a bad strip index
refused on all three operations. Qt 6.10.2, build clean, ctest 12/12,
coherence gate clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail a8f883601d Let a script list, embed and apply a folio's title block template
titleBlockTemplates()          embedded + common/company/custom, by name
  embedTitleBlockTemplate(name)  copy one into the project's own collection
  setFolioProperty(f,"template",name)  embed-if-needed, then apply
  folioProperty(f,"template")

Not the trivial addition to the existing title-block-field list it looked
like at first. Diagram::setTitleBlockTemplate() resolves a name only
against QETProject::embeddedTitleBlockTemplatesCollection() -- the exact
same copy-into-the-project step addElement() already goes through for
elements, and for the same reason: a project opened on another machine
must not depend on files only this one has. embedTitleBlockTemplate()
does that copy through get/setTemplateXmlDescription(), the same round
trip the template editor itself uses to save one -- not scripting-specific
code, and unlike defining an auto-numbering context, not undoable, for the
same reason that isn't: the application does both through direct
collection/project calls with no undo command of their own.

Two things found only by testing, not by reading:

- "default" is a real template name in the common collection, and setting
  a folio's template to it is legitimate -- but
  BorderTitleBlock::titleBlockTemplateName() normalises a template
  literally named "default" back to "", indistinguishable from no
  override, since that is genuinely what "no override" renders with. The
  first version compared the raw name and reported success as failure;
  fixed by comparing against that same normalised form, which folioProperty()
  now also documents.
- QElectroTech resolves the common template collection from a compiled-in
  path (here, an absolute /usr/share/qelectrotech/titleblocks, not
  relative to the binary), and --common-tbt-dir, the CLI override, is
  read by QETApp::parseArguments() -- which the --run headless path never
  reaches, confirmed by the CLI itself swallowing the flag as a stray
  positional argument. There is no QSettings fallback the way
  commonElementsDir() has. So testing this at all needed the path to
  genuinely exist; no environment trick from inside the process reaches
  it.

Verified: 10 common templates listed; DIN_A4 embedded and applied,
folioProperty reading it back; re-applying the same name a no-op success;
an unknown name refused; "default" applied and correctly read back as ""
per the note above; both folios exported to PNG and visually compared --
plain default rendering vs. DIN_A4's logo, revision table and field
layout, genuinely different, not just an API call returning true. The
choice survives a save and reload. Qt 6.10.2, ctest 12/12, coherence gate
clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail cd27912605 Let a script read where an element is, and insert a folio at a position
elementGeometry(folio, uuid)   x, y, rotation, left, top, right, bottom
  insertFolio(position)

The API could set an element's position but never read it, so a script
could not lay one thing out relative to another, or check that a move had
landed; verification had to go through the saved file. elementGeometry
returns the origin (what setElementPosition sets), the rotation, and the
box the element occupies on the folio -- its drawn extent, which sits at
the element's hotspot from the origin and, once rotated, is the rotated
extent.

Measured on a coil whose hotspot is (17, 32): placed at (200, 300) the box
is 183..223 by 268..328, exactly that far from the origin; a move of
(+50, -20) shifts both together; a 90 degree turn swaps the box to 60 by
40 about an unchanged origin and 180 turns it back; and the origin agrees
with the saved file (x=250 y=280, orientation 2 for 180 degrees).

insertFolio puts a folio at a position (0 first, folioCount() last) through
QETProject::addNewDiagram(pos), undoable. The position is checked in the
binding: QETProject::addDiagram() hands it straight to QList::insert(),
which is undefined past the end, so -1 and anything above the count are
refused with a reason. Verified: first, middle and last insertions land in
the right order, and undo and redo of an insertion restore the order.
Folio reordering itself still needs the application's project view.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail f087820757 Let a script rename the project and reshape a folio's frame
setProjectTitle(title)
  folioBorder(folio, prop)  setFolioBorder(folio, prop, value)

The frame is the grid of columns and rows around a folio: columns,
column-width, display-columns, rows, row-height, display-rows -- the six
fields the folio properties panel offers -- through ChangeBorderCommand,
so it undoes like a hand edit. The title block's header sizes, which the
panel does not offer, are left alone. Changing the project title is not
undoable, because the application sets it directly too.

Counts are 1 to 99 and sizes 1 to 1000. The panel's upper limits are the
same; its lower limit is 0, which is not offered: a grid with no columns
has no use here and 0 was not tested, so it is refused rather than
assumed safe. The extremes that are offered (99 x 99 cells, widths from 1
to 1000) were exported to PNG without a hang or crash. Fractions, out of
range values, an unknown property and a bad folio are refused with a
reason.

Verified: ten columns of 40 and four rows of 100, undo of the last change,
and the folio and the renamed project read back after a reload. My first
reload check read the wrong folio and briefly looked like the border was
not persisted; the file itself had the right values.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 2772b690e8 Let a script duplicate elements, with the conductors between them
duplicateElements(fromFolio, [uuids], toFolio, x, y)
  selectedElements(folio)

What Ctrl+C and Ctrl+V do: the named elements are selected, serialised
with Diagram::toXml(false, true), the previous selection is put back, and
the copy is pasted with Diagram::fromXml() and a single
PasteDiagramCommand. A conductor is copied only if both its ends are among
the copied elements. As on a paste in the application, the copies come
without labels or their conductors' wire numbers (measured: empty on
both). One undo removes the elements and the conductor together.

Three properties found by measuring rather than assuming:

- Position is the top left of the pasted group's bounding rectangle, so an
  element's own origin ends up offset by its hotspot: +20, +30 for a coil,
  identical across two trials. (0, 0) is not a position; Diagram::fromXml
  treats the origin as "keep the source coordinates".
- The application's pasted list is in scene order, not the order the
  elements were named. Asking for the elements at x = 700, 100, 900 returned
  the copies of 100, 700, 900, so a caller pairing copies with sources by
  index was wired to the wrong ones with no error. A paste is a pure
  translation, so sorting sources and copies by position pairs them, and
  the result is returned in the order asked. Checked with a scrambled
  request over a zig-zag layout: every copy is the identical translation
  (-30, -20) from the source at its index. Two elements at one point cannot
  be told apart; if the counts disagree it says so and returns the
  unpaired list rather than guess.
- Copying works by selecting, so the previous selection is given back;
  selectedElements() exists to make that checkable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 279b001a16 Let a script apply element auto-numbering
useElementAutoNum(name)   select the current element numbering context
  numberElement(folio, el)  give one element its label from it

numberElement calls Element::setUpFormula(), the call the "add element"
tool makes right after placing an element, so a script gets the same
numbering: three coils numbered in turn are K1, K2, K3, and the counter
persists in the project (after a reload the next element is K3).

It is a separate call rather than a change to addElement(), which is
merged code: numbering what it places would change what an existing
script produces the moment its project happens to have a context selected.
A slave or a report is refused, since it takes its label from its master,
and so is a project with no context selected, instead of reporting a
success that did nothing.

setUpFormula() has a hazard for an element that is already placed. It
writes the label straight into the element's information and pushes only
the counter's advance onto the undo stack. Placing a new element hides
that, because undoing the placement removes the element; for an existing
one, a single undo rolled the counter back and left the label, so c3 stayed
"K3" while the counter went back to expecting K3 and the next numbering
would repeat a label it had forgotten. So the label it computed is taken,
the information put back, and the change pushed as a command inside the
same macro as the counter: one undo now reverts both, and renumbering c3
afterwards yields K3 again. Redo and the database agree.

Folio auto-numbering is deliberately not offered: in the application it
spawns whole new folios from a context, which is a different operation
from labelling. "Renumber existing conductors" has no equivalent to bind --
conductor numbering is applied when a conductor is created or moved, and
QElectroTech has no renumber-all action.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 59cc758b7f Let a script control the text fields drawn on a symbol
elementTexts()  addElementText()  setElementTextProperty()
  elementTextProperty()  deleteElementText()

A symbol arrives with the fields its definition gives it -- coil
bobine_ka_a_remanence has A2, A1 and a label -- and until now a script
could fill the value the label shows (setElementLabel) but not control
the fields themselves: where each sits, its size, whether it is framed,
what it is bound to, or add and delete one.

A field's source is "text" (a fixed string), "info" (follows one of the
element's information keys, so it follows setElementInfo and
setElementLabel) or "composite" (a formula). Changes go through
QPropertyUndoCommand on the item's own properties, as the element-texts
editor does, and adding through AddElementTextCommand. An unknown source,
a key that is not an element information key, a non-positive size and a
bad index are refused with a reason.

Two things called text differ for an information-bound field. The "text"
property is the stored string, an unused placeholder (empty, or "Texte"
for a newly added field); "shows" is what is drawn. I first believed the
displayed text was stale in-session and wrote a helper to read it from the
element's information instead. That was wrong: comparing toPlainText()
against elementInfo() at seven points across relabel, rebinding, setting
and undo found no difference. It was the stored string that looked stale,
and the helper and the comment claiming the item "refreshes lazily" are
removed. The header now says which is which.

Fields are addressed by index in the element's own list, which follows the
definition and shifts on delete; undoing a deletion puts the field back at
the end. Consecutive info/label changes on one element merge into one undo
step (ChangeElementInformationCommand::mergeWith), so one undo can revert
several -- noted, not a bug.

Verified on a coil: the label field moved, enlarged to 14 pt and framed, a
new field bound to "comment" showing "24VDC coil", all through the
project, exported to PNG and looked at. The saved file carries the moved
position, size, frame and bound value, and a reload reads them back.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 0c958d3b66 Drop "version" from the folio properties: it was a silent no-op
setFolioProperty(f, "version", "V9-USER") returned true and changed
nothing. TitleBlockProperties::version is the file-format stamp
QElectroTech writes on every save, so a value set through the API reads
back as "0.200.1-dev" and is what ends up in the file.

A property that reports success and does nothing is the failure this API
is careful to avoid everywhere else, so it is removed rather than
documented. It went in untested: the earlier verification set author and
plant and never tried the other six names.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 528d33792d Say what order a terminal index actually follows
The comment on elementTerminals() said the order of Element::terminals()
"also comes from the definition", which reads as file order and is
wrong. Element::parseTerminal() re-sorts the list on every insertion, top
to bottom then left to right on each terminal's local position, so index 0
is the topmost terminal whatever order the .elmt lists them in.

bobine_ka_a_remanence.elmt writes A2 (y=20) before A1 (y=-20) and index 0
is A1. Measured by placing 400 shipped elements and reading the real order
back: a top-to-bottom, left-to-right prediction matched all 400, while
file order matched only the 100 where the two happen to coincide. Of the
837 shipped elements with distinct named terminals, 619 list them in a
different order than QElectroTech indexes them.

Comment only. Two terminals at one point tie and the sort is not stable;
the comment says so.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail fc41cf9f5d Let a script place an image
images()  addImage()  setImageScale()  setImageRotation()  deleteImage()

addImage reads a file the way the "add image" tool does after its file
dialog and pushes the same AddGraphicsObjectCommand. The pixels are
copied into the project, which DiagramImageItem::toXml writes inline, so
the saved file does not refer to the original path: verified by moving the
source file away and reloading, where the image and its scale came back.
The price is that the project grows by about the size of the image, so
files over 10 MB are refused; so are unreadable files, non-images and
missing paths, each with its own reason.

Scaling sets both axes as one undo step. Images are addressed by index in
a position-sorted listing like texts and shapes, by the on-screen
bounding box -- so because an image turns and scales about its centre,
scaling or rotating one can change where it sorts, and the header says to
re-list after either. Observed: a 2x scale moved a listed top-left from
(100,100) to (68,84), which is that, not a displacement.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:31 +12:00
ispyisail 7f04bc1572 Let a script style a shape
shapeProperty()/setShapeProperty()   color, fill, width, line-style, rotation

Through QPropertyUndoCommand on the pen, brush and rotation properties
the shape's own style editor changes, so it undoes like a hand edit.
fill takes a colour or "none" for no fill; line-style is solid, dashed,
dotted or dashdot. A colour that does not parse, a non-positive width,
an unknown style or property and a bad index are refused with a reason.

Verified on a rectangle: all five set and read back, fill "none" reads
back as none, undo restores the previous fill, and the whole look
survives save and reload.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:30 +12:00
ispyisail 27bbf51024 Let a script style a conductor
setConductorProperty()/conductorProperty() now also take the properties
that control how a conductor looks, under the names the .qet file uses:

  style        normal, dashed or dashdotted
  bicolor      true/false, with color2 as the second colour
  dash-size    positive integer
  condsize     positive number (line width)
  numsize      positive integer (text size)
  displaytext  true/false

Values are validated rather than stored: a boolean other than
true/false, a non-positive size, an unparseable colour or a line style the
file format cannot express is refused, because ConductorProperties would
write the latter back as a solid line and silently lose it. The change is
still applied to the whole potential.

Verified: all eight set, read back, written to the file in its own form
(style as "line-style: dashed;", displaytext as 0) and read back
again after a reload. Four invalid values decline.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:30 +12:00
ispyisail 65299e1178 Let a script define and select auto-numbering
autoNums(kind)                 list contexts and their formulas
  addAutoNum(kind, name, parts)  define one; parts are "type[:value[:increase]]"
  removeAutoNum(kind, name)
  useConductorAutoNum(folio, n)  new conductors on a folio take it

Kinds are conductor, element and folio. Part types are the ones the
auto-numbering dialog offers; anything NumerotationContext rejects, an
unknown kind, a non-numeric increase or a missing context is refused
with a reason rather than dropped.

Defining and removing a context is not undoable, because the
application does it through direct project calls; only the counter
advance is on the undo stack. useConductorAutoNum sets both the folio's
name and the project's current name, because the numbering code reads
the context by one and writes the advanced counter back under the other.

Verified: a "W" + unit context selected on a folio, two conductors
wired, W1 and W2 in the saved file, and the context survives reload.
Depends on the preceding ConductorCreator fix for the database to agree
with the drawing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:30 +12:00
ispyisail 8e2a29deaf Update the database row once an auto-numbered conductor has its number
ConductorCreator inserts a conductor and only afterwards calls
refreshText(), which resolves the auto-numbering formula into
properties.text. The project database inserted its row while text was
still the raw formula, and refreshText() writes the resolved text
without emitting propertiesChange -- the signal the database listens
for -- so nothing corrects the row.

Measured: with a conductor auto-numbering "W%sequ_1" selected, two
wired conductors read W1 and W2 on the live objects and in the saved
file, but "W%sequ_1" and "W%sequ_1" in conductor.text and in
wiring_list_view.wire_number. A full updateDB() corrects it, so the
data was right and only the cache was stale. Anything that reads the
database between creating a conductor and the next rebuild -- the
wiring list, a BOM export, a custom query -- sees the formula, not the
number.

Update the row after refreshText(). The row change deliberately emits no
dataBaseUpdated(), as updateConductor() already documents, so this adds
no model re-queries.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:30 +12:00
ispyisail 5b739c3338 Let a script build a terminal strip
terminalStrips()        the project's strips, in its own order
  addTerminalStrip()      AddTerminalStripCommand, as the creation dialog does
  removeTerminalStrip()   RemoveTerminalStripCommand
  addTerminalToStrip()    AddTerminalToStripCommand

Only terminal-type elements can be added, the restriction the editor
enforces by construction; anything else, or a terminal already on a
strip, or a bad index, declines with a reason. Verified: two terminal
elements placed and added, listing shows 2 terminals, removal and undo,
and the strip with its terminals survives save and reload.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:30 +12:00
ispyisail a1e4e153ae Let a script delete a conductor or a folio, and set title block fields
deleteConductor()    the conductor on a terminal, addressed as elsewhere
  removeFolio()        RemoveDiagramCommand, the GUI's delete-folio command
  setFolioProperty()   title, author, filename, plant, locmach, indexrev,
  folioProperty()      version, folio -- via ChangeTitleBlockCommand

deleteConductor removes only the named conductor; unlike a property
change it is not potential-wide, and DeleteQGraphicsItemCommand rebuilds
the rest of the potential so it stays connected, as when a user selects
one conductor and presses Delete. Verified: deleting one leaf of a
three-terminal potential leaves the other conductor, with its number.

removeFolio skips the GUI's confirmation box, which nobody could answer
headlessly. Undo and redo both work; later folio indexes shift down.
Undoing a removal prints a UNIQUE-constraint warning from
projectDataBase::addDiagram. That is inside RemoveDiagramCommand::undo(),
which the GUI runs too, so it predates this change.

The date and template are not offered as folio properties: the date has a
use-current-date mode a plain string cannot express honestly.

Verified headlessly, including save/reload of the title block fields.
Qt 6.10.2, build clean, ctest matches master.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:56:30 +12:00
Laurent Trinques 56f60be60a CI: try to fix 404 error on downlad page 2026-09-22 10:16:49 +02:00
Laurent Trinques 852f581206 Merge pull request #971 from arummler/fix-translation-syntax-02
Fix translation syntax follow-up
2026-09-22 09:57:30 +02:00
Laurent Trinques 3b626a7d1a CI: try to fix 404 error on downlad page 2026-09-22 09:50:14 +02:00
Andre Rummler 069a75d44b Use pugixml target in test removing the old directly including approach. Fix a static variable which is now missing as the correspondign source file is not used by the particular test. 2026-09-22 09:08:03 +02:00
Andre Rummler e1f887a036 Standarize pugixml header path to recommended variant with target INTERFACE. 2026-09-22 09:07:27 +02:00
Laurent Trinques c5edd0a54b CI: try to fix 404 error on downlad page
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 2m11s
2026-09-22 08:19:23 +02:00
Laurent Trinques 3a13287ba9 CI: delete auto-doxygen.yml 2026-09-22 08:05:53 +02:00
Andre Rummler 24776bfcf6 Avoid setting globally QLocale which was introduced in a recent MR as it will change number formats, etc. which is not necessarily what a user switching language wants. Beside that
small fix of a trasnlation comment.
2026-09-22 08:03:07 +02:00
Andre Rummler 3202c145e8 Fix French origin strings (language improvement). 2026-09-22 08:03:07 +02:00
Laurent Trinques 4888ae87f3 Merge pull request #978 from Kellermorph/feature/refresh-all
fix: update composite text %{label} when folio changes
2026-09-22 07:53:36 +02:00
Laurent Trinques 59344eb565 Merge pull request #977 from ispyisail/fix/591-text-resize-handles
Fix #591's resize handles: unreachable via plain click, wrong position
2026-09-22 07:51:32 +02:00
Kellermorph 5d033bf1b2 Add custom application color picker in global settings
Add a KColorButton next to the 'Utiliser les couleurs du système'
checkbox in the Apparence settings tab:

- When the checkbox is active (default), system colors are used
  and the color button is disabled
- When the checkbox is inactive, the color button becomes active
  and lets the user pick any color for the entire application
- useCustomPalette() builds a full QPalette from the chosen color
  with proper light/dark text contrast, button shading, and icon
  theme switching
- The chosen color is persisted in QSettings as
  'customapplicationcolor' and restored on next startup

Files changed:
- sources/ui/configpage/generalconfigurationpage.ui: HBoxLayout
  with checkbox + KColorButton, customwidget declaration
- sources/ui/configpage/generalconfigurationpage.h: new slot
- sources/ui/configpage/generalconfigurationpage.cpp: load/save
  custom color, enable/disable logic, toggled slot
- sources/qetapp.h: useCustomPalette() declaration
- sources/qetapp.cpp: useCustomPalette() implementation,
  startup restore of custom color
2026-09-21 22:05:31 +02:00
Kellermorph 8985babfe7 fix: update composite text %{label} when folio changes
DynamicElementTextItem::updateLabel() resolved %{label} in composite
text using the stale value from elementInformations()["label"], which
is only set once at load time and never updated when the folio/page
number changes.

Use element->actualLabel() instead, which resolves the label formula
(including %F, %f, %id) against the current folio at call time.
2026-09-21 21:45:03 +02:00
ispyisail 29d16c3337 Fix #591's resize handles: reachable only via Shift/right-click, wrong position
Two bugs reported by @arummler on #591 after merge:

  "It works but to select the text field one has to right click on
  it...I think there are competing handlers or something."
  "the drag elements should be on the border of the box. In the
  moment they appear directly left and right from the text."

Both reproduced headlessly (scripts/qet-gui-dialog.sh) against a fresh
build of current master and root-caused before touching anything.

Selection: DynamicElementTextItem::mousePressEvent() forwards a plain
click (no Shift) straight to parentElement()->mousePressEvent(), by
design and pre-existing -- it's what lets dragging a symbol by its own
label move the whole symbol rather than just the label. That's correct
and untouched here. But it means a plain click leaves the *parent*
selected, not the text, and #591's handles were wired only to the
text's own ItemSelectedHasChanged -- so they were only reachable via
Shift+click or a right-click's context menu (which happens to select
the item under the cursor for its own context menu, unrelated to the
Shift path), neither of which anyone reaches for to resize a text.
Confirmed with screenshots at each step, including that Shift+click
already reached the existing (if misplaced) handles correctly.

Fix: DynamicElementTextItem::refreshResizeHandlesVisibility() shows the
handles when either the text itself or its parent element is selected,
and Element gets an itemChange() override (it had none) that calls it
on each of its own texts when the element's own selection changes. Both
sides driven from itemChange(), Qt's own hook for exactly this and the
same one already used for the text's own selection.

First attempt drove this from paint() instead, since the PR's own
updateResizeHandlesPos() already runs there. That crashed reproducibly
(SIGABRT) on deselecting a text: paint() runs while QGraphicsScene
iterates its item list to draw it, and addResizeHandles()/
removeResizeHandles() mutate that list via QGraphicsScene::addItem()/
removeItem(), which cannot safely happen mid-iteration. Caught it with
the same headless repro before it went anywhere near a PR, moved the
logic to itemChange(), and re-ran the full sequence -- select, resize,
undo, deselect, twice through -- clean.

Position: updateResizeHandlesPos() placed the handles on frameRect(),
which is a box sized to the text's natural (idealWidth()) content and
then re-centred inside boundingRect() -- it does not grow with
textWidth(). Once a text has been widened, frameRect() stays tight
around the glyphs while boundingRect() -- the box QGraphicsView actually
outlines as the selection, and the box a user drags relative to -- grows
around it, leaving the handles stranded well inside the visible
selection border. Fix: position them on boundingRect() instead, which
does track textWidth(); confirmed by widening a text and checking the
handle lands exactly on the new edge rather than partway across it.

Verified headlessly end to end on the original report's own element
("motor off" on grafcet.qet, folio 1): a single plain left-click (no
Shift, no right-click) now shows both handles at the true box border;
dragging resizes correctly and the handle tracks the growing edge;
Ctrl+Z restores the -1 auto-width sentinel and the handles stay at the
reverted position; clicking away removes them; repeated twice with no
crash. Qt 6.10.2, ctest 12/12, no new warnings in either changed file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 07:30:39 +12:00
Laurent Trinques 61f5e5e502 Merge pull request #972 from arummler/fix-pugixml-linking
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m42s
fix PUGIXML linking
2026-09-21 19:36:28 +02:00
Laurent Trinques 77bc9ed8e4 Merge pull request #976 from arummler/untrack-qch
Stop tracking *.qch via LFS.
2026-09-21 19:35:48 +02:00
Andre Rummler 9b26d5dc6a Stop tracking *.qch via LFS. 2026-09-21 17:57:59 +02:00
Andre Rummler b76d8ce8a1 Fix: remove PUGIXML files from compilation fileset. This is redundant using the target approach and leads sometimes to failures. 2026-09-21 13:29:40 +02:00
Laurent Trinques d7052e396b Merge pull request #591 from ispyisail/feature-dynamictext-drag-resize
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 2m32s
Add drag-to-resize for dynamic element text width (#577 phase 1)
2026-09-21 12:19:22 +02:00
Laurent Trinques e123c55754 Merge pull request #969 from ispyisail/feature/qet-mcp-server
Add misc/qet-mcp: a Model Context Protocol server over QET projects
2026-09-21 12:00:34 +02:00
Laurent Trinques 268aba60eb Merge pull request #970 from ispyisail/feature/scripting-draw-api
Scripting API: draw, cross-reference and query a project
2026-09-21 11:57:48 +02:00
Laurent Trinques 313f9533a8 Merge pull request #967 from Kellermorph/fix-conductor-style
fix: inherit conductor line style (pen style) when linking cross-references
2026-09-21 11:55:05 +02:00
Laurent Trinques 3d1cb671c1 Merge pull request #966 from Kellermorph/place-makro-fix
fix: correct macro placement position mismatch
2026-09-21 09:21:34 +02:00
Laurent Trinques c0fc093b4e Merge pull request #968 from Kellermorph/background-drawing-selection
Add diagram background color picker with adaptive border/titleblock
2026-09-21 09:20:31 +02:00
ispyisail 46c35d2297 Let a script query the project database
Every structural question this API could answer, it answered by walking
live objects. The project builds a SQLite database that already knows
most of them, and nothing outside the application could reach it.

  tables()      what is queryable, tables and views
  query(sql)    rows, one object per row
  queryError()  why the last one returned nothing

This is not a new door. QElectroTech already ships a "Requête SQL
personnalisée" box in the element-query dialog where a user types
arbitrary SQL, guarded by projectDataBase::isReadOnlySelect(); query()
goes through projectDataBase::newQuery(), which applies that same rule
and returns the same rejection message. A script gets what a user
already has, and neither can write: DELETE, UPDATE and a chained
"SELECT 1; DROP TABLE" are all refused before reaching SQLite.

An empty result and a failure are told apart. query() returns no rows
for both, so queryError() carries the reason -- a refusal, or SQLite's
own message for a bad column -- and is empty when the query simply
matched nothing. Conflating those is how a silent typo in a column name
becomes "there are no such elements".

No updateDB() before querying, and that is a measured decision rather
than an omission. A script that has just edited something is the
expected caller, so a stale cache was the obvious hazard; but
projectDataBase maintains itself incrementally through addElement(),
elementInfoChanged(), addConductor() and the rest, which the undo
commands behind every edit already call. Tested both ways on the cases
most likely to go stale -- an element added and labelled, a conductor
property changed -- each queried immediately afterwards through both the
table and the view. Identical counts with the rebuild and without it,
and updateDB() repopulates every table, so calling it per query would
have been real cost for no benefit. The comment says so, so it is not
added back on the assumption it must be needed.

The views are the surface to depend on: element_nomenclature_view,
project_summary_view and wiring_list_view exist to be queried. The
tables are how the cache is arranged today and a column may move --
which is why tables() lists both and the header says which is which.

Verified against examples/industrial.qet, the largest shipped project:
618 elements counted, the busiest wire numbers ranked (0VDC 93 times,
24V2 64), and duplicate element labels found by GROUP BY ... HAVING --
V6 seven times, V5 six -- which is a design-rule question no tool here
could previously ask. Qt 6.10.2, ctest matches master.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 19:14:53 +12:00
ispyisail 2adc58c1c0 Let a script add the text and shapes a folio carries
The drawing furniture beside the circuit: a free-standing note, a line,
a rectangle, an ellipse, a polygon.

  texts()  addText()  setTextContent()  setTextColor()
           setTextRotation()  deleteText()
  shapes() addShape()  deleteShape()

Added with the same AddGraphicsObjectCommand the corresponding GUI tools
use, and changed through the plainText/color/rotation properties those
items already publish, so a script's note undoes like a hand-placed one.

These are addressed by index into a listing sorted by position, reading
order, because they have no better identity: unlike an element they carry
no uuid, and unlike a conductor they have no terminal to be named by.
Position is what they have and it persists, so the ordering survives a
save and reload -- verified by listing before and after, including a
rotated text whose bounding box moves. It does not survive adding or
deleting one: indexes after that point shift the way a list's do, which
is why texts() and shapes() exist rather than a caller keeping a handle.

The sort is on sceneBoundingRect(), not pos(). A QetShapeItem keeps its
geometry in its line/rect/polygon and leaves pos() at the origin, so
sorting on pos() put three shapes drawn in three different places all at
(0, 0) and made every shape index refer to whichever the set yielded
first -- which is what the first version of this did, and the test that
caught it was asking for three shapes and getting index 0 three times.

Path is deliberately not offered: it is built by successive clicks and
has no two-point form to give here.

Verified headlessly: three texts added bottom-up and listed in reading
order, edited, recoloured, rotated, one deleted; three shapes added,
listed with their real geometry, the middle one deleted and the right one
gone; unknown shape name, invalid colour and out-of-range index all
decline with a reason. Saved, reloaded, both listings identical.

Qt 6.10.2, build clean, ctest matches master, qet-lint clean on the
generated project, qet-coherence-check clean on the example corpus.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 19:00:04 +12:00
ispyisail 82262c5980 Let a script number a conductor and link a cross-reference
Two gaps left over from the drawing verbs. A script could create a
conductor but not say what it was -- no number, colour, section or
formula -- and could not link a master to its slave, although
LinkElementCommand has been there all along and nothing bound it.

  conductors()            what is on this folio, and how to address it
  conductorProperty()
  setConductorProperty()  num, formula, function, bus, cable,
                          tension_protocol, conductor_color,
                          conductor_section, color, text_color
  elementLinkType()       simple / master / slave / next_report / ...
  linkedElements()
  linkElements()          two folio indices: a master and its slave are
                          normally on different folios
  unlinkElement()

The property names are the ones the .qet file uses for the same fields,
so what a script sets is what a reader of the file sees rather than a
third spelling invented here.

A property is applied to every conductor of the same electrical
potential, not to the one conductor named. That is the rule the
application already follows -- SearchAndReplaceWorker pushes one
QPropertyUndoCommand per conductor of relatedPotentialConductors()
inside a macro -- because a wire number describes a potential, not one
drawn segment; setting it on one and leaving the rest of the potential
disagreeing would produce a file no GUI action could have produced.

Linking asks LinkElementCommand::isLinkable() rather than re-deriving
its rules, so a script cannot make a link the GUI would refuse: master
to master, a PLC master to a non-PLC slave, a next-report to another
next-report, or anything to an already-taken target.

A conductor is addressed as "the conductor on terminal i of element U".
It has no identity of its own to use instead: conductors carry no
persisted uuid, and the terminal1/terminal2 ids in the file are
folio-scoped integers QElectroTech renumbers on every save. Since the
change is potential-wide, any terminal of the potential names it equally
well, so in practice a potential is addressed from one of its leaves; a
terminal carrying several conductors names none of them and is refused
rather than guessed at.

Verified headlessly. Conductor: num, section and colour set from one end
of a potential and read back from the other, saved and reloaded, present
in the XML. Propagation shown to discriminate, which took two tries --
the first attempt wired A.0-B.0 and B.1-C.0 and saw no propagation,
correctly, because a coil's two terminals are opposite ends of the coil
and not one potential. Wiring a real hub at A.0 instead, a number set
via the B leaf appears on the C conductor too, in memory and in the
saved file. Cross-reference: a master on one folio linked to a slave on
another, linkedElements() agreeing from both ends, surviving save and
reload with link_uuid written on both folios; master-to-master,
self-link, unlink and relink all behave. Unknown property, invalid
colour, bare terminal and ambiguous terminal all decline with a reason.

Qt 6.10.2, build clean, ctest matches master, qet-coherence-check clean
on the example corpus, qet-lint clean on the generated projects.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 18:48:40 +12:00
ispyisail 6dcb6a2a8f Key a conductor by something that survives a save
qet_diff keyed each conductor on its raw terminal1/terminal2 pair, with
a comment claiming that pair was "stable within a folio". It is stable
within a folio; it is not stable across a save. QElectroTech reassigns
those folio-scoped integer ids on every write, in whatever order it
serialises the elements, so one untouched conductor of ArduinoLCD.qet
goes from terminal1="1" terminal2="16" to terminal1="34" terminal2="15".

Diffing a project against a re-saved copy of itself therefore reported
29 of its 47 conductors as removed and 29 as added, with nothing
changed. That is the main thing this tool is for, so the conductor half
of the answer was noise in exactly the case it was wanted.

The format has two addressing schemes and a file can hold both at once.
Older conductors use the integer ids with no element1/element2; current
ones use terminal uuids from the .elmt definition plus element1/element2
naming the placed instances. A terminal uuid alone is not an identity --
it belongs to the definition, so two coils of one type share it and a
conductor between them keys as a self-loop -- so an end is identified by
the (instance, terminal) pair, taken from the conductor where it carries
one and resolved through the folio's elements where it does not.

Where an element predates persisted uuids there is nothing stable to key
on. Keying those on terminal geometry alone collapsed nine distinct
conductors of schema_indus.qet onto a single key, which is worse than
the instability it was meant to fix, so such ends stay unresolved, keep
a "#"-marked key, and the diff reports unstable_keys and says in words
that added/removed may not mean what they look like.

Measured over the 24 shipped example projects, 3190 conductors: 0
colliding keys, against 8 for the geometry-only key. On a re-saved but
otherwise untouched project: 0 added, 0 removed, against 29 and 29
before this change. A project with two conductors genuinely added still
reports exactly two added and none removed, so the check still
discriminates.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 18:38:46 +12:00
ispyisail c740cdf1ac Let a script wire, label and rotate, not only place
The scripting API (bugtracker #162) could place an element and move it,
and could count conductors but not make one. So a script could put a
coil and a motor on a folio and had no way to connect them, which is
most of what drawing is. This adds the missing verbs:

  addConductor()      wire terminal i of one element to terminal j of another
  rotateElement()
  setElementInfo()    any information key
  setElementLabel()   the label key, by name, since it is the one people want
  addFolio()
  setFolioTitle()
  elementUuids()      what is on this folio
  elementName()
  elementTerminals()  which terminal index is which, before wiring it

Each goes through the command the GUI already uses, so a script's edits
undo like manual ones and reach the project database the same way:
ConductorCreator (the drag-a-rectangle-over-terminals path, which is
what makes a new conductor inherit an existing potential's properties
and join auto-numbering), ChangeElementInformationCommand,
QETProject::addNewDiagram(), ChangeTitleBlockCommand. rotateElement()
pushes the same QPropertyUndoCommand on "rotation" that
RotateSelectionCommand pushes for an Element, rather than
RotateSelectionCommand itself, which works on the diagram's selection
and would mean rewriting the user's selection to rotate one element.

Terminals are addressed by index, not uuid. Terminal::uuid() is a
property of the catalog .elmt definition: empty for most of the
installed base, and where present, identical across every instance of
that element -- two coils of the same type placed side by side have
byte-identical terminal uuids, so a uuid cannot say which coil's A1 is
meant. elementTerminals() exists so a script can see the indexing
instead of guessing it.

The one real hazard is that ConductorCreator asks the user which
potential to inherit from when the two terminals sit on two different
existing ones, and it asks with a plain modal QDialog that
QET::QetMessageBox's non-interactive mode does not cover -- so under
headless --run there is nobody to answer and the call never returns.
Measured: with the check removed, that one call hangs until killed;
with it, it declines in 0.4 s. addConductor() therefore refuses that
case, the same way and for the same reason addElement() already refuses
the import-conflict dialog.

To make that check without duplicating the condition, existingPotential()
becomes static over an explicit terminal list and ConductorCreator gains
a public needsPotentialChoice() predicate. Behaviour of the GUI path is
unchanged; setUpPropertieToUse() passes m_terminals_list to the same code
it called before.

Verified headlessly against a copy of examples/ArduinoLCD.qet: new folio
titled, two coils placed, wired, labelled, an info key set and the
element rotated; saved, reloaded, and the conductor, label, title and
rotation (persisted as orientation="1") all read back. Re-saving the
result is byte-identical. qet-lint clean on the generated project;
qet-coherence-check clean on it and on the 24-project example corpus,
and shown to report 9 findings on a deliberately broken copy of the same
file, so the clean result discriminates. Qt 6.10.2, ctest identical to
master (the 61 failures are the vendored KDE ECM suite, present on both).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 17:57:29 +12:00
elevatormind 78caeaec48 Merge branch 'qelectrotech:master' into no-sqlite 2026-09-21 07:34:32 +02:00
ispyisail aab0a18506 Add misc/qet-mcp: a Model Context Protocol server over QET projects
A small stdio MCP server that lets an assistant read a project, ask what
an edit actually changed, and sweep a corpus. Standard library only --
Python 3.9+, no third-party dependencies, and the MCP SDK is not
required. Nothing in the build or the application refers to it; it sits
in misc/ beside make_icon_themes.py and is inert unless run.

It exists because verifying a change by screenshot is unreliable, and
that unreliability produced two wrong conclusions in a single review
session. A drag of a multi-element selection looked like it had left the
symbols behind and detached their labels; diffing the saved file showed
all four elements had moved by an identical (0,-80) and no label had
moved at all. An Apply button looked like it did nothing; it was
disabled because a required field was empty. Both times the pixels
misled and the file told the truth, so these tools read the file.

Seven tools: qet_project_info, qet_elements, qet_conductors, qet_diff,
qet_scan, qet_element_info and qet_export. Only qet_export launches
QElectroTech; everything else parses the .qet or .elmt directly, which
needs no display and cannot be confused by a dialog.

Two behaviours of QElectroTech are carried inside the tool rather than
left for the caller to rediscover. SingleApplication keys its socket on
applicationFilePath(), so a second launch of the same path forwards its
request to a running instance and returns that process's answer with no
error; qet_export therefore copies the binary to a unique temporary
path, gives it a private HOME and runs it offscreen. A symlink would not
do, because applicationFilePath() resolves it back. And the CLI matches
its export flags by exact string (cli_export.cpp:828) with the project
and output as positional arguments (:862, :882), so --export-bom=out.csv
is not recognised as an export at all and the run starts the interface
and hangs headless; the tool uses the positional form.

Worth recording for anyone extending this: the project database would be
a better query surface than the XML, but it is not reachable from
outside the application. projectDataBase::newQuery() and
isReadOnlySelect() are C++-internal and the JavaScript scripting API
exposes no SQL binding. A --query CLI verb, or a scripting binding,
would let this expose the guarded read-only SELECT surface instead.

Verified against the shipped examples: qet_scan reports 3190 conductors
across the 24 example projects with no cable value, and qet_diff
reproduces the four-element move above from the two saved files.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 17:33:17 +12:00
Kellermorph ebab58e4b3 Add diagram background color picker with adaptive border/titleblock
Replace the white/grey toggle (m_grey_background) with a full color
picker widget (DiagramBgColorToolButton) in the Affichage toolbar,
matching the existing ConductorColorToolButton UX:

- Preset colors: White, Off-white, Light grey, Grey, Dark grey, Black
- Recently used colors section
- "Autre couleur..." opens QColorDialog for any custom color
- "Couleur système" restores the default dark-mode inverted background

New features:
- Diagram::m_custom_background_color flag: when the user picks a
  custom color, PaletteGraphicsView skips lightness inversion so the
  chosen color is displayed as-is
- Border and titleblock text/lines automatically switch between black
  and white based on Diagram::background_color.lightness(), so a dark
  background always shows a visible light border and titleblock content
- "Couleur système" restores Qt::white + re-enables inversion

Files changed:
- New: sources/ui/diagrambgcolorbutton.h/.cpp
- sources/diagram.h/.cpp: added static m_custom_background_color flag
- sources/palettegraphicsview.cpp: skip inversion when custom bg active
- sources/bordertitleblock.cpp: adaptive border pen color
- sources/titleblocktemplate.cpp: adaptive ink color for cell borders/text
- sources/qetdiagrameditor.h/.cpp: replace toggle with new widget
- cmake/qet_compilation_vars.cmake: register new source files
2026-09-20 22:58:08 +02:00
Kellermorph 45ca53c7a8 fix: inherit conductor line style (pen style) when linking cross-references
ApplyForEqualAttributes() was missing the 'style' attribute, causing
dashed/dash-dotted line styles to be lost when potentials are merged
via folio reports. Only color and other properties were copied.

Add style copy in single-element case and equality check in
multi-element case, matching the existing pattern for other attributes.
2026-09-20 21:56:43 +02:00
Kellermorph 2efce1752d fix: correct macro placement position mismatch
Fix macro elements jumping to upper-left corner instead of being placed
at the correct drop position.

Root cause: The preview offset used itemsBoundingRect() (all items
including children), while Diagram::fromXml() computed its translation
offset from top-level items only. This mismatch caused fromXml to
translate elements to the wrong position.

Changes:
- Compute top-level-only bounding rect in dummy diagram constructor
  to get the correct m_items_top_left reference point
- Pass final_pos + m_items_top_left to fromXml() so the internal
  translation yields the intended final position
- Add braces around single-statement for-loop in fromXml
- Remove empty else block leftovers from debug cleanup
2026-09-20 21:24:38 +02:00
Magnus Hellströmer 27dea3ffab refactor: use VACUUM INTO for database export
Remove the native SQLite backup API and direct SQLite library
dependency.
2026-09-20 20:49:02 +02:00
Laurent Trinques c256e2dd1a Merge pull request #958 from bhangart/fix/pin-fetchcontent-dependencies
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m37s
Fix/pin fetchcontent dependencies
2026-09-20 20:13:37 +02:00
Laurent Trinques 8e3a7a6ab6 Merge pull request #927 from ispyisail/fix/923-snap-element-text
Snap a device's text to the grid when it is dragged (#923)
2026-09-20 20:10:13 +02:00
Laurent Trinques 740271c993 Merge pull request #938 from arummler/fix-translation-syntax
Fix various singular/plural cosntructions
2026-09-20 20:08:53 +02:00
Laurent Trinques 1bec2700bd Merge pull request #924 from Kellermorph/auto-numbering-new-project
Add global auto-numbering rules to QElectroTech settings
2026-09-20 20:07:16 +02:00
Laurent Trinques 268e9c7bd9 Merge pull request #959 from jp2images/fix-dark-canvas-item-updates
Keep the dark canvas on QGraphicsView's own update path
2026-09-20 20:02:50 +02:00
Laurent Trinques 264a0f677f Merge pull request #964 from jp2images/remove-stray-sbom-files
Remove two files that slipped into #944
2026-09-20 20:02:27 +02:00
Laurent Trinques 9ccfb5e116 Merge pull request #963 from jp2images/fix-hover-tint-light-face
Darken the hover ink on a light button face
2026-09-20 19:45:28 +02:00
Jeff Patterson 04463f0954 Darken the hover ink on a light button face
QETStyle::hoverColor() lightened the highlight color until it read at
3.5:1 against the Light role. On a dark face that is the way to go; on a
light face lightening only fades the ink, so with a pale platform accent
that QET keeps (macOS's green selection color, black selection text) the
loop ran to white and every hovered line-art icon vanished. The ink now
moves away from the face, darker on a light face, lighter on a dark one,
and falls back to the button text color if twenty steps are not enough.

The hover test gets a row with that accent on each palette, and a new
test sweeps accents across hues and lightness on both palettes and
requires the hover ink to read at 3:1 on the face.

Fixes #962
2026-09-20 12:45:07 -05:00
Laurent Trinques 3245919c19 Merge pull request #961 from jp2images/fix-small-page-icons
Give every configuration page an icon at page size
2026-09-20 19:44:00 +02:00
Jeff Patterson 55ad2eccbf Remove two files that slipped into #944
sources/qetsbom.cpp and sources/qetsbom.h were untracked local files
that a directory-wide add swept into the rebuilt #944 commit. Nothing
references them; the build does not compile them.
2026-09-20 12:43:57 -05:00
Jeff Patterson 8b2548d601 Keep the dark canvas on QGraphicsView's own update path
Laurent found that moving an element on a #954 build left its terminals'
help lines behind at every step, on both palettes. The view listened to
QGraphicsScene::changed() so that render() would keep the scene's updates
flowing, and any receiver on that signal puts the scene on its Qt 4.4
compatibility path, which erases a moved item's own old rect only:
children bigger than their parent stay on screen. Master hides that with
FullViewportUpdate, which repaints the whole viewport on every change.

Paint the inverted folio through QGraphicsView::paintEvent() instead, with
IndirectPainting set for that call and the draw hooks painting into a
viewport-sized image, and hand the scene the viewport when the items are
drawn so it records where each item was painted, including a child whose
geometry is set while its parent paints. The listener and the
full-viewport update go. Two tests move a parent with a sheet-wide child,
read the backing store, and require the repaint to be a partial one.
2026-09-20 12:43:50 -05:00
Laurent Trinques c3aeb0bf83 Merge pull request #944 from jp2images/fix-stylesheet-palette-switch
Refresh style-sheet widgets after a live palette switch
2026-09-20 19:36:26 +02:00
Jeff Patterson 16d89f64fd Refresh style-sheet widgets after a live palette switch
Switching the system between light and dark while QET runs changed
the palette of every plain widget but left widgets that carry a style
sheet in the colors they were created with: the folio tab bar stayed
light in dark mode, and after a dark-to-light switch its Add folio and
chevron buttons hovered as a near-black box with the icon lost inside
it. QApplication::setPalette() does not reach a widget with a style
sheet; QStyleSheetStyle resolved its palette once, when the sheet was
applied, and keeps it. Seventeen call sites set a sheet on a widget and
five .ui files carry one, so any of them could show the stale palette.

QET::Palette::refreshStyleSheets() re-applies each such widget's own
sheet, which makes QStyleSheetStyle resolve it against the palette now
in force. QETApp::useSystemPalette() calls it after installing the
palette, so both the OS color scheme change and the "use system
colors" setting are covered.

tests/qttest/tst_qetpalette: a tab widget with the folio tab bar's
sheet is still drawn in the old colors after setPalette(), which is the
defect, and follows the palette after refreshStyleSheets(), in both
directions.

Fixes #943.
2026-09-20 12:20:01 -05:00
Jeff Patterson ac78c51b70 Give every configuration page an icon at page size
The settings and project dialogs list their pages with 64 or 128 pixel
icons, and two pages had theirs at 22 pixels only: the terminal-strip
page and the shortcuts page, which borrowed configure-toolbars. Both get
a 128 pixel icon drawn in the style of the other page icons, the
shortcuts page under its own name, configure-shortcuts. The SVG sources
sit beside the PNGs.

On a dark palette the Printing and Export pages were small too: their
128 pixel icons exist in the light theme only, and Qt inherits by name,
not by size, so the dark theme's small copies were scaled up instead.
make_icon_themes.py now aliases the light files of the sizes a dark name
lacks, when they read on the dark window at 3:1.

A test asks the theme for every page icon at 128 pixels, on both
palettes.

Fixes #960
2026-09-20 10:44:09 -05:00
Beat Hangartner 2e27f77b28 Added more verbose description of the difference between lightweight and annotated tags as comment. 2026-09-20 14:21:36 +02:00
Laurent Trinques 83fb525e27 Merge pull request #939 from elevatormind/backtrace-windows-disable
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m39s
Fix issue #937
2026-09-20 14:03:43 +02:00
Laurent Trinques d1808c7a89 Fix Draw the folio with inverted lightness on a dark palette- #954 2026-09-20 13:07:57 +02:00
Laurent Trinques 4e4f029d2d Merge pull request #957 from qelectrotech/revert-955-revert-954-feature-dark-canvas
Revert "Revert "Draw the folio with inverted lightness on a dark palette""
2026-09-20 13:05:38 +02:00
Laurent Trinques 242f134e0f Revert "Revert "Draw the folio with inverted lightness on a dark palette"" 2026-09-20 13:05:13 +02:00
Magnus Hellströmer 2dc88df29c feat(build): Enable backtrace detection on Windows 2026-09-20 12:48:10 +02:00
Magnus Hellströmer fd8135264f fix(build): Remove stale Windows backtrace comments 2026-09-20 12:48:10 +02:00
Magnus Hellströmer 827cd2a91e fix(build): support backtrace in MSYS2 2026-09-20 12:48:10 +02:00
Magnus Hellströmer cdd25189b5 fix(build): guard backtrace detection on Windows 2026-09-20 12:48:04 +02:00
Laurent Trinques f1313f5895 Merge pull request #955 from qelectrotech/revert-954-feature-dark-canvas
Revert "Draw the folio with inverted lightness on a dark palette"
2026-09-20 07:20:03 +02:00
Laurent Trinques 75fafd5acc Revert "Draw the folio with inverted lightness on a dark palette" 2026-09-20 06:57:56 +02:00
Laurent Trinques 3394c1246c Merge pull request #954 from jp2images/feature-dark-canvas
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 2m12s
Draw the folio with inverted lightness on a dark palette
2026-09-20 06:44:09 +02:00
Jeff Patterson 3e34a6d55f Fill the dark canvas buffer and keep one scene connection
QGraphicsView::render() paints only what the scene draws, so a scene
without a background brush left the off-screen buffer uninitialized
and the inversion turned that memory into noise. The buffer is now
filled white first, which the inversion turns into the Base color.

listenToScene() connected a new receiver on every setScene() call and
never dropped the previous scene's. It now keeps a single connection
and replaces it.

Test in tst_qetpalette: paletteViewFillsWhatTheSceneLeavesBlank.
2026-09-19 18:27:00 -05:00
Jeff Patterson 50792ba1ad Repaint the whole dark canvas when the application palette changes
After a live light/dark switch only the sheet changed colors; the
viewport around it kept the previous palette. Qt repaints a widget on
an application palette change only when the widget's own palette
changed with it, and under the folio tab widget's style sheet it does
not, so the only repaints came from the scene and covered the scene
rectangle alone. PaletteGraphicsView now watches the application
object for ApplicationPaletteChange, the one receiver Qt always
notifies, and repaints its whole viewport.

The test paletteViewFollowsTheApplicationUnderAStyleSheet now also
requires a full-viewport repaint after each switch, before anything
asks the view for a rendering.
2026-09-19 18:27:00 -05:00
Jeff Patterson 6404612014 Follow the application palette, not the view's, on the dark canvas
The folio tab widget carries a style sheet, and QStyleSheetStyle pins
the palette of every widget under it to the application palette in
force when the sheet was applied. After a live light/dark switch the
view's own palette() is therefore stale: the folio kept its dark sheet
after a switch to light, and kept its white sheet after a switch to
dark. PaletteGraphicsView now reads the application palette both for
the decision to invert and for the sheet and ink colors.

Test in tst_qetpalette: paletteViewFollowsTheApplicationUnderAStyleSheet
puts the view in a tab widget with a style sheet and switches the
application palette to dark and back.
2026-09-19 18:27:00 -05:00
Jeff Patterson eaf15faaa3 Move the dark canvas into PaletteGraphicsView and test it directly
The inverted painting, the rubber band replay and the changed()
receiver lived in DiagramView, which the unit tests cannot link, so the
update-flag regression was only covered through a stand-in view. They
now live in PaletteGraphicsView, a QGraphicsView subclass with no
other dependency, and DiagramView derives from it. The view tells a
subclass through paintingInverted(bool) when it renders for an
inverted display; DiagramView forwards that to the diagram. The grid
dot rule moves out of Diagram::drawBackground into
QET::Palette::gridDotColor().

tst_qetpalette now links the real class: gridDotColorSoftensInvertedDots,
paletteViewFollowsThePalette (light sheet, dark sheet at text contrast
with a red box still red and the paintingInverted calls in order, back
to light), paletteViewKeepsSceneUpdatesFlowing (three whole-scene
updates and a selection each repaint, scene set after construction),
paletteViewDrawsTheRubberBand.
2026-09-19 18:27:00 -05:00
Jeff Patterson b8c9e670c4 Keep scene updates flowing on the dark canvas and soften its grid
On a dark palette the folio view paints through QGraphicsView::render()
instead of onto its viewport. In that case QGraphicsView never clears
the scene's "update everything" flag, and while the flag is set every
further QGraphicsScene::update() and item update is dropped: from the
second Diagram::update() on, the grid toggle, the white/gray toggle and
even a selection waited for an unrelated repaint. With a receiver on
QGraphicsScene::changed() the scene clears the flag before it emits, so
DiagramView now connects an empty receiver in its constructor.

While the view paints for inversion, Diagram draws the grid dots a
third of the way from the sheet color to black, so they come out as a
soft gray on the dark sheet instead of as bright as the ink. Printing
and export never take that path.

Test in tst_qetpalette: sceneUpdatesReachARenderedView.
2026-09-19 18:26:45 -05:00
Jeff Patterson 85dc638a42 Draw the folio with inverted lightness on a dark palette
On a dark palette the folio stayed a white sheet with black ink, and
the white/gray toggle only darkened the sheet while the ink stayed
black. DiagramView now renders each repaint into an image and inverts
its lightness before blitting it: white becomes the palette's Base,
black becomes its Text, and colored conductors and elements keep their
hue. The document, printing and export are untouched; only the screen
rendering changes, and only while the palette is dark.

QET::Palette::invertLightness does the inversion in one integer pass
(adding 255 - max - min to the three channels inverts the HSL lightness
and keeps hue and saturation), then stretches the result between the
sheet and ink colors through three lookup tables. A 4K viewport costs
about 9 ms in a release build. QGraphicsView::render() skips the
selection rubber band, so the view draws it again after the inversion.

Tests in tst_qetpalette: invertLightnessMapsSheetAndInk,
invertedViewReadsOnDarkSheet, invertLightnessSpeed.
2026-09-19 18:26:45 -05:00
Laurent Trinques dfe56cddbd Merge pull request #928 from ispyisail/fix/903-escape-cancels-text-tool
Let Escape cancel the text tool, like every other placement (#903)
2026-09-19 23:43:31 +02:00
Beat Hangartner 3f397f5f78 Explain why fetching by git tag is a supply chain risk
The pinning comment stated that a tag is mutable but not what an attacker
does with that, so the trade-off was hard to judge for anyone reviewing or
later undoing the pins. Spell out the mechanism: a tag is a name pointing
at a commit, anyone with push access upstream can force-push it elsewhere,
and FetchContent resolves it at build time, so a stolen maintainer account
or CI token makes every fresh build compile the attacker's code while
nothing changes here and the tag name still reads correctly. A commit hash
is derived from the content and cannot be moved that way.

Name the two cases where this was actually exploited: tj-actions/changed-
files in March 2025 (CVE-2025-30066), where tags v1 through v45.0.7 were
retargeted to a commit leaking CI secrets into build logs across more than
23,000 repositories, and aquasecurity/trivy-action in March 2026
(CVE-2026-33634), where 76 of 77 version tags were force-pushed to a
credential stealer for about twelve hours. Both were GitHub Actions rather
than CMake dependencies, which the comment says, because the point is the
shared mechanism of resolving a tag at build time.

Also document how to upgrade a pin, including that git ls-remote reports
the tag object for an annotated tag and the commit on the "^{}" line.

The note lives in fetch_pugixml.cmake, which fetch_kdeaddons.cmake and
fetch_singleapplication.cmake already refer to. Comments only; no build
behaviour changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 23:36:20 +02:00
Beat Hangartner 7ec13cbc1a Pin fetched dependencies to commit hashes instead of git tags
CMake fetches pugixml, SingleApplication and the three KDE Frameworks
modules by git tag. A tag is a mutable pointer that its owner can move,
so two builds of the same QElectroTech commit can silently get different
third-party sources, and a compromised upstream account can change what
every builder downloads without anything changing in this repository.
Pinning each dependency to the commit its tag currently points at closes
that, while keeping the tag name in a trailing comment so the intended
version stays readable.

No versions change. Every pinned commit is the one its tag resolves to,
checked with git ls-remote and confirmed by fetching each one and
verifying that git describe reports exactly the tag. The three KDE
modules live in separate repositories and therefore need separate
commits, so the single KF_GIT_TAG variable becomes three per-module
variables; passing -DKF_GIT_TAG=<ref> still selects one ref for all
three, unpinned, exactly as before, and KF_GIT_TAG stays defined so the
build summary in define_definitions.cmake is unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 23:05:39 +02:00
Kellermorph 7fa1ff35b8 Add global auto-numbering rules to QElectroTech settings
Add a 'Numérotation auto' tab to the global settings page (Settings >
Nouveau projet) where users can define default auto-numbering rules
for Conducteurs, Eléments, and Folios. These rules are automatically
transferred to every new project created.

Changes:
- Add NumerotationContext::saveToSettings()/loadFromSettings() static
  helpers for persisting named numerotation contexts via QSettings
- Add 'Numérotation auto' tab to NewDiagramPage with three sub-tabs
  using SelectAutonumW widgets (same UI as project properties)
- Add save/remove/persist slots for conductor, element, and folio
  contexts with immediate QSettings persistence on every change
- NewDiagramPage::applyConf() saves autonum settings when editing
  global defaults (no project)
- QETProject constructor loads global autonum settings from QSettings
  for new empty projects
2026-09-19 13:47:28 +02:00
Andre Rummler 7e3420b1a5 Avoid constructing sentences. 2026-09-19 10:39:54 +02:00
Andre Rummler 183035d5ac Replace enumerator list. 2026-09-19 09:15:28 +02:00
Andre Rummler eb4109bb11 Replace manual enumerator sentence with qt trasnlator automatism. 2026-09-19 09:08:25 +02:00
Andre Rummler 717bf57677 Improve plural marking from previous commit. 2026-09-19 09:08:00 +02:00
Andre Rummler 861e5de25e Use qt own enumeration translation function. Fix plural forms. 2026-09-19 08:31:34 +02:00
ispyisail bf7bff595e Merge branch 'master' into revive/591-dynamic-text-drag-resize
Bringing the drag-to-resize work up to date with current master (662
commits) before asking for review again. Both files auto-merged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CaKympWT3owLotCpEN2CFj
2026-09-19 11:30:31 +12:00
ispyisail 3c1fb2fe72 Let Escape cancel the text tool, like every other placement (#903)
Issue #903 reported that Escape stopped cancelling an in-progress
placement. PR #899 fixed that by letting Escape through to the active
tool whenever Diagram::eventInterfaceIsRunning(), and 863ac5f0a tightened
it to isRunning() so a second Escape cannot retrigger an abort already in
flight. That covers seven of the eight tools. It cannot cover the eighth.

eventInterfaceIsRunning() is m_event_interface && isRunning(), and
isRunning() returns m_running. DiagramEventAddText is the only class
under sources/diagramevent/ that never sets m_running, so the guard reads
false for the whole time the tool is armed and DiagramView::keyPressEvent
keeps swallowing Escape for its own selection/focus handling.

It is also the only one of the eight with no RightButton branch --
right-clicking the folio with the text tool armed opens the folio context
menu. So this tool currently has no way to cancel at all: the only way
out is to pick a different tool, and any stray click drops a text field
the user did not want.

The tool is armed from the moment it is attached, so m_running is set in
the constructor and cleared where the text is placed, before finish().

Measured on a virtual display against a fixture holding one free text
field, counting diagram-level text fields in the saved project:

  arm the text tool, click            2 fields   places, as it should
  arm it, press Escape, then click    2 fields   before  -- not cancelled
                                      1 field    after   -- cancelled

The same run on master's rectangle tool cancels correctly, which is what
made the text tool look fixed when it was not.

ctest 12/12, Qt 6.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 08:32:58 +12:00
ispyisail 95d0e523fe Snap a device text to the grid when it is dragged (#923)
Dragging an element's text -- its label, article number, any of its
information fields -- moved it in free one-unit steps while everything
else in the editor snapped to the grid. Reported by pki791 in #923 for
labels moved with Shift.

QET moves a text with the mouse along five paths. Four snap and let Ctrl
place freely:

  DiagramTextItem::mouseMoveEvent        an independent text
  ElementTextItemGroup::mouseMoveEvent   a group of element texts
  ElementTextsMover::continueMovement    every OTHER selected element text
  QetGraphicsItem::setPos                elements, images, shapes

DynamicElementTextItem::mouseMoveEvent, the text actually under the
cursor, ended "setPos(new_pos)" with no grid and no modifier check. It is
otherwise the same function as the group's, which is why this reads as an
omission rather than a decision: the line this adds is that function's,
character for character.

The inconsistency was visible in one gesture. With two element texts
selected and one of them dragged, ElementTextsMover skips the driver item
and snaps the rest, so the text under the cursor was the only one on the
folio that did not land on the grid.

Verified on a virtual display (Xvfb + openbox) against a two-lamp fixture,
grid 10, reading the saved positions rather than the screen:

  Shift+drag the label      before (32.95, -11.55) -> (7.95, 23.45) off-grid
                            after                  -> (10, 20)      on-grid
  the co-selected label     (10, -10) -> (50, 20) on-grid, before and after
  Shift to grab, then Ctrl  -> (7.95, 23.45) off-grid, free placement kept

The last line matters: moving an element text needs Shift at press, and
the modifier is read at move time, so Ctrl still places freely -- press
with Shift, hold Ctrl to drag. Holding both from the press is a different
gesture, reserved by DiagramView::isCtrlShifting() for the view's mode
switch, and does not move the text at all. Nothing that was possible
before is lost.

Worth knowing when reviewing: 470 of the 492 element texts in the 24
example projects (95.5 %) sit off the grid today, because element
definitions place their default text at fractional offsets. The first
drag of almost any existing label will pull it onto the grid, by at most
half a grid step.

ctest 12/12, Qt 6.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 08:06:45 +12:00
Andre Rummler 2ec413a578 Adding generated headers to gitignore. 2026-08-09 23:13:09 +02:00
Andre Rummler 61ce75e380 First draft of elements renumber function. 2026-08-09 23:13:09 +02:00
ispyisail 83b9f32bd0 Add device-button-to-action bindings, for any 3D mouse backend
Discussion #599's own scope explicitly deferred this ("Related, not
proposed here... a natural follow-up once basic pan/zoom motion works").
Basic pan/zoom now works (previous commits on this branch), so this adds
it -- generically, for whichever SpaceMouseBackend is in use, not tied to
libspnav specifically, matching the seam the previous commit built.

## Reuses ShortcutManager instead of inventing a second action registry

ShortcutManager is already an app-wide registry of every named, rebindable
action -- undo, redo, rotate selection, cut/copy/paste, autonum configure,
and dozens more -- each carried by a live QAction or QAbstractButton. A
device button binding to one of *those* ids, rather than to a bespoke
QET-3D-mouse-only action list, means the discussion's own examples
(rotate/mirror/undo) are available for free, and any action added to the
app in the future is automatically bindable too.

Added ShortcutManager::trigger(id): find the first still-alive target for
an id and call QAction::trigger() or QAbstractButton::click(), whichever
it is. Deliberately not disambiguated by which window is currently active,
unlike SpaceMouseListener's own pan/zoom dispatch -- a target's owning
top-level window isn't reliably discoverable from a bare QAction. Correct
in the overwhelming common case of one open editor window; documented in
the header as a known simplification, not silently assumed correct.

## The binding itself: SpaceMouseButtonMap

A thin QSettings-backed button-number -> action-id map, unbound by default
for every button on every device -- nothing happens on any button press
until the user opens Configuration > Souris 3D and binds something,
matching this whole feature's "silent until asked for" default.

## Backend side: SpaceMouseBackend::buttonPressed(int)

Added to the platform interface alongside the existing motion() signal.
SpnavBackend now handles SPNAV_EVENT_BUTTON (previously explicitly
ignored) and emits on press only -- release is not reported, since nothing
downstream has a use for it. A future non-spnav backend implements the
same signal and gets button support for free through
SpaceMouseListener::applyButton(), without that logic being duplicated or
re-verified per backend -- the same reasoning the previous commit's seam
was built around.

## Configuration UI: SpaceMouseConfigPage

Modelled directly on the existing ShortcutsConfigPage -- same QTableWidget
shape, same "persist on applyConf(), not live" contract -- one row per
binding: button number (spin box, unbounded, since button count and
numbering genuinely vary from 2 to 30+ across real devices and this could
not be checked against hardware) and action (combo box populated from
ShortcutManager::instance().allShortcuts(), the exact same live registry
the Shortcuts page itself lists). Only added to the Configuration dialog
when QET_SPACEMOUSE_SUPPORT is compiled in.

## Verified, including the one thing that doesn't need hardware to prove

Rebuilt from scratch both ways: option off adds zero new object code
(confirmed via a forced rebuild of the one unconditionally-changed file,
shortcutmanager.cpp, which alone picked up new warning-free code); option
on compiles all four new/changed files warning-free and links clean.

The backend's button *detection* (SPNAV_EVENT_BUTTON -> buttonPressed
signal) still cannot be verified without a real device or daemon -- same
limitation as the motion path from the previous commits, stated plainly
rather than glossed over.

What *is* fully verified, because none of it needs hardware:
 - SpaceMouseButtonMap: unbound by default, set/read-back, clearing via an
   empty id, enumeration -- all confirmed via a standalone harness linked
   against the real compiled objects.
 - ShortcutManager::trigger(): registered a real QAction, confirmed
   trigger() fires it exactly once and returns true; confirmed it returns
   false (not a crash) for an unknown id.
 - SpnavBackend: constructs safely with no daemon present (isAvailable()
   false, as it must be), and both its motion and buttonPressed signals
   are correctly wired per Qt's own metaobject data (QSignalSpy).
 - The configuration page end-to-end, via a real Xvfb session: opened
   Configuration > Souris 3D, confirmed the action combo box lists the
   live, real ShortcutManager registry (undo, rotate, cut/copy/paste,
   dozens more -- not a mock), added rows, edited the button number,
   removed rows, selected "Éditeur de schémas — Pivoter" (Rotate -- the
   discussion's own example) for button 3, clicked OK, and confirmed via
   the actual settings file that it persisted exactly as
   "buttons\3=diagrameditor.rotate_selection". Reopened the dialog and
   confirmed it read back correctly. This is a full, real round trip
   through the UI, not a claim.
2026-08-02 22:11:30 +12:00
ispyisail e35cab33f0 Extract a SpaceMouseBackend seam ahead of a future Windows/macOS backend
The user asked for phase 2 (Windows/macOS via 3Dconnexion's proprietary
3DxWare SDK) on top of #635. This sandbox has no 3DxWare SDK, no Windows
toolchain, and no macOS toolchain -- nothing to compile, link, or run a
single line of platform code against, unlike the Linux/libspnav path,
which was built and actually tested here for real. Writing 3DxWare
integration code that has never even built would be a materially weaker,
unverifiable thing sitting in this PR, so it is not in this commit.

What is: the structural seam that makes adding it later a contained,
reviewable change instead of a rewrite of code that already works.

## Before

SpaceMouseListener did three unrelated things in one class: own the
libspnav connection, read spnav events, and apply motion to the active
DiagramView. A Windows/macOS backend would have had to either duplicate
all of the DiagramView-facing logic (the pan/zoom calls, the Z-to-zoom-
factor mapping, the "which view is active" lookup -- all already verified)
or bolt onto the same class with a maze of #ifdefs. Either way, touching
that file again would put the already-tested Linux path back in scope for
review.

## After

- SpaceMouseBackend: a tiny interface (isAvailable(), a motion(dx,dy,dz)
  signal). A backend's only job is owning one platform's connection to the
  driver/daemon and translating its native event into this one signal.
- SpnavBackend: the libspnav code from the previous commit, moved behind
  that interface with no behaviour change -- still spnav_open() in the
  constructor, still a QSocketNotifier on spnav_fd(), still silent when no
  daemon/device is present.
- SpaceMouseListener: now backend-agnostic. Owns whichever backend the
  platform provides, applies its motion to the active DiagramView exactly
  as before. The DiagramView-facing code (pan/zoom calls,
  zoomFactorForZAxis) did not need to change at all -- only its input
  changed from a spnav_event_motion struct to three plain ints.

A future 3DxWare backend implements SpaceMouseBackend, is selected in
SpaceMouseListener's constructor behind its own
QET_SPACEMOUSE_BACKEND_3DXWARE guard (see the comment marking exactly
where), and never has to touch SpnavBackend or SpaceMouseListener's
DiagramView-facing half.

## CMake: one user option, one define per backend

QET_ENABLE_SPACEMOUSE is unchanged as the single option a user sets.
Internally, find_spacemouse.cmake now decides *which* backend (if any)
that resolves to: on Linux with libspnav found, QET_SPACEMOUSE_BACKEND_SPNAV
plus the umbrella QET_SPACEMOUSE_SUPPORT. Turning the option on anywhere
else today downgrades cleanly with a warning naming discussion #599,
instead of trying (and failing) to find libspnav on a platform that
doesn't ship it. Adding 3DxWare later means adding one more branch here,
not restructuring this file.

## Verified this is a pure refactor, not just "still compiles"

Reconfigured and rebuilt both ways from scratch:
 - option off: unchanged from before -- no new source files compiled, zero
   new object code.
 - option on: both new files compile with zero warnings, binary still
   links against libspnav.so.0 (confirmed via ldd), and run to completion
   in this environment (which has no spacenavd) with zero crashes and zero
   spnav-related output -- identical to before the refactor.
 - zoomFactorForZAxis re-linked and re-run in isolation: identical output
   to the pre-refactor commit (z=0 -> exactly 1.0, z=+-350 -> 1.35/0.65),
   confirming the math moved unchanged rather than being reimplemented.
2026-08-02 21:22:42 +12:00
ispyisail 2e4bb486bb Add 3D mouse (SpaceMouse/SpacePilot) pan/zoom support via libspnav
Implements discussion #599's phase 1 (Linux, libspnav): a 3Dconnexion
6-DOF device pans and zooms the active diagram view, via spacenavd.

## Off by default, zero cost when off

QET_ENABLE_SPACEMOUSE (cmake/developer_options.cmake) is OFF. Verified in
two separate build directories from a clean configure: with it off, the
new cmake/find_spacemouse.cmake step runs and does nothing (no library
lookup, no definition, no new source files compiled), and qetapp.cpp/.h
produce zero new object code -- both are entirely #ifdef'd out. The
default build is byte-for-byte the same shape as before this commit.

With it on, libspnav is located via its pkg-config file (spnav.pc, shipped
by libspnav-dev on Debian/Ubuntu and equivalent packages elsewhere). If the
option is on but the library isn't found, this does not hard-fail
configure: it downgrades back to off with a warning, so an opt-in feature
never blocks a developer who doesn't have the library installed.

## No new navigation logic -- a new input source for the existing one

DiagramView::wheelEvent() already turns a physical wheel's delta into
horizontalScrollBar()/verticalScrollBar() calls for pan and a
zoom(1 + value/1000) call for zoom -- see diagramview.cpp:661-687.
SpaceMouseListener calls exactly those same primitives from spnav motion
events instead of wheel events. It does not reimplement panning or
zooming.

## Safe by construction even when compiled in

The overwhelming majority of users of a build with the option on still
won't have spacenavd running or a device attached -- that must never
surface as an error dialog or a startup warning. SpaceMouseListener::
isAvailable() reflects this: spnav_open() failing is treated as the
ordinary case, not an error, and the object then does nothing at all.
Verified for real in this environment, which genuinely has no spacenavd
running: built with the option on, ran the resulting binary to completion,
and confirmed zero crashes and zero spnav-related output of any kind --
the silence is the point.

Motion is read via a QSocketNotifier on spnav_fd() (event-driven, no
polling loop, no idle cost) and applied to whichever DiagramView is
currently active, found via qApp->activeWindow() -> QETDiagramEditor ->
currentProjectView() -> currentDiagram(): a 6-DOF device is one ambient
input source for the whole application, not something tied to a
particular window, so there is exactly one listener, owned by QETApp.

## What could not be verified without hardware

The Z-axis-to-zoom-factor mapping (SpaceMouseListener::zoomFactorForZAxis)
is a pure function specifically so it could be tested without a live
device: confirmed a centered device (z=0) yields exactly 1.0 (an exact
no-op, not an epsilon-off value that could trip DiagramView::zoom()'s
>=1 branch), and that push/pull produce symmetric zoom-in/out factors.

What genuinely cannot be checked in this environment: which physical axis
is "left/right" vs "up/down" vs "push/forward", their sign, and whether
the ZOOM_DIVISOR/PAN_SCALE constants feel right on real hardware. Both are
named constants specifically so recalibrating them is a one-line change
once someone with a device tries it -- flagged plainly in the PR rather
than presented as verified.

## Not in this commit

Windows/macOS (proprietary 3DxWare SDK, materially bigger lift) and
device button mapping are both explicitly out of scope for this phase per
the discussion.
2026-08-02 21:04:57 +12:00
ispyisail 81449faffd Add drag-to-resize for dynamic element text width (#577 phase 1)
Adds two QetGraphicsHandlerItem grip handles at the left/right edges of a
selected DynamicElementTextItem's frameRect(), reusing the exact same
handle class, scene-event-filter wiring, and live-drag-then-undo-on-release
pattern QetShapeItem already uses for its own diagram-level resize handles
(sources/qetgraphicsitem/qetshapeitem.cpp).

- Handles are created/destroyed on ItemSelectedHasChanged, matching
  QetShapeItem's convention (and ElementPrimitiveDecorator's, for the
  element editor's own primitives).
- Position is recomputed in paint() rather than hooked to specific
  mutators, since textWidth/font/text/rotation can all move frameRect()
  and there's no single itemChange notification that covers all of them.
- The drag delta is resolved through mapFromScene() into the item's own
  local coordinates, so a rotated text box still resizes along its own
  baseline rather than along the scene's x-axis.
- setTextWidth() is called live during the drag for immediate visual
  feedback (matching how QetShapeItem's handlerMouseMoveEvent live-updates
  geometry); only on release is a QPropertyUndoCommand pushed -- the exact
  same command the properties-panel width spinbox already uses
  (sources/ui/dynamicelementtextmodel.cpp), so no new undo-command class
  or XML was needed.
- The original textWidth() value is preserved as-is (including -1, the
  "auto" sentinel) for the undo command's old_value, separately from the
  concrete baseline used for the live drag's delta math -- otherwise an
  undo would replace "auto width" with a synthesized fixed width instead
  of actually restoring the auto-sizing state.

Scoped to DynamicElementTextItem per the discussion's phase 1 (the
buildable, no-new-XML piece); IndependentTextItem and the element editor's
PartText/PartDynamicTextField have no serialized width property to resize
yet and are left as explicitly out-of-scope follow-ups.

Verified headlessly (Xvfb + xdotool + scrot): selecting an element's
label text shows the two handles, dragging one live-resizes the text
(confirmed via the properties panel's width field updating in real time),
and undo/redo correctly restores the exact original width including the
auto-width (-1) case.
2026-08-01 17:51:26 +12:00
179 changed files with 140596 additions and 909 deletions
-1
View File
@@ -1 +0,0 @@
*.qch filter=lfs diff=lfs merge=lfs -text
-67
View File
@@ -1,67 +0,0 @@
name: Auto-build doxygen docs
on:
push:
tags:
- '**'
jobs:
doxygen:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
show-progress: ''
- name: Setup and run doxygen
run: sudo apt update && sudo apt install doxygen graphviz qhelpgenerator-qt5 -y
- name: Set up Git LFS
run: |
git lfs install
git lfs track "*.qch"
- name: Run doxygen
run: doxygen Doxyfile
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MR_TOKEN }}
commit-message: update QCH file
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
title: Update QCH Help file
body: |
- Updating QT Help file following commit ${{ github.sha }}.
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
branch: update-qch
labels: |
qch
cicd
delete-branch: true
add-paths: doc/*.qch
- uses: actions/upload-pages-artifact@v3
with:
path: ${{ github.workspace }}/doc/html/
deploy:
# Add a dependency to the build job
needs: doxygen
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
+4 -2
View File
@@ -28,7 +28,7 @@ jobs:
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates build-essential cmake ninja-build git pkg-config \
qt6-base-dev qt6-base-private-dev qt6-tools-dev qt6-tools-dev-tools \
libqt6svg6-dev libqt6sql6-sqlite libsqlite3-dev libcups2-dev \
libqt6svg6-dev libqt6sql6-sqlite libcups2-dev libsqlite3-dev \
libxkbcommon-x11-0 \
xvfb openbox xdotool x11-utils
# extra-cmake-modules and the KF6 libraries are installed rather than
@@ -53,7 +53,9 @@ jobs:
git config --global --add safe.directory "$GITHUB_WORKSPACE"
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DQT_VERSION_MAJOR=6
-DQT_VERSION_MAJOR=6 \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DQET_EXPORT_PROJECT_DB=ON
- name: Build
run: cmake --build build --parallel $(nproc)
+53 -10
View File
@@ -59,17 +59,41 @@ jobs:
# ----------------------------------------------------------------
# 2. Download the portable artifact for this flavor
#
# Wrapped in nick-fields/retry: actions/download-artifact@v8 has
# shown repeated "Artifact download failed after 5 retries"
# failures on this cross-workflow download (via run-id) — not a
# real content/digest problem, just flaky Azure blob delivery.
# Two separate occurrences observed within days of each other
# (different artifact IDs/digests, same failure signature), each
# one enough to fail build-msi outright and block the rest of the
# pipeline. Retrying the whole download 3x is cheap insurance.
# Switched to `gh run download` here because nick-fields/retry
# can only retry a shell command, not re-invoke a `uses:` step.
# ----------------------------------------------------------------
- name: Download portable artifact
uses: actions/download-artifact@v8
uses: nick-fields/retry@v3
with:
name: ${{ matrix.portable_artifact }}
path: artifact\files
# workflow_run => use the triggering run's ID
# workflow_dispatch => use input run_id if provided, otherwise current run
run-id: ${{ github.event.workflow_run.id || github.event.inputs.run_id || github.run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 30
shell: pwsh
command: |
if (Test-Path "artifact\files") { Remove-Item -Recurse -Force "artifact\files" }
New-Item -ItemType Directory -Force -Path "artifact\files" | Out-Null
$runId = "${{ github.event.workflow_run.id || github.event.inputs.run_id || github.run_id }}"
gh run download $runId `
--repo "${{ github.repository }}" `
--name "${{ matrix.portable_artifact }}" `
--dir "artifact\files"
if ($LASTEXITCODE -ne 0) {
Write-Error "gh run download failed (exit $LASTEXITCODE)"
exit $LASTEXITCODE
}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ----------------------------------------------------------------
# 3. Extract version
@@ -336,7 +360,13 @@ jobs:
if-no-files-found: error
- name: Delete old nightly .msi asset
if: always()
# Only run if a new MSI actually exists in dist/ — otherwise the old
# (still working) nightly .msi would be deleted without anything to
# replace it, leaving the nightly release with no MSI at all until
# the next successful build (see windows-msi-pipeline notes,
# run 35694391567: an upstream artifact-download failure meant
# dist\*.msi never existed for that run).
if: always() && hashFiles('dist/*.msi') != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
@@ -381,7 +411,20 @@ jobs:
deploy-pages:
needs: build-msi
runs-on: ubuntu-latest
if: always() && needs.build-msi.result == 'success'
# Regenerate the page whenever the MSI job actually ran (success OR
# packaging/signing failure) — not only on full success.
# generate-page.py queries the published assets on the "nightly"
# release itself (line 407: `gh release view nightly --json assets`),
# so it already handles a missing MSI natively (empty MSI_NAME -> no
# MSI button on the page). The page only needs the exe/zip already
# published by windows-build.yml, independent of the MSI's fate.
# Only "skipped"/"cancelled" are excluded: if build-msi never ran at
# all (e.g. Windows Build itself failed), there is nothing new to
# publish and regenerating the page would be pointless.
if: >
always() &&
needs.build-msi.result != 'skipped' &&
needs.build-msi.result != 'cancelled'
permissions:
contents: write
pages: write
+3 -9
View File
@@ -1,5 +1,7 @@
*.snap
.flatpak-builder
__pycache__/
*.pyc
# Qt build output
*.user
# doxygen Doxyfile output
@@ -7,12 +9,4 @@ doc/*
!doc/QElectroTech.qch
QElectroTech.tag
!doc/doc-utils
lang/*.qm
# -- IDE settings/intermediate files --
# zed
.zed
.cache
# VS Code
.vscode
ui_*.h
+11 -2
View File
@@ -36,6 +36,7 @@ include(cmake/git_update_submodules.cmake)
include(cmake/git_last_commit_sha.cmake)
include(cmake/fetch_singleapplication.cmake)
include(cmake/fetch_pugixml.cmake)
include(cmake/find_spacemouse.cmake)
include(cmake/qet_compilation_vars.cmake)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -113,7 +114,9 @@ if(Backtrace_FOUND)
include_directories(${Backtrace_INCLUDE_DIRS})
add_compile_definitions(QET_CRASH_BACKTRACE)
else()
message(STATUS "backtrace() not available: crash dumps will carry the log ring without a backtrace")
message(STATUS
"backtrace() not available: crash dumps will carry the log ring "
"without a backtrace")
endif()
find_package(SQLite3 REQUIRED)
@@ -167,6 +170,12 @@ else()
)
endif()
if(QET_SPACEMOUSE_BACKEND_SPNAV_ENABLED)
list(APPEND QET_SPACEMOUSE_LIBRARIES PkgConfig::SPNAV)
endif()
# A future Windows/macOS (3DxWare) backend would list.APPEND its own SDK
# libraries here, behind its own *_ENABLED guard, alongside this one.
if(APPLE)
# CFBundleIdentifier must not be empty. CMake's default Info.plist
# template fills it from MACOSX_BUNDLE_GUI_IDENTIFIER; with that unset
@@ -285,6 +294,7 @@ target_link_libraries(
SQLite3::SQLite3
${KF_PRIVATE_LIBRARIES}
${QET_PRIVATE_LIBRARIES}
${QET_SPACEMOUSE_LIBRARIES}
)
target_include_directories(
@@ -316,7 +326,6 @@ target_include_directories(
${QET_DIR}/sources/NameList
${QET_DIR}/sources/NameList/ui
${QET_DIR}/sources/utils
${QET_DIR}/pugixml/src
${QET_DIR}/sources/dataBase
${QET_DIR}/sources/dataBase/ui
${QET_DIR}/sources/factory/ui
+16
View File
@@ -271,6 +271,22 @@ mkdir build && cd build
cmake .. -G Ninja -DBUILD_WITH_KF=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build .
```
If `libbacktrace` is installed in your MSYS2 environment, pass the following
cached CMake variables when configuring. They are only necessary in that
case, because `FindBacktrace` needs them to locate the library:
```sh
cmake .. -G Ninja -DBUILD_WITH_KF=OFF -DCMAKE_BUILD_TYPE=Release \
-DBacktrace_INCLUDE_DIR=/c/msys64/clang64/include \
-DBacktrace_LIBRARY=/c/msys64/clang64/lib/libbacktrace.a
```
`Backtrace_INCLUDE_DIR` must point to the directory containing `backtrace.h`,
and `Backtrace_LIBRARY` to the `libbacktrace.a` file. The paths above are the
usual locations for the MSYS2 `clang64` environment; adjust them if your
installation uses a different prefix.
(KF6 isn't packaged in MSYS2 either, hence `-DBUILD_WITH_KF=OFF` again.)
Using the Qt Online Installer's bundled MinGW kit instead: point
+4 -1
View File
@@ -50,6 +50,7 @@ parts:
- python3-lxml
- python3-tk
- libtk8.6
- libspnav0
kde-sdk-setup:
plugin: nil
@@ -92,6 +93,7 @@ parts:
# runs FindCups at configure time and fails without the CUPS headers.
# Build-time only: nothing from it is staged into the snap.
- libcups2-dev
- libspnav-dev
override-build: |
displayed_version=$(cat sources/qetversion.cpp | grep "return QVersionNumber{"| head -n 1| awk -F "{" '{ print $2 }' | awk -F "}" '{ print $1 }' | sed -e 's/,/./g' -e 's/ //g')
snap_version="${displayed_version}-g$(git rev-parse --short=8 HEAD)"
@@ -106,7 +108,8 @@ parts:
-DBUILD_KF=OFF \
-DPACKAGE_TESTS=OFF \
-DBUILD_PUGIXML=ON \
-DQET_EXPORT_PROJECT_DB=ON
-DQET_EXPORT_PROJECT_DB=ON \
-DQET_ENABLE_SPACEMOUSE=ON
ninja -C build -j${CRAFT_PARALLEL_BUILD_COUNT}
DESTDIR="$CRAFT_PART_INSTALL" ninja -C build install
override-stage: |
+5
View File
@@ -47,3 +47,8 @@ option(BUILD_WITH_KF "Build with KDE Frameworks" ON)
# compile for everyone else. Leaving it off keeps CI and contributors on the
# strict behaviour, and only developers who opt in trade that for the speed.
option(QET_ENABLE_PCH "Use precompiled headers (developer build speed; may mask missing #includes)" OFF)
# Phase 1 (Linux, libspnav) of discussion #599: 3Dconnexion SpaceMouse/
# SpacePilot pan/zoom support. Off by default -- see cmake/find_spacemouse.cmake
# for what happens when it is on but libspnav isn't found.
option(QET_ENABLE_SPACEMOUSE "Build with 3Dconnexion/libspnav 3D mouse support for pan/zoom (Linux, requires libspnav-dev and spacenavd)" OFF)
+28 -5
View File
@@ -23,8 +23,31 @@ if(BUILD_WITH_KF)
if(BUILD_KF)
if(NOT DEFINED KF_GIT_TAG)
# this is a more or less random version, taken as an conservative approach
# v6.10.0 is a more or less random version, taken as an conservative
# approach. Pinned to the commits v6.10.0 points at, not to the tags
# themselves; see the note in fetch_pugixml.cmake. Each module lives in its
# own repository, so the same v6.10.0 release is a different commit in
# each.
#
# KDE uses annotated tags, so "git ls-remote <repo> 'refs/tags/v6.10.0*'"
# prints two hashes per module: refs/tags/v6.10.0 is the tag object (the
# tagger, the date and the tag message) and refs/tags/v6.10.0^{} is the
# commit that object points at. The hashes below are the "^{}" ones, i.e.
# the commits. Lightweight tags, such as pugixml's v1.15 and
# SingleApplication's v3.2.0, have no tag object and print only the
# commit line.
set(KF_ECM_GIT_COMMIT 7dd28cc56c339c3f8fb356f7c53c0e8f61433d81) # v6.10.0
set(KF_KCOREADDONS_GIT_COMMIT c569f974dab24b4784ad186a3db4b76b2fa36612) # v6.10.0
set(KF_KWIDGETSADDONS_GIT_COMMIT 1abbed8a280d6626c59fb197f2c4667d2b1e7445) # v6.10.0
if(DEFINED KF_GIT_TAG)
# Explicit override: -DKF_GIT_TAG=<ref> selects one ref for all three
# modules, unpinned, exactly as it did before.
set(KF_ECM_GIT_COMMIT ${KF_GIT_TAG})
set(KF_KCOREADDONS_GIT_COMMIT ${KF_GIT_TAG})
set(KF_KWIDGETSADDONS_GIT_COMMIT ${KF_GIT_TAG})
else()
# Keep KF_GIT_TAG defined: define_definitions.cmake reports it.
set(KF_GIT_TAG v6.10.0)
endif()
# using a function in order to limit the scope of the variables
@@ -53,19 +76,19 @@ if(BUILD_WITH_KF)
FetchContent_Declare(
ecm
GIT_REPOSITORY https://invent.kde.org/frameworks/extra-cmake-modules.git
GIT_TAG ${KF_GIT_TAG})
GIT_TAG ${KF_ECM_GIT_COMMIT})
FetchContent_MakeAvailable(ecm)
FetchContent_Declare(
kcoreaddons
GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git
GIT_TAG ${KF_GIT_TAG})
GIT_TAG ${KF_KCOREADDONS_GIT_COMMIT})
FetchContent_MakeAvailable(kcoreaddons)
FetchContent_Declare(
kwidgetsaddons
GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git
GIT_TAG ${KF_GIT_TAG})
GIT_TAG ${KF_KWIDGETSADDONS_GIT_COMMIT})
FetchContent_MakeAvailable(kwidgetsaddons)
endfunction()
qet_make_kf_available()
+42 -1
View File
@@ -22,10 +22,51 @@ option(BUILD_PUGIXML "Build pugixml library, use system one otherwise" YES)
if(BUILD_PUGIXML)
# Pinned to the commit v1.15 points at, not to the tag itself.
#
# A git tag is only a named pointer to a commit, and anyone with push access
# to the upstream repository can move it (git push --force) to any other
# commit. FetchContent fetches whatever the tag points at when the build
# runs, so if a maintainer account or CI token is compromised, the attacker
# can retarget a well-known release tag to malicious code: every fresh build
# of QElectroTech then compiles it, while nothing changes in this repository
# and the tag name still looks correct. A commit hash cannot be moved, because
# it is derived from the content: different code always has a different hash.
#
# This attack has been used in the wild:
# - March 2025, tj-actions/changed-files (CVE-2025-30066): tags v1 through
# v45.0.7 were retargeted to a commit that dumped CI secrets into build
# logs, affecting more than 23,000 repositories.
# - March 2026, aquasecurity/trivy-action (CVE-2026-33634): 76 of 77
# version tags were force-pushed to a credential stealer and stayed
# malicious for about 12 hours.
# Both were GitHub Actions rather than CMake dependencies, but the mechanism
# is the same one FetchContent relies on here: resolving a git tag at build
# time.
#
# To upgrade, look up the commit the new tag points at with
# git ls-remote <repo> 'refs/tags/<tag>*', check that it is the release you
# expect, and update both the hash and the trailing tag comment.
#
# How many lines that prints depends on which of the two kinds of tag
# upstream created:
# - A lightweight tag is nothing but a ref pointing straight at the commit,
# so ls-remote prints a single line, "refs/tags/<tag>", and its hash is
# the commit to pin. pugixml tags this way, which is why the v1.15 hash
# below is what "git ls-remote ... refs/tags/v1.15" reports directly;
# SingleApplication (v3.2.0) does the same.
# - An annotated tag is a git object in its own right, carrying a tagger,
# a date, a message and optionally a GPG signature, and pointing at the
# commit. ls-remote then prints two lines: "refs/tags/<tag>" is the tag
# object and "refs/tags/<tag>^{}" is that object dereferenced, i.e. the
# commit. The KDE Frameworks modules tag this way, so for them it is the
# "^{}" hash that belongs in the pin; the other hash identifies the tag
# object itself, which is not the source revision and changes whenever
# upstream re-creates the tag, even over the very same commit.
FetchContent_Declare(
pugixml
GIT_REPOSITORY https://github.com/zeux/pugixml.git
GIT_TAG v1.15)
GIT_TAG ee86beb30e4973f5feffe3ce63bfa4fbadf72f38) # v1.15
set(PUGIXML_INSTALL OFF CACHE INTERNAL "")
FetchContent_MakeAvailable(pugixml)
else()
+7 -1
View File
@@ -31,9 +31,15 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/SingleApplication/CMakeLists.txt")
set(FETCHCONTENT_SOURCE_DIR_SINGLEAPPLICATION "${CMAKE_SOURCE_DIR}/SingleApplication")
endif()
# Pinned to the commit v3.2.0 points at, not to the tag itself; see the note in
# fetch_pugixml.cmake. v3.2.0 is a lightweight tag, a ref pointing straight at
# the commit, so "git ls-remote <repo> refs/tags/v3.2.0" prints that commit and
# nothing else. An annotated tag, as KDE uses in fetch_kdeaddons.cmake, would
# print the tag object under refs/tags/v3.2.0 as well, with the commit on the
# refs/tags/v3.2.0^{} line.
FetchContent_Declare(
SingleApplication
GIT_REPOSITORY https://github.com/itay-grudev/SingleApplication.git
GIT_TAG v3.2.0)
GIT_TAG aede311d28d20179216c5419b581087be2a8409f) # v3.2.0
set(QT_DEFAULT_MAJOR_VERSION 6)
FetchContent_MakeAvailable(SingleApplication)
+63
View File
@@ -0,0 +1,63 @@
# Copyright 2006 The QElectroTech Team
# This file is part of QElectroTech.
#
# QElectroTech is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# QElectroTech is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
message(" - find_spacemouse")
# QET_ENABLE_SPACEMOUSE (cmake/developer_options.cmake) is off by default,
# so none of this runs, and the default build is entirely unaffected: no new
# dependency, no new source files, no new symbols.
#
# When it is on, the platform decides which backend (if any) is available --
# see sources/spacemouse/spacemousebackend.h for what a backend is. Only one
# exists today: SpnavBackend, Linux, via libspnav. A Windows/macOS backend
# would need 3Dconnexion's proprietary 3DxWare SDK and is not implemented
# (see discussion #599's own phase split); until it is, turning this option
# on there downgrades cleanly with a warning rather than failing configure.
set(QET_SPACEMOUSE_ENABLED FALSE)
set(QET_SPACEMOUSE_BACKEND_SPNAV_ENABLED FALSE)
if(QET_ENABLE_SPACEMOUSE)
if(UNIX AND NOT APPLE)
# libspnav is looked for via its pkg-config file (present on every
# distro package of it this was checked against: Debian/Ubuntu's
# libspnav-dev ships /usr/share/pkgconfig/spnav.pc). Not found does
# not hard-fail the whole configure -- it downgrades the option back
# to off with a clear message, so a developer who doesn't have the
# library installed still gets a normal build instead of a configure
# error for an opt-in feature they didn't ask to block on.
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(SPNAV IMPORTED_TARGET spnav)
endif()
if(SPNAV_FOUND)
set(QET_SPACEMOUSE_ENABLED TRUE)
set(QET_SPACEMOUSE_BACKEND_SPNAV_ENABLED TRUE)
add_definitions(-DQET_SPACEMOUSE_SUPPORT)
add_definitions(-DQET_SPACEMOUSE_BACKEND_SPNAV)
message("QET_ENABLE_SPACEMOUSE ON (backend: libspnav ${SPNAV_VERSION})")
else()
message(WARNING "QET_ENABLE_SPACEMOUSE is ON but libspnav was not found via pkg-config "
"(install libspnav-dev, or the equivalent for your distribution) -- "
"building WITHOUT 3D mouse support.")
endif()
else()
message(WARNING "QET_ENABLE_SPACEMOUSE is ON but no 3D mouse backend is implemented yet "
"for this platform (only Linux/libspnav exists today -- see "
"https://github.com/qelectrotech/qelectrotech-source-mirror/discussions/599) "
"-- building WITHOUT 3D mouse support.")
endif()
endif()
@@ -62,7 +62,9 @@ if(WIN32)
# puts the .qm files (see build-aux/windows/QElectroTech.wxs and the
# windows-build workflow), and what the shortcuts pass as --lang-dir.
set(QET_LANG_PATH "lang/")
set(QET_EXAMPLES_PATH "examples/")
set(QET_LICENSE_PATH "./")
set(QET_ICONS_PATH "icons/hicolor/")
# Liste des ressources Windows
#RC_FILE = qelectrotech.rc
endif()
+31 -4
View File
@@ -248,6 +248,8 @@ set(QET_SRC_FILES
${QET_DIR}/sources/qet.h
${QET_DIR}/sources/qeticons.cpp
${QET_DIR}/sources/qeticons.h
${QET_DIR}/sources/palettegraphicsview.cpp
${QET_DIR}/sources/palettegraphicsview.h
${QET_DIR}/sources/qetpalette.cpp
${QET_DIR}/sources/qetpalette.h
${QET_DIR}/sources/qetstyle.cpp
@@ -295,6 +297,8 @@ set(QET_SRC_FILES
${QET_DIR}/sources/autoNum/numerotationcontextcommands.h
${QET_DIR}/sources/autoNum/numerotationcontext.cpp
${QET_DIR}/sources/autoNum/numerotationcontext.h
${QET_DIR}/sources/autoNum/renumberelementscommand.cpp
${QET_DIR}/sources/autoNum/renumberelementscommand.h
${QET_DIR}/sources/autoNum/ui/autonumberingdockwidget.cpp
${QET_DIR}/sources/autoNum/ui/autonumberingdockwidget.h
${QET_DIR}/sources/autoNum/ui/autonumberingmanagementw.cpp
@@ -305,11 +309,15 @@ set(QET_SRC_FILES
${QET_DIR}/sources/autoNum/ui/formulaautonumberingw.h
${QET_DIR}/sources/autoNum/ui/numparteditorw.cpp
${QET_DIR}/sources/autoNum/ui/numparteditorw.h
${QET_DIR}/sources/autoNum/ui/renumberelementsdialog.cpp
${QET_DIR}/sources/autoNum/ui/renumberelementsdialog.h
${QET_DIR}/sources/autoNum/ui/selectautonumw.cpp
${QET_DIR}/sources/autoNum/ui/selectautonumw.h
${QET_DIR}/sources/dataBase/projectdatabase.cpp
${QET_DIR}/sources/dataBase/projectdatabase.h
${QET_DIR}/sources/dataBase/sqlreadonly.cpp
${QET_DIR}/sources/dataBase/sqlreadonly.h
${QET_DIR}/sources/dataBase/ui/elementquerywidget.cpp
${QET_DIR}/sources/dataBase/ui/elementquerywidget.h
@@ -505,10 +513,6 @@ set(QET_SRC_FILES
${QET_DIR}/sources/PropertiesEditor/propertieseditorwidget.cpp
${QET_DIR}/sources/PropertiesEditor/propertieseditorwidget.h
${QET_DIR}/pugixml/src/pugiconfig.hpp
${QET_DIR}/pugixml/src/pugixml.cpp
${QET_DIR}/pugixml/src/pugixml.hpp
${QET_DIR}/sources/qetgraphicsitem/conductor.cpp
${QET_DIR}/sources/qetgraphicsitem/conductor.h
${QET_DIR}/sources/qetgraphicsitem/conductortextitem.cpp
@@ -705,6 +709,8 @@ set(QET_SRC_FILES
${QET_DIR}/sources/ui/conductorpropertiesdialog.h
${QET_DIR}/sources/ui/conductorcolortoolbutton.cpp
${QET_DIR}/sources/ui/conductorcolortoolbutton.h
${QET_DIR}/sources/ui/diagrambgcolorbutton.cpp
${QET_DIR}/sources/ui/diagrambgcolorbutton.h
${QET_DIR}/sources/ui/conductorpropertieswidget.cpp
${QET_DIR}/sources/ui/conductorpropertieswidget.h
${QET_DIR}/sources/ui/configsaveloaderwidget.cpp
@@ -721,6 +727,8 @@ set(QET_SRC_FILES
${QET_DIR}/sources/ui/backupdialog.h
${QET_DIR}/sources/ui/dialogwaiting.cpp
${QET_DIR}/sources/ui/dialogwaiting.h
${QET_DIR}/sources/ui/duplicateoffsetdialog.cpp
${QET_DIR}/sources/ui/duplicateoffsetdialog.h
${QET_DIR}/sources/ui/dynamicelementtextitemeditor.cpp
${QET_DIR}/sources/ui/dynamicelementtextitemeditor.h
${QET_DIR}/sources/ui/dynamicelementtextmodel.cpp
@@ -867,6 +875,25 @@ list(APPEND QET_SRC_FILES
${QET_DIR}/sources/scripting/qetscripting.h
)
if(QET_SPACEMOUSE_ENABLED)
list(APPEND QET_SRC_FILES
${QET_DIR}/sources/spacemouse/spacemousebackend.h
${QET_DIR}/sources/spacemouse/spacemousebuttonmap.cpp
${QET_DIR}/sources/spacemouse/spacemousebuttonmap.h
${QET_DIR}/sources/spacemouse/spacemouselistener.cpp
${QET_DIR}/sources/spacemouse/spacemouselistener.h
${QET_DIR}/sources/ui/configpage/spacemouseconfigpage.cpp
${QET_DIR}/sources/ui/configpage/spacemouseconfigpage.h
)
endif()
if(QET_SPACEMOUSE_BACKEND_SPNAV_ENABLED)
list(APPEND QET_SRC_FILES
${QET_DIR}/sources/spacemouse/spnavbackend.cpp
${QET_DIR}/sources/spacemouse/spnavbackend.h
)
endif()
set(TS_FILES
${QET_DIR}/lang/qet_ar.ts
${QET_DIR}/lang/qet_ca.ts
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

+29
View File
@@ -0,0 +1,29 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
<!-- keyboard body with a lighter top edge -->
<rect x="6" y="30" width="116" height="68" rx="8" fill="#31363b"/>
<rect x="6" y="30" width="116" height="34" rx="8" fill="#4d4d4d"/>
<rect x="6" y="46" width="116" height="18" fill="#31363b"/>
<!-- key rows -->
<g fill="#eff0f1">
<rect x="14" y="38" width="8" height="8" rx="1.5"/><rect x="24" y="38" width="8" height="8" rx="1.5"/>
<rect x="34" y="38" width="8" height="8" rx="1.5"/><rect x="44" y="38" width="8" height="8" rx="1.5"/>
<rect x="54" y="38" width="8" height="8" rx="1.5"/><rect x="64" y="38" width="8" height="8" rx="1.5"/>
<rect x="74" y="38" width="8" height="8" rx="1.5"/><rect x="84" y="38" width="8" height="8" rx="1.5"/>
<rect x="94" y="38" width="8" height="8" rx="1.5"/><rect x="104" y="38" width="10" height="8" rx="1.5"/>
<rect x="14" y="50" width="12" height="8" rx="1.5"/><rect x="28" y="50" width="8" height="8" rx="1.5"/>
<rect x="38" y="50" width="8" height="8" rx="1.5"/><rect x="48" y="50" width="8" height="8" rx="1.5"/>
<rect x="58" y="50" width="8" height="8" rx="1.5"/><rect x="68" y="50" width="8" height="8" rx="1.5"/>
<rect x="78" y="50" width="8" height="8" rx="1.5"/><rect x="88" y="50" width="8" height="8" rx="1.5"/>
<rect x="98" y="50" width="16" height="8" rx="1.5"/>
<rect x="14" y="62" width="16" height="8" rx="1.5"/><rect x="32" y="62" width="8" height="8" rx="1.5"/>
<rect x="42" y="62" width="8" height="8" rx="1.5"/><rect x="52" y="62" width="8" height="8" rx="1.5"/>
<rect x="62" y="62" width="8" height="8" rx="1.5"/><rect x="72" y="62" width="8" height="8" rx="1.5"/>
<rect x="82" y="62" width="8" height="8" rx="1.5"/><rect x="92" y="62" width="22" height="8" rx="1.5"/>
<rect x="14" y="74" width="10" height="8" rx="1.5"/><rect x="26" y="74" width="10" height="8" rx="1.5"/>
<rect x="38" y="74" width="52" height="8" rx="1.5"/>
<rect x="92" y="74" width="10" height="8" rx="1.5"/><rect x="104" y="74" width="10" height="8" rx="1.5"/>
</g>
<!-- the two keys of a shortcut, pressed -->
<rect x="14" y="62" width="16" height="8" rx="1.5" fill="#3daee9"/>
<rect x="42" y="62" width="8" height="8" rx="1.5" fill="#3daee9"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

+48
View File
@@ -0,0 +1,48 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
<!-- DIN rail -->
<rect x="6" y="86" width="116" height="18" rx="3" fill="#7f8c8d"/>
<rect x="6" y="92" width="116" height="6" fill="#4d4d4d"/>
<!-- six terminal blocks: L, L, N, PE, L, spare -->
<g fill="#eff0f1">
<rect x="12" y="26" width="16" height="66" rx="2"/>
<rect x="30" y="26" width="16" height="66" rx="2"/>
<rect x="48" y="26" width="16" height="66" rx="2"/>
<rect x="66" y="26" width="16" height="66" rx="2"/>
<rect x="84" y="26" width="16" height="66" rx="2"/>
<rect x="102" y="26" width="16" height="66" rx="2"/>
</g>
<!-- right-hand shading of each block -->
<g fill="#bdc3c7">
<rect x="24" y="28" width="4" height="62"/>
<rect x="42" y="28" width="4" height="62"/>
<rect x="60" y="28" width="4" height="62"/>
<rect x="78" y="28" width="4" height="62"/>
<rect x="96" y="28" width="4" height="62"/>
<rect x="114" y="28" width="4" height="62"/>
</g>
<!-- colored marker bands -->
<rect x="12" y="26" width="16" height="10" rx="2" fill="#7f8c8d"/>
<rect x="30" y="26" width="16" height="10" rx="2" fill="#7f8c8d"/>
<rect x="48" y="26" width="16" height="10" rx="2" fill="#3daee9"/>
<rect x="66" y="26" width="16" height="10" rx="2" fill="#27ae60"/>
<rect x="70" y="26" width="8" height="10" fill="#fdbc4b"/>
<rect x="84" y="26" width="16" height="10" rx="2" fill="#7f8c8d"/>
<rect x="102" y="26" width="16" height="10" rx="2" fill="#da4453"/>
<!-- screws -->
<g fill="#31363b">
<circle cx="20" cy="50" r="4.5"/><circle cx="20" cy="74" r="4.5"/>
<circle cx="38" cy="50" r="4.5"/><circle cx="38" cy="74" r="4.5"/>
<circle cx="56" cy="50" r="4.5"/><circle cx="56" cy="74" r="4.5"/>
<circle cx="74" cy="50" r="4.5"/><circle cx="74" cy="74" r="4.5"/>
<circle cx="92" cy="50" r="4.5"/><circle cx="92" cy="74" r="4.5"/>
<circle cx="110" cy="50" r="4.5"/><circle cx="110" cy="74" r="4.5"/>
</g>
<g fill="#eff0f1">
<rect x="16" y="49" width="8" height="2"/><rect x="16" y="73" width="8" height="2"/>
<rect x="34" y="49" width="8" height="2"/><rect x="34" y="73" width="8" height="2"/>
<rect x="52" y="49" width="8" height="2"/><rect x="52" y="73" width="8" height="2"/>
<rect x="70" y="49" width="8" height="2"/><rect x="70" y="73" width="8" height="2"/>
<rect x="88" y="49" width="8" height="2"/><rect x="88" y="73" width="8" height="2"/>
<rect x="106" y="49" width="8" height="2"/><rect x="106" y="73" width="8" height="2"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

+1
View File
@@ -216,6 +216,7 @@ Clarification:
ico/128x128/diagram.png by the QElectroTech team (License CC BY-ND 3.0)
ico/128x128/document-export.png by the QElectroTech team (License CC BY-ND 3.0)
ico/128x128/project.png by the QElectroTech team (License CC BY-ND 3.0)
ico/128x128/terminalstrip.png and configure-shortcuts.png by Jeff Patterson from the QElectroTech team (License CC BY-ND 3.0), rendered from the .svg files beside them
ico/scalable/pdf-import.svg by Jeff Patterson from the QElectroTech team (License CC BY-ND 3.0), laid out like ico/22x22/insert-image.png
ico/scalable/diagram.svg, folio-new.svg, folio-delete.svg, folio-properties.svg, label.svg by Jeff Patterson from the QElectroTech team (License CC BY-ND 3.0), the folio icons redrawn in the same style
ico/256x256/* by Nuri from the QElectroTech team (License CC BY-ND 3.0)
+4
View File
@@ -259,12 +259,14 @@
<file alias="themes/qet/48x48/user-away-extended.png">48x48/user-away-extended.png</file>
<file alias="themes/qet/48x48/user-away.png">48x48/user-away.png</file>
<file alias="themes/qet/48x48/view-pim-journal.png">48x48/view-pim-journal.png</file>
<file alias="themes/qet/128x128/configure-shortcuts.png">128x128/configure-shortcuts.png</file>
<file alias="themes/qet/128x128/diagram.png">128x128/diagram.png</file>
<file alias="themes/qet/128x128/document-export.png">128x128/document-export.png</file>
<file alias="themes/qet/128x128/plasmagik.png">128x128/plasmagik.png</file>
<file alias="themes/qet/128x128/printer.png">128x128/printer.png</file>
<file alias="themes/qet/128x128/project.png">128x128/project.png</file>
<file alias="themes/qet/128x128/settings.png">128x128/settings.png</file>
<file alias="themes/qet/128x128/terminalstrip.png">128x128/terminalstrip.png</file>
<file alias="themes/qet/scalable/diagram.svg">scalable/diagram.svg</file>
<file alias="themes/qet/scalable/folio-delete.svg">scalable/folio-delete.svg</file>
<file alias="themes/qet/scalable/folio-new.svg">scalable/folio-new.svg</file>
@@ -469,5 +471,7 @@
<file>themes/qet-dark/scalable/ellipse-to-bezier.svg</file>
<file>themes/qet-dark/scalable/rect-to-bezier.svg</file>
<file>themes/qet-dark/scalable/rect-to-polyline.svg</file>
<file alias="themes/qet-dark/128x128/document-export.png">128x128/document-export.png</file>
<file alias="themes/qet-dark/128x128/printer.png">128x128/printer.png</file>
</qresource>
</RCC>
File diff suppressed because it is too large Load Diff
+222
View File
@@ -0,0 +1,222 @@
<!DOCTYPE QPH>
<QPH sourcelanguage="fr_FR" language="ca">
<phrase>
<source>Réf. croisée</source>
<target>Ref. creuada</target>
</phrase>
<phrase>
<source>armoire</source>
<target>armari</target>
<definition>cabinet / enclosure</definition>
</phrase>
<phrase>
<source>bobine</source>
<target>bobina</target>
<definition>coil</definition>
</phrase>
<phrase>
<source>borne</source>
<target>born</target>
<definition>terminal - a connection point on a symbol</definition>
</phrase>
<phrase>
<source>bornier</source>
<target>bornes</target>
<definition>terminal strip</definition>
</phrase>
<phrase>
<source>cable</source>
<target>cable</target>
<definition>cable</definition>
</phrase>
<phrase>
<source>calibre</source>
<target>calibre</target>
<definition>rating - the current rating of a device</definition>
</phrase>
<phrase>
<source>cartouche</source>
<target>cartutx</target>
<definition>title block - the framed information panel</definition>
</phrase>
<phrase>
<source>champ de texte</source>
<target>camp de text</target>
<definition>text field</definition>
</phrase>
<phrase>
<source>collection</source>
<target>col·lecció</target>
<definition>collection - the symbol library</definition>
</phrase>
<phrase>
<source>conducteur</source>
<target>conductor</target>
<definition>conductor - the drawn wire between terminals</definition>
</phrase>
<phrase>
<source>contact</source>
<target>contacte</target>
<definition>contact</definition>
</phrase>
<phrase>
<source>contacteur</source>
<target>contactor</target>
<definition>contactor</definition>
</phrase>
<phrase>
<source>courant</source>
<target>corrent</target>
<definition>current</definition>
</phrase>
<phrase>
<source>disjoncteur</source>
<target>disjuntor</target>
<definition>circuit breaker</definition>
</phrase>
<phrase>
<source>dossier</source>
<target>carpeta</target>
<definition>folder</definition>
</phrase>
<phrase>
<source>element</source>
<target>element</target>
<definition>element - a symbol placed on a sheet</definition>
</phrase>
<phrase>
<source>esclave</source>
<target>esclau</target>
<definition>slave - the contact block belonging to a master</definition>
</phrase>
<phrase>
<source>fil</source>
<target>fil</target>
<definition>wire</definition>
</phrase>
<phrase>
<source>folio</source>
<target>plec</target>
<definition>sheet - one drawing of a set</definition>
</phrase>
<phrase>
<source>fusible</source>
<target>fusible</target>
<definition>fuse</definition>
</phrase>
<phrase>
<source>grille</source>
<target>graella</target>
<definition>grid</definition>
</phrase>
<phrase>
<source>interrupteur</source>
<target>interruptor</target>
<definition>switch</definition>
</phrase>
<phrase>
<source>maitre</source>
<target>mestre</target>
<definition>master - the element a cross-reference points from</definition>
</phrase>
<phrase>
<source>modele</source>
<target>plantilla</target>
<definition>template</definition>
</phrase>
<phrase>
<source>moteur</source>
<target>motor</target>
<definition>motor</definition>
</phrase>
<phrase>
<source>neutre</source>
<target>neutre</target>
<definition>neutral</definition>
</phrase>
<phrase>
<source>nomenclature</source>
<target>nomenclatura</target>
<definition>parts list / bill of materials</definition>
</phrase>
<phrase>
<source>numerotation</source>
<target>numeració</target>
<definition>numbering - automatic wire and part numbering</definition>
</phrase>
<phrase>
<source>phase</source>
<target>fase</target>
<definition>phase</definition>
</phrase>
<phrase>
<source>potentiel</source>
<target>potencial</target>
<definition>potential - conductors electrically joined as one node</definition>
</phrase>
<phrase>
<source>projet</source>
<target>projecte</target>
<definition>project - the .qet file holding the sheets</definition>
</phrase>
<phrase>
<source>puissance</source>
<target>potència</target>
<definition>power</definition>
</phrase>
<phrase>
<source>relais</source>
<target>relé</target>
<definition>relay</definition>
</phrase>
<phrase>
<source>renvoi de folio</source>
<target>referència de plec</target>
<definition>sheet cross-reference</definition>
</phrase>
<phrase>
<source>repere</source>
<target>referència</target>
<definition>designation - the identifying mark on a part</definition>
</phrase>
<phrase>
<source>report de folio</source>
<target>remissió de plec</target>
<definition>sheet cross-reference (the arrow symbol)</definition>
</phrase>
<phrase>
<source>schema</source>
<target>esquema</target>
<definition>diagram</definition>
</phrase>
<phrase>
<source>section</source>
<target>secció</target>
<definition>cross-section - conductor size in mm2</definition>
</phrase>
<phrase>
<source>sommaire</source>
<target>sumari</target>
<definition>summary / table of contents</definition>
</phrase>
<phrase>
<source>tension</source>
<target>tensió</target>
<definition>voltage</definition>
</phrase>
<phrase>
<source>terre</source>
<target>terra</target>
<definition>earth / ground</definition>
</phrase>
<phrase>
<source>texte</source>
<target>text</target>
<definition>text</definition>
</phrase>
<phrase>
<source>transformateur</source>
<target>transformador</target>
<definition>transformer</definition>
</phrase>
</QPH>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4
View File
@@ -100,4 +100,8 @@
<source>traduction</source>
<target>Übersetzung</target>
</phrase>
<phrase>
<source>Modifier le nom de la borne</source>
<target>Klemmenname ändern</target>
</phrase>
</QPH>
File diff suppressed because it is too large Load Diff
+918
View File
@@ -0,0 +1,918 @@
<!DOCTYPE QPH>
<QPH sourcelanguage="fr_FR" language="en">
<phrase>
<source>Blue : Blue</source>
<target>Blue : Blue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : CornflowerBlue</source>
<target>Blue : CornflowerBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : DarkBlue</source>
<target>Blue : DarkBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : DeepSkyBlue</source>
<target>Blue : DeepSkyBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : DodgerBlue</source>
<target>Blue : DodgerBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : LightBlue</source>
<target>Blue : LightBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : LightSkyBlue</source>
<target>Blue : LightSkyBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : LightSteelBlue</source>
<target>Blue : LightSteelBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : MediumBlue</source>
<target>Blue : MediumBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : MidnightBlue</source>
<target>Blue : MidnightBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : Navy</source>
<target>Blue : Navy</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : PowderBlue</source>
<target>Blue : PowderBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : RoyalBlue</source>
<target>Blue : RoyalBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : SkyBlue</source>
<target>Blue : SkyBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Blue : SteelBlue</source>
<target>Blue : SteelBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Bisque</source>
<target>Brown : Bisque</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : BlanchedAlmond</source>
<target>Brown : BlanchedAlmond</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Brown</source>
<target>Brown : Brown</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Burlywood</source>
<target>Brown : Burlywood</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Chocolate</source>
<target>Brown : Chocolate</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Cornsilk</source>
<target>Brown : Cornsilk</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : DarkGoldenrod</source>
<target>Brown : DarkGoldenrod</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Goldenrod</source>
<target>Brown : Goldenrod</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Maroon</source>
<target>Brown : Maroon</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : NavajoWhite</source>
<target>Brown : NavajoWhite</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Peru</source>
<target>Brown : Peru</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : RosyBrown</source>
<target>Brown : RosyBrown</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : SaddleBrown</source>
<target>Brown : SaddleBrown</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : SandyBrown</source>
<target>Brown : SandyBrown</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Sienna</source>
<target>Brown : Sienna</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Tan</source>
<target>Brown : Tan</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Brown : Wheat</source>
<target>Brown : Wheat</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : Aqua</source>
<target>Cyan : Aqua</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : Aquamarine</source>
<target>Cyan : Aquamarine</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : CadetBlue</source>
<target>Cyan : CadetBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : Cyan</source>
<target>Cyan : Cyan</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : DarkCyan</source>
<target>Cyan : DarkCyan</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : DarkTurquoise</source>
<target>Cyan : DarkTurquoise</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : LightCyan</source>
<target>Cyan : LightCyan</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : LightSeaGreen</source>
<target>Cyan : LightSeaGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : MediumTurquoise</source>
<target>Cyan : MediumTurquoise</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : PaleTurquoise</source>
<target>Cyan : PaleTurquoise</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : Teal</source>
<target>Cyan : Teal</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Cyan : Turquoise</source>
<target>Cyan : Turquoise</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : Black</source>
<target>Gray : Black</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : DarkGray</source>
<target>Gray : DarkGray</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : DarkSlateGray</source>
<target>Gray : DarkSlateGray</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : DimGray</source>
<target>Gray : DimGray</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : Gainsboro</source>
<target>Gray : Gainsboro</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : Gray</source>
<target>Gray : Gray</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : LightGray</source>
<target>Gray : LightGray</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : LightSlateGray</source>
<target>Gray : LightSlateGray</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : Silver</source>
<target>Gray : Silver</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Gray : SlateGray</source>
<target>Gray : SlateGray</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : Chartreuse</source>
<target>Green : Chartreuse</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : DarkGreen</source>
<target>Green : DarkGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : DarkOliveGreen</source>
<target>Green : DarkOliveGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : DarkSeaGreen</source>
<target>Green : DarkSeaGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : ForestGreen</source>
<target>Green : ForestGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : Green</source>
<target>Green : Green</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : GreenYellow</source>
<target>Green : GreenYellow</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : LawnGreen</source>
<target>Green : LawnGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : LightGreen</source>
<target>Green : LightGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : Lime</source>
<target>Green : Lime</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : LimeGreen</source>
<target>Green : LimeGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : MediumAquamarine</source>
<target>Green : MediumAquamarine</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : MediumSeaGreen</source>
<target>Green : MediumSeaGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : MediumSpringGreen</source>
<target>Green : MediumSpringGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : Olive</source>
<target>Green : Olive</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : OliveDrab</source>
<target>Green : OliveDrab</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : PaleGreen</source>
<target>Green : PaleGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : SeaGreen</source>
<target>Green : SeaGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : SpringGreen</source>
<target>Green : SpringGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Green : YellowGreen</source>
<target>Green : YellowGreen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Orange : Coral</source>
<target>Orange : Coral</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Orange : DarkOrange</source>
<target>Orange : DarkOrange</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Orange : Orange</source>
<target>Orange : Orange</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Orange : OrangeRed</source>
<target>Orange : OrangeRed</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Orange : Tomato</source>
<target>Orange : Tomato</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Pink : DeepPink</source>
<target>Pink: DeepPink</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Pink : HotPink</source>
<target>Pink: HotPink</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Pink : LightPink</source>
<target>Pink: LightPink</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Pink : MediumVioletRed</source>
<target>Pink: MediumVioletRed</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Pink : PaleVioletRed</source>
<target>Pink: PaleVioletRed</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Pink : Pink</source>
<target>Pink: Pink</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : BlueViolet</source>
<target>Purple : BlueViolet</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : DarkMagenta</source>
<target>Purple : DarkMagenta</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : DarkOrchid</source>
<target>Purple : DarkOrchid</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : DarkSlateBlue</source>
<target>Purple : DarkSlateBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : DarkViolet</source>
<target>Purple : DarkViolet</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : Fuchsia</source>
<target>Purple : Fuchsia</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : Indigo</source>
<target>Purple : Indigo</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : Lavender</source>
<target>Purple : Lavender</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : Magenta</source>
<target>Purple : Magenta</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : MediumOrchid</source>
<target>Purple : MediumOrchid</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : MediumPurple</source>
<target>Purple : MediumPurple</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : MediumSlateBlue</source>
<target>Purple : MediumSlateBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : Orchid</source>
<target>Purple : Orchid</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : Plum</source>
<target>Purple : Plum</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : Purple</source>
<target>Purple : Purple</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : SlateBlue</source>
<target>Purple : SlateBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : Thistle</source>
<target>Purple : Thistle</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Purple : Violet</source>
<target>Purple : Violet</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Red : Crimson</source>
<target>Red : Crimson</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Red : DarkRed</source>
<target>Red : DarkRed</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Red : DarkSalmon</source>
<target>Red: DarkSalmon</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Red : Firebrick</source>
<target>Red : Firebrick</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Red : IndianRed</source>
<target>Red: IndianRed</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Red : LightCoral</source>
<target>Red: LightCoral</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Red : LightSalmon</source>
<target>Red: LightSalmon</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Red : Red</source>
<target>Red : Red</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Red : Salmon</source>
<target>Red: Salmon</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : AliceBlue</source>
<target>White : AliceBlue</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : AntiqueWhite</source>
<target>White : AntiqueWhite</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : Azure</source>
<target>White : Azure</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : Beige</source>
<target>White : Beige</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : FloralWhite</source>
<target>White : FloralWhite</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : GhostWhite</source>
<target>White : GhostWhite</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : Honeydew</source>
<target>White : Honeydew</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : Ivory</source>
<target>White : Ivory</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : LavenderBlush</source>
<target>White : LavenderBlush</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : Linen</source>
<target>White : Linen</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : MintCream</source>
<target>White : MintCream</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : MistyRose</source>
<target>White : MistyRose</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : OldLace</source>
<target>White : OldLace</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : Seashell</source>
<target>White : Seashell</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : Snow</source>
<target>White : Snow</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : White</source>
<target>White : White</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>White : WhiteSmoke</source>
<target>White : WhiteSmoke</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : DarkKhaki</source>
<target>Yellow : DarkKhaki</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : Gold</source>
<target>Yellow : Gold</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : Khaki</source>
<target>Yellow : Khaki</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : LemonChiffon</source>
<target>Yellow : LemonChiffon</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : LightGoldenrodYellow</source>
<target>Yellow : LightGoldenrodYellow</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : LightYellow</source>
<target>Yellow : LightYellow</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : Moccasin</source>
<target>Yellow : Moccasin</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : PaleGoldenrod</source>
<target>Yellow : PaleGoldenrod</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : PapayaWhip</source>
<target>Yellow : PapayaWhip</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : PeachPuff</source>
<target>Yellow : PeachPuff</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>Yellow : Yellow</source>
<target>Yellow : Yellow</target>
<definition>element part filling</definition>
</phrase>
<phrase>
<source>armoire</source>
<target>cabinet</target>
<definition>cabinet / enclosure</definition>
</phrase>
<phrase>
<source>bobine</source>
<target>coil</target>
<definition>coil</definition>
</phrase>
<phrase>
<source>borne</source>
<target>terminal</target>
<definition>terminal - a connection point on a symbol</definition>
</phrase>
<phrase>
<source>bornier</source>
<target>terminal strip</target>
<definition>terminal strip</definition>
</phrase>
<phrase>
<source>cable</source>
<target>cable</target>
<definition>cable</definition>
</phrase>
<phrase>
<source>calibre</source>
<target>rating</target>
<definition>rating - the current rating of a device</definition>
</phrase>
<phrase>
<source>cartouche</source>
<target>title block</target>
<definition>title block - the framed information panel</definition>
</phrase>
<phrase>
<source>champ de texte</source>
<target>text field</target>
<definition>text field</definition>
</phrase>
<phrase>
<source>collection</source>
<target>collection</target>
<definition>collection - the symbol library</definition>
</phrase>
<phrase>
<source>conducteur</source>
<target>conductor</target>
<definition>conductor - the drawn wire between terminals</definition>
</phrase>
<phrase>
<source>contact</source>
<target>contact</target>
<definition>contact</definition>
</phrase>
<phrase>
<source>contacteur</source>
<target>contactor</target>
<definition>contactor</definition>
</phrase>
<phrase>
<source>courant</source>
<target>current</target>
<definition>current</definition>
</phrase>
<phrase>
<source>disjoncteur</source>
<target>circuit breaker</target>
<definition>circuit breaker</definition>
</phrase>
<phrase>
<source>dossier</source>
<target>folder</target>
<definition>folder</definition>
</phrase>
<phrase>
<source>element</source>
<target>element</target>
<definition>element - a symbol placed on a sheet</definition>
</phrase>
<phrase>
<source>esclave</source>
<target>slave</target>
<definition>slave - the contact block belonging to a master</definition>
</phrase>
<phrase>
<source>fil</source>
<target>wire</target>
<definition>wire</definition>
</phrase>
<phrase>
<source>folio</source>
<target>sheet</target>
<definition>sheet - one drawing of a set</definition>
</phrase>
<phrase>
<source>fusible</source>
<target>fuse</target>
<definition>fuse</definition>
</phrase>
<phrase>
<source>grille</source>
<target>grid</target>
<definition>grid</definition>
</phrase>
<phrase>
<source>interrupteur</source>
<target>switch</target>
<definition>switch</definition>
</phrase>
<phrase>
<source>maitre</source>
<target>master</target>
<definition>master - the element a cross-reference points from</definition>
</phrase>
<phrase>
<source>modele</source>
<target>template</target>
<definition>template</definition>
</phrase>
<phrase>
<source>moteur</source>
<target>motor</target>
<definition>motor</definition>
</phrase>
<phrase>
<source>neutre</source>
<target>neutral</target>
<definition>neutral</definition>
</phrase>
<phrase>
<source>nomenclature</source>
<target>parts list</target>
<definition>parts list / bill of materials</definition>
</phrase>
<phrase>
<source>numerotation</source>
<target>numbering</target>
<definition>numbering - automatic wire and part numbering</definition>
</phrase>
<phrase>
<source>phase</source>
<target>phase</target>
<definition>phase</definition>
</phrase>
<phrase>
<source>potentiel</source>
<target>potential</target>
<definition>potential - conductors electrically joined as one node</definition>
</phrase>
<phrase>
<source>projet</source>
<target>project</target>
<definition>project - the .qet file holding the sheets</definition>
</phrase>
<phrase>
<source>puissance</source>
<target>power</target>
<definition>power</definition>
</phrase>
<phrase>
<source>relais</source>
<target>relay</target>
<definition>relay</definition>
</phrase>
<phrase>
<source>renvoi de folio</source>
<target>sheet cross-reference</target>
<definition>sheet cross-reference</definition>
</phrase>
<phrase>
<source>repere</source>
<target>designation</target>
<definition>designation - the identifying mark on a part</definition>
</phrase>
<phrase>
<source>report de folio</source>
<target>sheet cross-reference</target>
<definition>sheet cross-reference (the arrow symbol)</definition>
</phrase>
<phrase>
<source>schema</source>
<target>diagram</target>
<definition>diagram</definition>
</phrase>
<phrase>
<source>section</source>
<target>cross-section</target>
<definition>cross-section - conductor size in mm2</definition>
</phrase>
<phrase>
<source>sommaire</source>
<target>summary</target>
<definition>summary / table of contents</definition>
</phrase>
<phrase>
<source>tension</source>
<target>voltage</target>
<definition>voltage</definition>
</phrase>
<phrase>
<source>terre</source>
<target>earth</target>
<definition>earth / ground</definition>
</phrase>
<phrase>
<source>texte</source>
<target>text</target>
<definition>text</definition>
</phrase>
<phrase>
<source>transformateur</source>
<target>transformer</target>
<definition>transformer</definition>
</phrase>
</QPH>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+941
View File
@@ -0,0 +1,941 @@
<!DOCTYPE QPH>
<QPH sourcelanguage="fr_FR" language="nl_BE">
<phrase>
<source> Contacts : NO : %1, NC : %2, inverseurs : %3, autres : %4
</source>
<target>Contacten: NO: %1, NC: %2, wisselcontacten: %3, andere: %4
</target>
</phrase>
<phrase>
<source> Contacts : NO : %1/%2, NC : %3/%4, inverseurs : %5/%6, autres : %7/%8
</source>
<target>Contacten: NO: %1/%2, NC: %3/%4, wisselcontacten: %5/%6, andere: %7/%8
</target>
</phrase>
<phrase>
<source> %</source>
<target>%</target>
</phrase>
<phrase>
<source> (Ctrl pendant le glissement = position libre, sans accrochage à la grille)</source>
<target>(Ctrl tijdens het slepen = vrije positie, zonder vastklikken aan het raster)</target>
</phrase>
<phrase>
<source> -- %1 : mode %2</source>
<target>-- %1 : modus %2</target>
</phrase>
<phrase>
<source> ; point rouge : glisser pour repositionner le centre de rotation</source>
<target>; rood punt: slepen om het draaipunt te verplaatsen</target>
</phrase>
<phrase>
<source> ; point turquoise : arc</source>
<target>; turquoise punt: boog</target>
</phrase>
<phrase>
<source> ; un bord : inclinaison</source>
<target>; een rand: kanteling</target>
</phrase>
<phrase>
<source> °</source>
<target>°</target>
</phrase>
<phrase>
<source> — Cliquer : mode %1</source>
<target>— Klikken: modus %1</target>
</phrase>
<phrase>
<source>, Alt = créer des poignées</source>
<target>, Alt = handgrepen creëren</target>
</phrase>
<phrase>
<source>, Alt = détacher en polyligne</source>
<target>, Alt = losmaken als polylijn</target>
</phrase>
<phrase>
<source>Ajoute une courbe de Bézier sur le folio actuel</source>
<target>Voegt een Béziercurve toe op het huidige blad</target>
</phrase>
<phrase>
<source>Ajouter la borne %1</source>
<target>Klem %1 toevoegen</target>
</phrase>
<phrase>
<source>Ajouter un point à une courbe</source>
<target>Een punt aan een curve toevoegen</target>
</phrase>
<phrase>
<source>Ajouter une courbe</source>
<target>Een curve toevoegen</target>
</phrase>
<phrase>
<source>Angle</source>
<target>Hoek</target>
</phrase>
<phrase>
<source>Anguleux</source>
<target>Hoekig</target>
</phrase>
<phrase>
<source>Aperçu</source>
<target>Voorbeeld</target>
</phrase>
<phrase>
<source>Arrondir les coins d&apos;%1</source>
<target>Hoeken van %1 afronden</target>
</phrase>
<phrase>
<source>Borne 1</source>
<target>Klem 1</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Borne 2</source>
<target>Klem 2</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Catégorie</source>
<target>Categorie</target>
</phrase>
<phrase>
<source>Ce format ne prend pas en charge la transparence : l&apos;image sera enregistrée telle qu&apos;elle était avant l&apos;application de la couleur transparente. Continuer ?</source>
<target>Dit formaat ondersteunt geen transparantie: de afbeelding wordt opgeslagen zoals ze was vóór het toepassen van de transparante kleur. Doorgaan?</target>
</phrase>
<phrase>
<source>Champ de texte</source>
<target>Tekstveld</target>
</phrase>
<phrase>
<source>Clic : positionner à la taille d&apos;origine. Cliquer-glisser : positionner et redimensionner. Clic droit : pivoter de 90°. Ctrl+molette : ajuster la taille.</source>
<target>Klik: op oorspronkelijke grootte plaatsen. Klikken en slepen: plaatsen en formaat wijzigen. Rechtsklik: 90° draaien. Ctrl+muiswiel: formaat aanpassen.</target>
</phrase>
<phrase>
<source>Clic gauche : point suivant ; double-clic ou Entrée : terminer ; clic droit : annuler le dernier point</source>
<target>Linkerklik: volgend punt; dubbelklik of Enter: beëindigen; rechtsklik: laatste punt annuleren</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le coin opposé (Maj = carré, Ctrl = depuis le centre + position libre, Ctrl+Maj = carré centré) ; clic droit : annuler</source>
<target>Linkerklik: tegenoverliggende hoek plaatsen (Shift = vierkant, Ctrl = vanuit het midden + vrije positie, Ctrl+Shift = gecentreerd vierkant); rechtsklik: annuleren</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le coin opposé (Maj = cercle, Ctrl = depuis le centre + position libre, Ctrl+Maj = cercle centré) ; clic droit : annuler</source>
<target>Linkerklik: tegenoverliggende hoek plaatsen (Shift = cirkel, Ctrl = vanuit het midden + vrije positie, Ctrl+Shift = gecentreerde cirkel); rechtsklik: annuleren</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le point de départ (Ctrl = position libre)</source>
<target>Linkerklik: startpunt plaatsen (Ctrl = vrije positie)</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le point final (Ctrl = position libre) ; clic droit : annuler</source>
<target>Linkerklik: eindpunt plaatsen (Ctrl = vrije positie); rechtsklik: annuleren</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le premier coin (Ctrl = point central, position libre)</source>
<target>Linkerklik: eerste hoek plaatsen (Ctrl = middelpunt, vrije positie)</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le premier point (Ctrl = position libre)</source>
<target>Linkerklik: eerste punt plaatsen (Ctrl = vrije positie)</target>
</phrase>
<phrase>
<source>Clic: point anguleux. Cliquer-glisser: point courbe. Clic sur le premier point: fermer. Échap/Entrée: terminer. Clic droit: annuler le dernier point.</source>
<target>Klik: hoekpunt. Klikken en slepen: curvepunt. Klik op het eerste punt: sluiten. Esc/Enter: beëindigen. Rechtsklik: laatste punt annuleren.</target>
</phrase>
<phrase>
<source>Cliquer</source>
<target>Klikken</target>
</phrase>
<phrase>
<source>Cliquer : mode %1</source>
<target>Klikken: modus %1</target>
</phrase>
<phrase>
<source>Cliquez pour choisir une couleur</source>
<target>Klik om een kleur te kiezen</target>
</phrase>
<phrase>
<source>Cliquez sur l&apos;image pour ajouter une couleur. Ajustez la tolérance de chaque couleur avec son curseur, ou cliquez sur × pour la retirer.</source>
<target>Klik op de afbeelding om een kleur toe te voegen. Pas de tolerantie van elke kleur aan met de schuifregelaar, of klik op × om ze te verwijderen.</target>
</phrase>
<phrase>
<source>Cliquez sur l&apos;image pour choisir une couleur</source>
<target>Klik op de afbeelding om een kleur te kiezen</target>
</phrase>
<phrase>
<source>Coins arrondis</source>
<target>Afgeronde hoeken</target>
</phrase>
<phrase>
<source>Composant 1</source>
<target>Component 1</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Composant 2</source>
<target>Component 2</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Convertir %1 en courbe de Bézier</source>
<target>%1 omzetten naar Béziercurve</target>
</phrase>
<phrase>
<source>Convertir %1 en polyligne</source>
<target>%1 omzetten naar polylijn</target>
</phrase>
<phrase>
<source>Convertir en courbe de Bézier</source>
<target>Omzetten naar Béziercurve</target>
</phrase>
<phrase>
<source>Convertir en polyligne</source>
<target>Omzetten naar polylijn</target>
</phrase>
<phrase>
<source>Couleur transparente</source>
<target>Transparante kleur</target>
</phrase>
<phrase>
<source>Couleur transparente...</source>
<target>Transparante kleur...</target>
</phrase>
<phrase>
<source>Courant nominal</source>
<target>Nominale stroom</target>
</phrase>
<phrase>
<source>Deplacer le centre de rotation</source>
<target>Draaipunt verplaatsen</target>
</phrase>
<phrase>
<source>Description</source>
<target>Beschrijving</target>
</phrase>
<phrase>
<source>Distance in pixels between the label and the slave cross reference</source>
<target>Afstand in pixels tussen het label en de slave-kruisverwijzing</target>
</phrase>
<phrase>
<source>Distance label - slave :</source>
<target>Afstand label - slave:</target>
</phrase>
<phrase>
<source>Définir une couleur transparente</source>
<target>Een transparante kleur instellen</target>
</phrase>
<phrase>
<source>Déformer une courbe</source>
<target>Een curve vervormen</target>
</phrase>
<phrase>
<source>Déplacer le centre de rotation d&apos;une image</source>
<target>Het draaipunt van een afbeelding verplaatsen</target>
</phrase>
<phrase>
<source>Déverrouillé : largeur et hauteur peuvent être modifiées indépendamment. Cliquer pour verrouiller.</source>
<target>Ontgrendeld: breedte en hoogte kunnen onafhankelijk worden gewijzigd. Klik om te vergrendelen.</target>
</phrase>
<phrase>
<source>Enregistrer l&apos;image d&apos;origine sous...</source>
<target>Oorspronkelijke afbeelding opslaan als...</target>
</phrase>
<phrase>
<source>Enregistrer l&apos;image sous...</source>
<target>Afbeelding opslaan als...</target>
</phrase>
<phrase>
<source>Erreur</source>
<target>Fout</target>
</phrase>
<phrase>
<source>Exclure de la nomenclature</source>
<target>Uitsluiten van de stuklijst</target>
</phrase>
<phrase>
<source>Faire pivoter %1</source>
<target>%1 roteren</target>
</phrase>
<phrase>
<source>Faire pivoter une image</source>
<target>Een afbeelding draaien</target>
</phrase>
<phrase>
<source>Faites glisser les poignées, ou l&apos;intérieur du cadre, pour ajuster la zone à conserver.</source>
<target>Sleep de handgrepen, of het binnenste van het kader, om het te behouden gebied aan te passen.</target>
</phrase>
<phrase>
<source>Fil</source>
<target>Draad</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Folio</source>
<target>Blad</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Forme fermée</source>
<target>Gesloten vorm</target>
</phrase>
<phrase>
<source>Glisser %1 : rotation (Maj = 15°)</source>
<target>Sleep %1: rotatie (Shift = 15°)</target>
</phrase>
<phrase>
<source>Glisser : ajuster l&apos;arc (Ctrl = position libre, Maj = 15°)</source>
<target>Slepen: de boog aanpassen (Ctrl = vrije positie, Shift = 15°)</target>
</phrase>
<phrase>
<source>Glisser : arrondir les coins (Ctrl = position libre)</source>
<target>Slepen: hoeken afronden (Ctrl = vrije positie)</target>
</phrase>
<phrase>
<source>Glisser : déformer la courbe (Ctrl = position libre, Alt = briser la tangente)</source>
<target>Slepen: de curve vervormen (Ctrl = vrije positie, Alt = de raaklijn breken)</target>
</phrase>
<phrase>
<source>Glisser : déplacer ce point</source>
<target>Slepen: dit punt verplaatsen</target>
</phrase>
<phrase>
<source>Glisser : déplacer le centre de rotation</source>
<target>Slepen: draaipunt verplaatsen</target>
</phrase>
<phrase>
<source>Glisser : déplacer le point (Ctrl = position libre</source>
<target>Slepen: het punt verplaatsen (Ctrl = vrije positie</target>
</phrase>
<phrase>
<source>Glisser : inclinaison (Ctrl = position libre, Maj = 15°)</source>
<target>Slepen: kanteling (Ctrl = vrije positie, Shift = 15°)</target>
</phrase>
<phrase>
<source>Glisser : incliner (Maj = par pas de 15°)</source>
<target>Slepen: kantelen (Shift = stappen van 15°)</target>
</phrase>
<phrase>
<source>Glisser : pivoter (Maj = par pas de 15°)</source>
<target>Slepen: draaien (Shift = stappen van 15°)</target>
</phrase>
<phrase>
<source>Glisser : redimensionner (Ctrl = depuis le centre + position libre, Maj = proportions</source>
<target>Slepen: formaat wijzigen (Ctrl = vanuit het midden + vrije positie, Shift = verhoudingen</target>
</phrase>
<phrase>
<source>Glisser : redimensionner (Maj = conserver les proportions, Ctrl = depuis le centre)</source>
<target>Slepen: formaat wijzigen (Shift = verhoudingen behouden, Ctrl = vanuit het midden)</target>
</phrase>
<phrase>
<source>Glisser : repositionner le centre de rotation (Ctrl = position libre)</source>
<target>Slepen: het draaipunt verplaatsen (Ctrl = vrije positie)</target>
</phrase>
<phrase>
<source>Glisser : rotation (Ctrl = position libre, Maj = 15°)</source>
<target>Slepen: rotatie (Ctrl = vrije positie, Shift = 15°)</target>
</phrase>
<phrase>
<source>Glisser le point violet : arrondir les coins</source>
<target>Sleep het paarse punt: hoeken afronden</target>
</phrase>
<phrase>
<source>Glisser un coin : pivoter (Maj = par pas de 15°) ; glisser un bord : incliner (Maj = par pas de 15°) ; point rouge : déplacer le centre de rotation</source>
<target>Sleep een hoek: draaien (Shift = stappen van 15°); sleep een rand: kantelen (Shift = stappen van 15°); rood punt: draaipunt verplaatsen</target>
</phrase>
<phrase>
<source>Glisser un coin/bord : redimensionner (Ctrl = depuis le centre, Maj = conserver les proportions)</source>
<target>Sleep een hoek/rand: formaat wijzigen (Ctrl = vanuit het midden, Shift = verhoudingen behouden)</target>
</phrase>
<phrase>
<source>Glisser un coin/bord : redimensionner (Ctrl = depuis le centre, Maj = proportions, Alt = détacher en polyligne)</source>
<target>Sleep een hoek/rand: formaat wijzigen (Ctrl = vanuit het midden, Shift = verhoudingen, Alt = losmaken als polylijn)</target>
</phrase>
<phrase>
<source>Glisser un point : le déplacer</source>
<target>Sleep een punt: het verplaatsen</target>
</phrase>
<phrase>
<source>Glisser une extrémité : la déplacer</source>
<target>Sleep een uiteinde: het verplaatsen</target>
</phrase>
<phrase>
<source>Glisser une poignée ou la courbe : déformer (Alt = briser la tangente) ; Alt+glisser un point anguleux : créer des poignées ; clic droit : menu du nœud le plus proche</source>
<target>Sleep een handgreep of de curve: vervormen (Alt = de raaklijn breken); Alt+sleep een hoekpunt: handgrepen creëren; rechtsklik: menu van het dichtstbijzijnde knooppunt</target>
</phrase>
<phrase>
<source>Géométrie</source>
<target>Geometrie</target>
</phrase>
<phrase>
<source>Hauteur</source>
<target>Hoogte</target>
</phrase>
<phrase>
<source>Image BMP (*.bmp)</source>
<target>BMP-afbeelding (*.bmp)</target>
</phrase>
<phrase>
<source>Image Files (*.png *.jpg *.jpeg *.bmp *.svg)</source>
<target>Afbeeldingsbestanden (*.png *.jpg *.jpeg *.bmp *.svg)</target>
</phrase>
<phrase>
<source>Image JPEG (*.jpg *.jpeg)</source>
<target>JPEG-afbeelding (*.jpg *.jpeg)</target>
</phrase>
<phrase>
<source>Image PNG (*.png)</source>
<target>PNG-afbeelding (*.png)</target>
</phrase>
<phrase>
<source>Image source</source>
<target>Bronafbeelding</target>
</phrase>
<phrase>
<source>Image SVG (*.svg)</source>
<target>SVG-afbeelding (*.svg)</target>
</phrase>
<phrase>
<source>Images non incluses dans l&apos;export DXF</source>
<target>Afbeeldingen niet inbegrepen in de DXF-export</target>
<definition>message box title</definition>
</phrase>
<phrase>
<source>Impossible d&apos;enregistrer l&apos;image à cet emplacement.</source>
<target>Kan de afbeelding niet op die locatie opslaan.</target>
</phrase>
<phrase>
<source>Impossible d&apos;enregistrer la nomenclature dans %1.
%2</source>
<target>Kan de stuklijst niet opslaan in %1.
%2</target>
</phrase>
<phrase>
<source>Impossible de charger l&apos;image.</source>
<target>Kan de afbeelding niet laden.</target>
</phrase>
<phrase>
<source>Inclinaison X</source>
<target>Kanteling X</target>
</phrase>
<phrase>
<source>Inclinaison Y</source>
<target>Kanteling Y</target>
</phrase>
<phrase>
<source>Incliner %1</source>
<target>%1 kantelen</target>
</phrase>
<phrase>
<source>Incliner une image</source>
<target>Een afbeelding kantelen</target>
</phrase>
<phrase>
<source>La limite fixée pour cet élément maître est atteinte (Limite: %1).
Voulez-vous tout de même lier ce contact esclave ?</source>
<target>De limiet voor dit hoofdelement is bereikt (Limiet: %1).
Wilt u dit hulpcontact toch koppelen?</target>
</phrase>
<phrase>
<source>Largeur</source>
<target>Breedte</target>
</phrase>
<phrase>
<source>Le format DXF utilisé ici (AC1006) ne permet pas d&apos;inclure d&apos;image. Les images seront représentées uniquement par un rectangle de contour (position, taille, rotation et inclinaison conservées), sans le contenu de l&apos;image.</source>
<target>Het hier gebruikte DXF-formaat (AC1006) laat niet toe afbeeldingen op te nemen. Afbeeldingen worden enkel voorgesteld door een omtrekrechthoek (positie, grootte, rotatie en kanteling behouden), zonder de inhoud van de afbeelding.</target>
<definition>message box content</definition>
</phrase>
<phrase>
<source>Lisse</source>
<target>Vloeiend</target>
</phrase>
<phrase>
<source>Liste de câblage</source>
<target>Bekabelingslijst</target>
<definition>window title</definition>
</phrase>
<phrase>
<source>Liste de câblage (base de données)</source>
<target>Bekabelingslijst (database)</target>
</phrase>
<phrase>
<source>Localisation :</source>
<target>Locatie:</target>
</phrase>
<phrase>
<source>Longueur</source>
<target>Lengte</target>
</phrase>
<phrase>
<source>margin: 5px; font-weight: bold;</source>
<target>margin: 5px; font-weight: bold;</target>
</phrase>
<phrase>
<source>max:</source>
<target>max:</target>
</phrase>
<phrase>
<source>min:</source>
<target>min:</target>
</phrase>
<phrase>
<source>Miroir horizontal</source>
<target>Horizontaal spiegelen</target>
</phrase>
<phrase>
<source>Miroir horizontal d&apos;une image</source>
<target>Horizontaal spiegelen van een afbeelding</target>
</phrase>
<phrase>
<source>Miroir horizontal de %1</source>
<target>Horizontaal spiegelen van %1</target>
</phrase>
<phrase>
<source>Miroir impossible : inclinaison trop extrême pour cette forme</source>
<target>Spiegelen onmogelijk: kanteling te extreem voor deze vorm</target>
</phrase>
<phrase>
<source>Miroir vertical</source>
<target>Verticaal spiegelen</target>
</phrase>
<phrase>
<source>Miroir vertical d&apos;une image</source>
<target>Verticaal spiegelen van een afbeelding</target>
</phrase>
<phrase>
<source>Miroir vertical de %1</source>
<target>Verticaal spiegelen van %1</target>
</phrase>
<phrase>
<source>Modifier l&apos;angle d&apos;un arc</source>
<target>Hoek van een boog wijzigen</target>
</phrase>
<phrase>
<source>Modifier l&apos;angle d&apos;une forme</source>
<target>Hoek van een vorm wijzigen</target>
</phrase>
<phrase>
<source>Modifier l&apos;angle d&apos;une image</source>
<target>De hoek van een afbeelding wijzigen</target>
</phrase>
<phrase>
<source>Modifier l&apos;inclinaison d&apos;une image</source>
<target>De kanteling van een afbeelding wijzigen</target>
</phrase>
<phrase>
<source>Modifier la courbure d&apos;%1</source>
<target>Kromming van %1 wijzigen</target>
</phrase>
<phrase>
<source>Modifier la forme d&apos;%1</source>
<target>Vorm van %1 wijzigen</target>
</phrase>
<phrase>
<source>Modifier la hauteur d&apos;une image</source>
<target>De hoogte van een afbeelding wijzigen</target>
</phrase>
<phrase>
<source>Modifier la largeur d&apos;une image</source>
<target>De breedte van een afbeelding wijzigen</target>
</phrase>
<phrase>
<source>Modifier la longueur d&apos;une ligne</source>
<target>Lengte van een lijn wijzigen</target>
</phrase>
<phrase>
<source>Modifier la taille d&apos;une forme</source>
<target>Grootte van een vorm wijzigen</target>
</phrase>
<phrase>
<source>Modifier le type d&apos;un nœud</source>
<target>Het type van een knooppunt wijzigen</target>
</phrase>
<phrase>
<source>Modifier une image</source>
<target>Een afbeelding wijzigen</target>
</phrase>
<phrase>
<source>Modèle</source>
<target>Model</target>
</phrase>
<phrase>
<source>Nombre maximum de contacts esclaves définis : non défini
</source>
<target>Maximumaantal gedefinieerde hulpcontacten: niet gedefinieerd
</target>
</phrase>
<phrase>
<source>Notes</source>
<target>Notities</target>
</phrase>
<phrase>
<source>Nœud le plus proche</source>
<target>Dichtstbijzijnde knooppunt</target>
</phrase>
<phrase>
<source>pivoter/incliner</source>
<target>draaien/kantelen</target>
</phrase>
<phrase>
<source>Ponter des bornes entre-elles</source>
<target>Klemmen onderling doorverbinden</target>
</phrase>
<phrase>
<source>Rayon X</source>
<target>Straal X</target>
</phrase>
<phrase>
<source>Rayon Y</source>
<target>Straal Y</target>
</phrase>
<phrase>
<source>redimensionner</source>
<target>formaat wijzigen</target>
</phrase>
<phrase>
<source>Redimensionner %1</source>
<target>%1 vergroten/verkleinen</target>
</phrase>
<phrase>
<source>Redimensionner une image</source>
<target>Formaat van een afbeelding wijzigen</target>
</phrase>
<phrase>
<source>Remplacer l&apos;image...</source>
<target>Afbeelding vervangen...</target>
</phrase>
<phrase>
<source>Remplacer une image</source>
<target>Een afbeelding vervangen</target>
</phrase>
<phrase>
<source>Restaurer les proportions</source>
<target>Verhoudingen herstellen</target>
</phrase>
<phrase>
<source>Restaurer les proportions d&apos;une image</source>
<target>De verhoudingen van een afbeelding herstellen</target>
</phrase>
<phrase>
<source>Retirer cette couleur</source>
<target>Deze kleur verwijderen</target>
</phrase>
<phrase>
<source>Revenir à l&apos;image complète, sans rognage</source>
<target>Terug naar de volledige afbeelding, zonder bijsnijden</target>
</phrase>
<phrase>
<source>rgb(%1, %2, %3)</source>
<target>rgb(%1, %2, %3)</target>
</phrase>
<phrase>
<source>Rogner l&apos;image</source>
<target>Afbeelding bijsnijden</target>
</phrase>
<phrase>
<source>Rogner une image</source>
<target>Een afbeelding bijsnijden</target>
</phrase>
<phrase>
<source>Rogner...</source>
<target>Bijsnijden...</target>
</phrase>
<phrase>
<source>Rotation/Inclinaison</source>
<target>Rotatie/kanteling</target>
</phrase>
<phrase>
<source>Réinitialiser</source>
<target>Herinitialiseren</target>
</phrase>
<phrase>
<source>Selectionner une image...</source>
<target>Een afbeelding selecteren...</target>
</phrase>
<phrase>
<source>Supprimer le nœud le plus proche</source>
<target>Het dichtstbijzijnde knooppunt verwijderen</target>
</phrase>
<phrase>
<source>Supprimer un point d&apos;une courbe</source>
<target>Een punt van een curve verwijderen</target>
</phrase>
<phrase>
<source>Symétrique</source>
<target>Symmetrisch</target>
</phrase>
<phrase>
<source>Séparation de potentiel</source>
<target>Potentiaalscheiding</target>
</phrase>
<phrase>
<source>Taille</source>
<target>Grootte</target>
</phrase>
<phrase>
<source>Tension nominale</source>
<target>Nominale spanning</target>
</phrase>
<phrase>
<source>Tolérance pour cette couleur</source>
<target>Tolerantie voor deze kleur</target>
</phrase>
<phrase>
<source>Tous les fichiers (*)</source>
<target>Alle bestanden (*)</target>
</phrase>
<phrase>
<source>Transformer %1</source>
<target>%1 omvormen</target>
</phrase>
<phrase>
<source>Transparence non conservée</source>
<target>Transparantie niet behouden</target>
</phrase>
<phrase>
<source>un arc</source>
<target>een boog</target>
</phrase>
<phrase>
<source>un coin</source>
<target>een hoek</target>
</phrase>
<phrase>
<source>un point</source>
<target>een punt</target>
</phrase>
<phrase>
<source>une courbe</source>
<target>een curve</target>
</phrase>
<phrase>
<source>une extrémité</source>
<target>een uiteinde</target>
</phrase>
<phrase>
<source>une image</source>
<target>een afbeelding</target>
<definition>part of a sentence listing the content of a diagram</definition>
</phrase>
<phrase>
<source>Verrouiller la numérotation automatique</source>
<target>Automatische nummering vergrendelen</target>
</phrase>
<phrase>
<source>Verrouiller la position</source>
<target>Positie vergrendelen</target>
</phrase>
<phrase>
<source>Verrouillé : modifier la largeur ou la hauteur ajuste l&apos;autre pour conserver les proportions. Cliquer pour déverrouiller.</source>
<target>Vergrendeld: het wijzigen van de breedte of hoogte past de andere aan om de verhoudingen te behouden. Klik om te ontgrendelen.</target>
</phrase>
<phrase>
<source>Échec de l&apos;enregistrement</source>
<target>Opslaan mislukt</target>
</phrase>
<phrase>
<source>Édition des nœuds</source>
<target>Knooppunten bewerken</target>
</phrase>
<phrase>
<source>armoire</source>
<target>kast</target>
<definition>cabinet / enclosure</definition>
</phrase>
<phrase>
<source>bobine</source>
<target>spoel</target>
<definition>coil</definition>
</phrase>
<phrase>
<source>borne</source>
<target>klem</target>
<definition>terminal - a connection point on a symbol</definition>
</phrase>
<phrase>
<source>bornier</source>
<target>klemmenstrook</target>
<definition>terminal strip</definition>
</phrase>
<phrase>
<source>cable</source>
<target>kabel</target>
<definition>cable</definition>
</phrase>
<phrase>
<source>calibre</source>
<target>kaliber</target>
<definition>rating - the current rating of a device</definition>
</phrase>
<phrase>
<source>cartouche</source>
<target>titelblok</target>
<definition>title block - the framed information panel</definition>
</phrase>
<phrase>
<source>collection</source>
<target>collectie</target>
<definition>collection - the symbol library</definition>
</phrase>
<phrase>
<source>conducteur</source>
<target>geleider</target>
<definition>conductor - the drawn wire between terminals</definition>
</phrase>
<phrase>
<source>contact</source>
<target>contact</target>
<definition>contact</definition>
</phrase>
<phrase>
<source>contacteur</source>
<target>contacteur</target>
<definition>contactor</definition>
</phrase>
<phrase>
<source>courant</source>
<target>stroom</target>
<definition>current</definition>
</phrase>
<phrase>
<source>disjoncteur</source>
<target>automaat</target>
<definition>circuit breaker</definition>
</phrase>
<phrase>
<source>dossier</source>
<target>map</target>
<definition>folder</definition>
</phrase>
<phrase>
<source>element</source>
<target>element</target>
<definition>element - a symbol placed on a sheet</definition>
</phrase>
<phrase>
<source>esclave</source>
<target>hulpcontact</target>
<definition>slave - the contact block belonging to a master</definition>
</phrase>
<phrase>
<source>fusible</source>
<target>zekering</target>
<definition>fuse</definition>
</phrase>
<phrase>
<source>grille</source>
<target>raster</target>
<definition>grid</definition>
</phrase>
<phrase>
<source>interrupteur</source>
<target>schakelaar</target>
<definition>switch</definition>
</phrase>
<phrase>
<source>maitre</source>
<target>hoofd</target>
<definition>master - the element a cross-reference points from</definition>
</phrase>
<phrase>
<source>modele</source>
<target>sjabloon</target>
<definition>template</definition>
</phrase>
<phrase>
<source>moteur</source>
<target>motor</target>
<definition>motor</definition>
</phrase>
<phrase>
<source>neutre</source>
<target>nul</target>
<definition>neutral</definition>
</phrase>
<phrase>
<source>nomenclature</source>
<target>stuklijst</target>
<definition>parts list / bill of materials</definition>
</phrase>
<phrase>
<source>numerotation</source>
<target>nummering</target>
<definition>numbering - automatic wire and part numbering</definition>
</phrase>
<phrase>
<source>phase</source>
<target>fase</target>
<definition>phase</definition>
</phrase>
<phrase>
<source>potentiel</source>
<target>potentiaal</target>
<definition>potential - conductors electrically joined as one node</definition>
</phrase>
<phrase>
<source>projet</source>
<target>project</target>
<definition>project - the .qet file holding the sheets</definition>
</phrase>
<phrase>
<source>puissance</source>
<target>vermogen</target>
<definition>power</definition>
</phrase>
<phrase>
<source>relais</source>
<target>relais</target>
<definition>relay</definition>
</phrase>
<phrase>
<source>renvoi de folio</source>
<target>bladverwijzing</target>
<definition>sheet cross-reference</definition>
</phrase>
<phrase>
<source>repere</source>
<target>aanduiding</target>
<definition>designation - the identifying mark on a part</definition>
</phrase>
<phrase>
<source>report de folio</source>
<target>bladverwijzing</target>
<definition>sheet cross-reference (the arrow symbol)</definition>
</phrase>
<phrase>
<source>schema</source>
<target>schema</target>
<definition>diagram</definition>
</phrase>
<phrase>
<source>section</source>
<target>doorsnede</target>
<definition>cross-section - conductor size in mm2</definition>
</phrase>
<phrase>
<source>sommaire</source>
<target>inhoudstafel</target>
<definition>summary / table of contents</definition>
</phrase>
<phrase>
<source>tension</source>
<target>spanning</target>
<definition>voltage</definition>
</phrase>
<phrase>
<source>terre</source>
<target>aarde</target>
<definition>earth / ground</definition>
</phrase>
<phrase>
<source>texte</source>
<target>tekst</target>
<definition>text</definition>
</phrase>
<phrase>
<source>transformateur</source>
<target>transformator</target>
<definition>transformer</definition>
</phrase>
</QPH>
+218
View File
@@ -0,0 +1,218 @@
<!DOCTYPE QPH>
<QPH sourcelanguage="fr_FR" language="pl">
<phrase>
<source>armoire</source>
<target>Szafa</target>
<definition>cabinet / enclosure</definition>
</phrase>
<phrase>
<source>bobine</source>
<target>Cewka</target>
<definition>coil</definition>
</phrase>
<phrase>
<source>borne</source>
<target>Zacisk</target>
<definition>terminal - a connection point on a symbol</definition>
</phrase>
<phrase>
<source>bornier</source>
<target>Listwa zaciskowa</target>
<definition>terminal strip</definition>
</phrase>
<phrase>
<source>cable</source>
<target>Kabel</target>
<definition>cable</definition>
</phrase>
<phrase>
<source>calibre</source>
<target>Prąd znamionowy</target>
<definition>rating - the current rating of a device</definition>
</phrase>
<phrase>
<source>cartouche</source>
<target>Tabliczka rysunkowa</target>
<definition>title block - the framed information panel</definition>
</phrase>
<phrase>
<source>champ de texte</source>
<target>Pole tekstowe</target>
<definition>text field</definition>
</phrase>
<phrase>
<source>collection</source>
<target>Biblioteka</target>
<definition>collection - the symbol library</definition>
</phrase>
<phrase>
<source>conducteur</source>
<target>Przewód</target>
<definition>conductor - the drawn wire between terminals</definition>
</phrase>
<phrase>
<source>contact</source>
<target>Styk</target>
<definition>contact</definition>
</phrase>
<phrase>
<source>contacteur</source>
<target>Stycznik</target>
<definition>contactor</definition>
</phrase>
<phrase>
<source>courant</source>
<target>Prąd</target>
<definition>current</definition>
</phrase>
<phrase>
<source>disjoncteur</source>
<target>Wyłącznik nadprądowy</target>
<definition>circuit breaker</definition>
</phrase>
<phrase>
<source>dossier</source>
<target>Folder</target>
<definition>folder</definition>
</phrase>
<phrase>
<source>element</source>
<target>Element</target>
<definition>element - a symbol placed on a sheet</definition>
</phrase>
<phrase>
<source>esclave</source>
<target>Element podrzędny</target>
<definition>slave - the contact block belonging to a master</definition>
</phrase>
<phrase>
<source>fil</source>
<target>Przewód</target>
<definition>wire</definition>
</phrase>
<phrase>
<source>folio</source>
<target>Arkusz</target>
<definition>sheet - one drawing of a set</definition>
</phrase>
<phrase>
<source>fusible</source>
<target>Bezpiecznik</target>
<definition>fuse</definition>
</phrase>
<phrase>
<source>grille</source>
<target>Siatka</target>
<definition>grid</definition>
</phrase>
<phrase>
<source>interrupteur</source>
<target>Wyłącznik</target>
<definition>switch</definition>
</phrase>
<phrase>
<source>maitre</source>
<target>Element główny</target>
<definition>master - the element a cross-reference points from</definition>
</phrase>
<phrase>
<source>modele</source>
<target>Szablon</target>
<definition>template</definition>
</phrase>
<phrase>
<source>moteur</source>
<target>Silnik</target>
<definition>motor</definition>
</phrase>
<phrase>
<source>neutre</source>
<target>Neutralny</target>
<definition>neutral</definition>
</phrase>
<phrase>
<source>nomenclature</source>
<target>Zestawienie materiałów</target>
<definition>parts list / bill of materials</definition>
</phrase>
<phrase>
<source>numerotation</source>
<target>Numeracja</target>
<definition>numbering - automatic wire and part numbering</definition>
</phrase>
<phrase>
<source>phase</source>
<target>Faza</target>
<definition>phase</definition>
</phrase>
<phrase>
<source>potentiel</source>
<target>Potencjał</target>
<definition>potential - conductors electrically joined as one node</definition>
</phrase>
<phrase>
<source>projet</source>
<target>Projekt</target>
<definition>project - the .qet file holding the sheets</definition>
</phrase>
<phrase>
<source>puissance</source>
<target>Moc</target>
<definition>power</definition>
</phrase>
<phrase>
<source>relais</source>
<target>Przekaźnik</target>
<definition>relay</definition>
</phrase>
<phrase>
<source>renvoi de folio</source>
<target>Odnośnik do arkusza</target>
<definition>sheet cross-reference</definition>
</phrase>
<phrase>
<source>repere</source>
<target>Oznaczenie</target>
<definition>designation - the identifying mark on a part</definition>
</phrase>
<phrase>
<source>report de folio</source>
<target>Odnośnik do arkusza</target>
<definition>sheet cross-reference (the arrow symbol)</definition>
</phrase>
<phrase>
<source>schema</source>
<target>Schemat</target>
<definition>diagram</definition>
</phrase>
<phrase>
<source>section</source>
<target>Przekrój</target>
<definition>cross-section - conductor size in mm2</definition>
</phrase>
<phrase>
<source>sommaire</source>
<target>Spis treści</target>
<definition>summary / table of contents</definition>
</phrase>
<phrase>
<source>tension</source>
<target>Napięcie</target>
<definition>voltage</definition>
</phrase>
<phrase>
<source>terre</source>
<target>Uziemienie</target>
<definition>earth / ground</definition>
</phrase>
<phrase>
<source>texte</source>
<target>Tekst</target>
<definition>text</definition>
</phrase>
<phrase>
<source>transformateur</source>
<target>Transformator</target>
<definition>transformer</definition>
</phrase>
</QPH>
File diff suppressed because it is too large Load Diff
+465
View File
@@ -0,0 +1,465 @@
<!DOCTYPE QPH>
<QPH sourcelanguage="fr_FR" language="pt_BR">
<phrase>
<source> Contacts : NO : %1, NC : %2, inverseurs : %3, autres : %4
</source>
<target>Contatos: NA: %1, NF: %2, reversíveis: %3, outros: %4
</target>
</phrase>
<phrase>
<source> Contacts : NO : %1/%2, NC : %3/%4, inverseurs : %5/%6, autres : %7/%8
</source>
<target>Contatos: NA: %1/%2, NF: %3/%4, reversíveis: %5/%6, outros: %7/%8
</target>
</phrase>
<phrase>
<source>Aperçu</source>
<target>Pré-visualização</target>
</phrase>
<phrase>
<source>Arrondir les coins d&apos;%1</source>
<target>Arredondar os cantos de %1</target>
</phrase>
<phrase>
<source>Borne 1</source>
<target>Borne 1</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Borne 2</source>
<target>Borne 2</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Catégorie</source>
<target>Categoria</target>
</phrase>
<phrase>
<source>Ce format ne prend pas en charge la transparence : l&apos;image sera enregistrée telle qu&apos;elle était avant l&apos;application de la couleur transparente. Continuer ?</source>
<target>Este formato não suporta transparência: a imagem será salva como estava antes da aplicação da cor transparente. Continuar?</target>
</phrase>
<phrase>
<source>Champ de texte</source>
<target>Campo de texto</target>
</phrase>
<phrase>
<source>Composant 1</source>
<target>Componente 1</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Composant 2</source>
<target>Componente 2</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Convertir %1 en courbe de Bézier</source>
<target>Converter %1 em curva de Bézier</target>
</phrase>
<phrase>
<source>Convertir en courbe de Bézier</source>
<target>Converter em curva de Bézier</target>
</phrase>
<phrase>
<source>Courant nominal</source>
<target>Corrente nominal</target>
</phrase>
<phrase>
<source>Distance in pixels between the label and the slave cross reference</source>
<target>Distância em pixels entre o rótulo e a referência cruzada do escravo</target>
</phrase>
<phrase>
<source>Distance label - slave :</source>
<target>Distância do rótulo - escravo:</target>
</phrase>
<phrase>
<source>Enregistrer l&apos;image d&apos;origine sous...</source>
<target>Salvar a imagem original como...</target>
</phrase>
<phrase>
<source>Enregistrer l&apos;image sous...</source>
<target>Salvar a imagem como...</target>
</phrase>
<phrase>
<source>Erreur</source>
<target>Erro</target>
</phrase>
<phrase>
<source>Exclure de la nomenclature</source>
<target>Excluir da lista de materiais</target>
</phrase>
<phrase>
<source>Faire pivoter %1</source>
<target>Girar %1</target>
</phrase>
<phrase>
<source>Faire pivoter une image</source>
<target>Girar uma imagem</target>
</phrase>
<phrase>
<source>Fil</source>
<target>Fio</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Folio</source>
<target>Folha</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Hauteur</source>
<target>Altura</target>
</phrase>
<phrase>
<source>Image BMP (*.bmp)</source>
<target>Imagem BMP (*.bmp)</target>
</phrase>
<phrase>
<source>Image JPEG (*.jpg *.jpeg)</source>
<target>Imagem JPEG (*.jpg *.jpeg)</target>
</phrase>
<phrase>
<source>Image PNG (*.png)</source>
<target>Imagem PNG (*.png)</target>
</phrase>
<phrase>
<source>Image SVG (*.svg)</source>
<target>Imagem SVG (*.svg)</target>
</phrase>
<phrase>
<source>Images non incluses dans l&apos;export DXF</source>
<target>Imagens não incluídas na exportação DXF</target>
<definition>message box title</definition>
</phrase>
<phrase>
<source>Impossible d&apos;enregistrer l&apos;image à cet emplacement.</source>
<target>Não foi possível salvar a imagem neste local.</target>
</phrase>
<phrase>
<source>Impossible d&apos;enregistrer la nomenclature dans %1.
%2</source>
<target>Não foi possível salvar a lista de materiais em %1.
%2</target>
</phrase>
<phrase>
<source>Impossible de charger l&apos;image.</source>
<target>Não foi possível carregar a imagem.</target>
</phrase>
<phrase>
<source>Incliner %1</source>
<target>Inclinar %1</target>
</phrase>
<phrase>
<source>Incliner une image</source>
<target>Inclinar uma imagem</target>
</phrase>
<phrase>
<source>La limite fixée pour cet élément maître est atteinte (Limite: %1).
Voulez-vous tout de même lier ce contact esclave ?</source>
<target>O limite definido para este elemento mestre foi atingido (Limite: %1).
Deseja vincular este contato escravo mesmo assim?</target>
</phrase>
<phrase>
<source>Largeur</source>
<target>Largura</target>
</phrase>
<phrase>
<source>Le format DXF utilisé ici (AC1006) ne permet pas d&apos;inclure d&apos;image. Les images seront représentées uniquement par un rectangle de contour (position, taille, rotation et inclinaison conservées), sans le contenu de l&apos;image.</source>
<target>O formato DXF usado aqui (AC1006) não permite incluir imagens. As imagens serão representadas apenas por um retângulo de contorno (posição, tamanho, rotação e inclinação preservados), sem o conteúdo da imagem.</target>
<definition>message box content</definition>
</phrase>
<phrase>
<source>Liste de câblage</source>
<target>Lista de cabeamento</target>
<definition>window title</definition>
</phrase>
<phrase>
<source>Liste de câblage (base de données)</source>
<target>Lista de cabeamento (banco de dados)</target>
</phrase>
<phrase>
<source>margin: 5px; font-weight: bold;</source>
<target>margin: 5px; font-weight: bold;</target>
</phrase>
<phrase>
<source>Modifier l&apos;angle d&apos;un arc</source>
<target>Modificar o ângulo de um arco</target>
</phrase>
<phrase>
<source>Modifier la courbure d&apos;%1</source>
<target>Modificar a curvatura de %1</target>
</phrase>
<phrase>
<source>Modifier la forme d&apos;%1</source>
<target>Modificar a forma de %1</target>
</phrase>
<phrase>
<source>Modèle</source>
<target>Modelo</target>
</phrase>
<phrase>
<source>Nombre maximum de contacts esclaves définis : non défini
</source>
<target>Número máximo de contatos escravos definidos: não definido
</target>
</phrase>
<phrase>
<source>Notes</source>
<target>Observações</target>
</phrase>
<phrase>
<source>Redimensionner %1</source>
<target>Redimensionar %1</target>
</phrase>
<phrase>
<source>Redimensionner une image</source>
<target>Redimensionar uma imagem</target>
</phrase>
<phrase>
<source>Réinitialiser</source>
<target>Redefinir</target>
</phrase>
<phrase>
<source>Selectionner une image...</source>
<target>Selecionar uma imagem...</target>
</phrase>
<phrase>
<source>Séparation de potentiel</source>
<target>Separação de potencial</target>
</phrase>
<phrase>
<source>Taille</source>
<target>Tamanho</target>
</phrase>
<phrase>
<source>Tension nominale</source>
<target>Tensão nominal</target>
</phrase>
<phrase>
<source>Tous les fichiers (*)</source>
<target>Todos os arquivos (*)</target>
</phrase>
<phrase>
<source>Transparence non conservée</source>
<target>Transparência não preservada</target>
</phrase>
<phrase>
<source>une image</source>
<target>uma imagem</target>
<definition>part of a sentence listing the content of a diagram</definition>
</phrase>
<phrase>
<source>Verrouiller la numérotation automatique</source>
<target>Bloquear a numeração automática</target>
</phrase>
<phrase>
<source>Verrouiller la position</source>
<target>Bloquear a posição</target>
</phrase>
<phrase>
<source>Échec de l&apos;enregistrement</source>
<target>Falha ao salvar</target>
</phrase>
<phrase>
<source>armoire</source>
<target>armário</target>
<definition>cabinet / enclosure</definition>
</phrase>
<phrase>
<source>bobine</source>
<target>bobina</target>
<definition>coil</definition>
</phrase>
<phrase>
<source>borne</source>
<target>borne</target>
<definition>terminal - a connection point on a symbol</definition>
</phrase>
<phrase>
<source>bornier</source>
<target>borneira</target>
<definition>terminal strip</definition>
</phrase>
<phrase>
<source>cable</source>
<target>cabo</target>
<definition>cable</definition>
</phrase>
<phrase>
<source>calibre</source>
<target>calibre</target>
<definition>rating - the current rating of a device</definition>
</phrase>
<phrase>
<source>cartouche</source>
<target>bloco de título</target>
<definition>title block - the framed information panel</definition>
</phrase>
<phrase>
<source>collection</source>
<target>coleção</target>
<definition>collection - the symbol library</definition>
</phrase>
<phrase>
<source>conducteur</source>
<target>condutor</target>
<definition>conductor - the drawn wire between terminals</definition>
</phrase>
<phrase>
<source>contact</source>
<target>contato</target>
<definition>contact</definition>
</phrase>
<phrase>
<source>contacteur</source>
<target>contator</target>
<definition>contactor</definition>
</phrase>
<phrase>
<source>courant</source>
<target>corrente</target>
<definition>current</definition>
</phrase>
<phrase>
<source>disjoncteur</source>
<target>disjuntor</target>
<definition>circuit breaker</definition>
</phrase>
<phrase>
<source>dossier</source>
<target>pasta</target>
<definition>folder</definition>
</phrase>
<phrase>
<source>element</source>
<target>elemento</target>
<definition>element - a symbol placed on a sheet</definition>
</phrase>
<phrase>
<source>esclave</source>
<target>escravo</target>
<definition>slave - the contact block belonging to a master</definition>
</phrase>
<phrase>
<source>fusible</source>
<target>fusível</target>
<definition>fuse</definition>
</phrase>
<phrase>
<source>grille</source>
<target>grade</target>
<definition>grid</definition>
</phrase>
<phrase>
<source>interrupteur</source>
<target>interruptor</target>
<definition>switch</definition>
</phrase>
<phrase>
<source>maitre</source>
<target>mestre</target>
<definition>master - the element a cross-reference points from</definition>
</phrase>
<phrase>
<source>modele</source>
<target>modelo</target>
<definition>template</definition>
</phrase>
<phrase>
<source>moteur</source>
<target>motor</target>
<definition>motor</definition>
</phrase>
<phrase>
<source>neutre</source>
<target>neutro</target>
<definition>neutral</definition>
</phrase>
<phrase>
<source>nomenclature</source>
<target>lista de materiais</target>
<definition>parts list / bill of materials</definition>
</phrase>
<phrase>
<source>numerotation</source>
<target>numeração</target>
<definition>numbering - automatic wire and part numbering</definition>
</phrase>
<phrase>
<source>phase</source>
<target>fase</target>
<definition>phase</definition>
</phrase>
<phrase>
<source>potentiel</source>
<target>potencial</target>
<definition>potential - conductors electrically joined as one node</definition>
</phrase>
<phrase>
<source>projet</source>
<target>projeto</target>
<definition>project - the .qet file holding the sheets</definition>
</phrase>
<phrase>
<source>puissance</source>
<target>potência</target>
<definition>power</definition>
</phrase>
<phrase>
<source>relais</source>
<target>relé</target>
<definition>relay</definition>
</phrase>
<phrase>
<source>renvoi de folio</source>
<target>referência de folha</target>
<definition>sheet cross-reference</definition>
</phrase>
<phrase>
<source>repere</source>
<target>designação</target>
<definition>designation - the identifying mark on a part</definition>
</phrase>
<phrase>
<source>report de folio</source>
<target>remissão de folha</target>
<definition>sheet cross-reference (the arrow symbol)</definition>
</phrase>
<phrase>
<source>schema</source>
<target>diagrama</target>
<definition>diagram</definition>
</phrase>
<phrase>
<source>section</source>
<target>seção</target>
<definition>cross-section - conductor size in mm2</definition>
</phrase>
<phrase>
<source>sommaire</source>
<target>sumário</target>
<definition>summary / table of contents</definition>
</phrase>
<phrase>
<source>tension</source>
<target>tensão</target>
<definition>voltage</definition>
</phrase>
<phrase>
<source>terre</source>
<target>terra</target>
<definition>earth / ground</definition>
</phrase>
<phrase>
<source>texte</source>
<target>texto</target>
<definition>text</definition>
</phrase>
<phrase>
<source>transformateur</source>
<target>transformador</target>
<definition>transformer</definition>
</phrase>
</QPH>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+917
View File
@@ -0,0 +1,917 @@
<!DOCTYPE QPH>
<QPH sourcelanguage="fr_FR" language="zh">
<phrase>
<source> Contacts : NO : %1, NC : %2, inverseurs : %3, autres : %4
</source>
<target>触点:常开:%1,常闭:%2,转换:%3,其他:%4
</target>
</phrase>
<phrase>
<source> Contacts : NO : %1/%2, NC : %3/%4, inverseurs : %5/%6, autres : %7/%8
</source>
<target>触点:常开:%1/%2,常闭:%3/%4,转换:%5/%6,其他:%7/%8
</target>
</phrase>
<phrase>
<source> %</source>
<target>%</target>
</phrase>
<phrase>
<source> (Ctrl pendant le glissement = position libre, sans accrochage à la grille)</source>
<target>(拖动时按 Ctrl = 自由位置,不吸附到网格)</target>
</phrase>
<phrase>
<source> -- %1 : mode %2</source>
<target>-- %1:%2 模式</target>
</phrase>
<phrase>
<source> ; point rouge : glisser pour repositionner le centre de rotation</source>
<target>;红点:拖动以重新定位旋转中心</target>
</phrase>
<phrase>
<source> ; point turquoise : arc</source>
<target>;青色点:圆弧</target>
</phrase>
<phrase>
<source> ; un bord : inclinaison</source>
<target>;边:倾斜</target>
</phrase>
<phrase>
<source> °</source>
<target>°</target>
</phrase>
<phrase>
<source> — Cliquer : mode %1</source>
<target>— 单击:%1 模式</target>
</phrase>
<phrase>
<source>, Alt = créer des poignées</source>
<target>,Alt = 创建控制柄</target>
</phrase>
<phrase>
<source>, Alt = détacher en polyligne</source>
<target>,Alt = 分离为多段线</target>
</phrase>
<phrase>
<source>Ajoute une courbe de Bézier sur le folio actuel</source>
<target>在当前图纸上添加贝塞尔曲线</target>
</phrase>
<phrase>
<source>Ajouter un point à une courbe</source>
<target>向曲线添加点</target>
</phrase>
<phrase>
<source>Ajouter une courbe</source>
<target>添加曲线</target>
</phrase>
<phrase>
<source>Angle</source>
<target>角度</target>
</phrase>
<phrase>
<source>Anguleux</source>
<target>角点</target>
</phrase>
<phrase>
<source>Aperçu</source>
<target>预览</target>
</phrase>
<phrase>
<source>Arrondir les coins d&apos;%1</source>
<target>将%1的角变圆</target>
</phrase>
<phrase>
<source>Borne 1</source>
<target>端子1</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Borne 2</source>
<target>端子2</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Catégorie</source>
<target>类别</target>
</phrase>
<phrase>
<source>Ce format ne prend pas en charge la transparence : l&apos;image sera enregistrée telle qu&apos;elle était avant l&apos;application de la couleur transparente. Continuer ?</source>
<target>此格式不支持透明度:图像将按应用透明色之前的状态保存。是否继续?</target>
</phrase>
<phrase>
<source>Champ de texte</source>
<target>文本字段</target>
</phrase>
<phrase>
<source>Clic : positionner à la taille d&apos;origine. Cliquer-glisser : positionner et redimensionner. Clic droit : pivoter de 90°. Ctrl+molette : ajuster la taille.</source>
<target>单击:按原始尺寸放置。单击拖动:放置并调整大小。右键:旋转 90°。Ctrl+滚轮:调整大小。</target>
</phrase>
<phrase>
<source>Clic gauche : point suivant ; double-clic ou Entrée : terminer ; clic droit : annuler le dernier point</source>
<target>左键单击:下一个点;双击或 Enter:结束;右键单击:撤销上一个点</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le coin opposé (Maj = carré, Ctrl = depuis le centre + position libre, Ctrl+Maj = carré centré) ; clic droit : annuler</source>
<target>左键单击:放置对角(Shift = 正方形,Ctrl = 从中心 + 自由位置,Ctrl+Shift = 居中正方形);右键单击:取消</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le coin opposé (Maj = cercle, Ctrl = depuis le centre + position libre, Ctrl+Maj = cercle centré) ; clic droit : annuler</source>
<target>左键单击:放置对角(Shift = 圆形,Ctrl = 从中心 + 自由位置,Ctrl+Shift = 居中圆形);右键单击:取消</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le point de départ (Ctrl = position libre)</source>
<target>左键单击:放置起点(Ctrl = 自由位置)</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le point final (Ctrl = position libre) ; clic droit : annuler</source>
<target>左键单击:放置终点(Ctrl = 自由位置);右键单击:取消</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le premier coin (Ctrl = point central, position libre)</source>
<target>左键单击:放置第一个角(Ctrl = 中心点,自由位置)</target>
</phrase>
<phrase>
<source>Clic gauche : positionner le premier point (Ctrl = position libre)</source>
<target>左键单击:放置第一个点(Ctrl = 自由位置)</target>
</phrase>
<phrase>
<source>Clic: point anguleux. Cliquer-glisser: point courbe. Clic sur le premier point: fermer. Échap/Entrée: terminer. Clic droit: annuler le dernier point.</source>
<target>单击:角点。单击拖动:曲线点。单击第一个点:闭合。Esc/Enter:结束。右键:撤销上一个点。</target>
</phrase>
<phrase>
<source>Cliquer</source>
<target>单击</target>
</phrase>
<phrase>
<source>Cliquer : mode %1</source>
<target>单击:%1 模式</target>
</phrase>
<phrase>
<source>Cliquez pour choisir une couleur</source>
<target>点击选择颜色</target>
</phrase>
<phrase>
<source>Cliquez sur l&apos;image pour ajouter une couleur. Ajustez la tolérance de chaque couleur avec son curseur, ou cliquez sur × pour la retirer.</source>
<target>单击图像以添加颜色。使用滑块调整每种颜色的容差,或单击 × 将其移除。</target>
</phrase>
<phrase>
<source>Cliquez sur l&apos;image pour choisir une couleur</source>
<target>单击图像选择颜色</target>
</phrase>
<phrase>
<source>Coins arrondis</source>
<target>圆角</target>
</phrase>
<phrase>
<source>Composant 1</source>
<target>元件1</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Composant 2</source>
<target>元件2</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Convertir %1 en courbe de Bézier</source>
<target>将 %1 转换为贝塞尔曲线</target>
</phrase>
<phrase>
<source>Convertir %1 en polyligne</source>
<target>将 %1 转换为多段线</target>
</phrase>
<phrase>
<source>Convertir en courbe de Bézier</source>
<target>转换为贝塞尔曲线</target>
</phrase>
<phrase>
<source>Convertir en polyligne</source>
<target>转换为多段线</target>
</phrase>
<phrase>
<source>Couleur transparente</source>
<target>透明色</target>
</phrase>
<phrase>
<source>Couleur transparente...</source>
<target>透明色...</target>
</phrase>
<phrase>
<source>Courant nominal</source>
<target>额定电流</target>
</phrase>
<phrase>
<source>Deplacer le centre de rotation</source>
<target>移动旋转中心</target>
</phrase>
<phrase>
<source>Distance in pixels between the label and the slave cross reference</source>
<target>标签与从站交叉引用之间的像素距离</target>
</phrase>
<phrase>
<source>Distance label - slave :</source>
<target>标签距离 - 从站:</target>
</phrase>
<phrase>
<source>Définir une couleur transparente</source>
<target>设置透明色</target>
</phrase>
<phrase>
<source>Déformer une courbe</source>
<target>变形曲线</target>
</phrase>
<phrase>
<source>Déplacer le centre de rotation d&apos;une image</source>
<target>移动图像的旋转中心</target>
</phrase>
<phrase>
<source>Déverrouillé : largeur et hauteur peuvent être modifiées indépendamment. Cliquer pour verrouiller.</source>
<target>已解锁:宽度和高度可独立修改。单击锁定。</target>
</phrase>
<phrase>
<source>Enregistrer l&apos;image d&apos;origine sous...</source>
<target>原始图像另存为...</target>
</phrase>
<phrase>
<source>Enregistrer l&apos;image sous...</source>
<target>图像另存为...</target>
</phrase>
<phrase>
<source>Erreur</source>
<target>错误</target>
</phrase>
<phrase>
<source>Exclure de la nomenclature</source>
<target>从物料清单中排除</target>
</phrase>
<phrase>
<source>Faire pivoter %1</source>
<target>旋转 %1</target>
</phrase>
<phrase>
<source>Faire pivoter une image</source>
<target>旋转图像</target>
</phrase>
<phrase>
<source>Faites glisser les poignées, ou l&apos;intérieur du cadre, pour ajuster la zone à conserver.</source>
<target>拖动控制柄或框内区域,调整要保留的区域。</target>
</phrase>
<phrase>
<source>Fil</source>
<target>导线</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Folio</source>
<target>图页</target>
<definition>column title</definition>
</phrase>
<phrase>
<source>Forme fermée</source>
<target>闭合形状</target>
</phrase>
<phrase>
<source>Glisser %1 : rotation (Maj = 15°)</source>
<target>拖动 %1:旋转(Shift = 15°)</target>
</phrase>
<phrase>
<source>Glisser : ajuster l&apos;arc (Ctrl = position libre, Maj = 15°)</source>
<target>拖动:调整圆弧(Ctrl = 自由位置,Shift = 15°)</target>
</phrase>
<phrase>
<source>Glisser : arrondir les coins (Ctrl = position libre)</source>
<target>拖动:圆角(Ctrl = 自由位置)</target>
</phrase>
<phrase>
<source>Glisser : déformer la courbe (Ctrl = position libre, Alt = briser la tangente)</source>
<target>拖动:变形曲线(Ctrl = 自由位置,Alt = 断开切线)</target>
</phrase>
<phrase>
<source>Glisser : déplacer ce point</source>
<target>拖动:移动此点</target>
</phrase>
<phrase>
<source>Glisser : déplacer le centre de rotation</source>
<target>拖动:移动旋转中心</target>
</phrase>
<phrase>
<source>Glisser : déplacer le point (Ctrl = position libre</source>
<target>拖动:移动点(Ctrl = 自由位置</target>
</phrase>
<phrase>
<source>Glisser : inclinaison (Ctrl = position libre, Maj = 15°)</source>
<target>拖动:倾斜(Ctrl = 自由位置,Shift = 15°)</target>
</phrase>
<phrase>
<source>Glisser : incliner (Maj = par pas de 15°)</source>
<target>拖动:倾斜(Shift = 以 15° 为步长)</target>
</phrase>
<phrase>
<source>Glisser : pivoter (Maj = par pas de 15°)</source>
<target>拖动:旋转(Shift = 以 15° 为步长)</target>
</phrase>
<phrase>
<source>Glisser : redimensionner (Ctrl = depuis le centre + position libre, Maj = proportions</source>
<target>拖动:调整大小(Ctrl = 从中心 + 自由位置,Shift = 比例</target>
</phrase>
<phrase>
<source>Glisser : redimensionner (Maj = conserver les proportions, Ctrl = depuis le centre)</source>
<target>拖动:调整大小(Shift = 保持比例,Ctrl = 从中心)</target>
</phrase>
<phrase>
<source>Glisser : repositionner le centre de rotation (Ctrl = position libre)</source>
<target>拖动:重新定位旋转中心(Ctrl = 自由位置)</target>
</phrase>
<phrase>
<source>Glisser : rotation (Ctrl = position libre, Maj = 15°)</source>
<target>拖动:旋转(Ctrl = 自由位置,Shift = 15°)</target>
</phrase>
<phrase>
<source>Glisser le point violet : arrondir les coins</source>
<target>拖动紫色点:圆角</target>
</phrase>
<phrase>
<source>Glisser un coin : pivoter (Maj = par pas de 15°) ; glisser un bord : incliner (Maj = par pas de 15°) ; point rouge : déplacer le centre de rotation</source>
<target>拖动角:旋转(Shift = 以 15° 为步长);拖动边:倾斜(Shift = 以 15° 为步长);红点:移动旋转中心</target>
</phrase>
<phrase>
<source>Glisser un coin/bord : redimensionner (Ctrl = depuis le centre, Maj = conserver les proportions)</source>
<target>拖动角/边:调整大小(Ctrl = 从中心,Shift = 保持比例)</target>
</phrase>
<phrase>
<source>Glisser un coin/bord : redimensionner (Ctrl = depuis le centre, Maj = proportions, Alt = détacher en polyligne)</source>
<target>拖动角/边:调整大小(Ctrl = 从中心,Shift = 比例,Alt = 分离为多段线)</target>
</phrase>
<phrase>
<source>Glisser un point : le déplacer</source>
<target>拖动点:移动它</target>
</phrase>
<phrase>
<source>Glisser une extrémité : la déplacer</source>
<target>拖动端点:移动它</target>
</phrase>
<phrase>
<source>Glisser une poignée ou la courbe : déformer (Alt = briser la tangente) ; Alt+glisser un point anguleux : créer des poignées ; clic droit : menu du nœud le plus proche</source>
<target>拖动控制柄或曲线:变形(Alt = 断开切线);Alt+拖动角点:创建控制柄;右键单击:最近节点菜单</target>
</phrase>
<phrase>
<source>Géométrie</source>
<target>几何</target>
</phrase>
<phrase>
<source>Hauteur</source>
<target>高度</target>
</phrase>
<phrase>
<source>Image BMP (*.bmp)</source>
<target>BMP 图像 (*.bmp)</target>
</phrase>
<phrase>
<source>Image Files (*.png *.jpg *.jpeg *.bmp *.svg)</source>
<target>图像文件 (*.png *.jpg *.jpeg *.bmp *.svg)</target>
</phrase>
<phrase>
<source>Image JPEG (*.jpg *.jpeg)</source>
<target>JPEG 图像 (*.jpg *.jpeg)</target>
</phrase>
<phrase>
<source>Image PNG (*.png)</source>
<target>PNG 图像 (*.png)</target>
</phrase>
<phrase>
<source>Image source</source>
<target>源图像</target>
</phrase>
<phrase>
<source>Image SVG (*.svg)</source>
<target>SVG 图像 (*.svg)</target>
</phrase>
<phrase>
<source>Images non incluses dans l&apos;export DXF</source>
<target>图像未包含在 DXF 导出中</target>
<definition>message box title</definition>
</phrase>
<phrase>
<source>Impossible d&apos;enregistrer l&apos;image à cet emplacement.</source>
<target>无法将图像保存到该位置。</target>
</phrase>
<phrase>
<source>Impossible d&apos;enregistrer la nomenclature dans %1.
%2</source>
<target>无法将物料清单保存到 %1。
%2</target>
</phrase>
<phrase>
<source>Impossible de charger l&apos;image.</source>
<target>无法加载图像。</target>
</phrase>
<phrase>
<source>Inclinaison X</source>
<target>X 倾斜</target>
</phrase>
<phrase>
<source>Inclinaison Y</source>
<target>Y 倾斜</target>
</phrase>
<phrase>
<source>Incliner %1</source>
<target>倾斜 %1</target>
</phrase>
<phrase>
<source>Incliner une image</source>
<target>倾斜图像</target>
</phrase>
<phrase>
<source>La limite fixée pour cet élément maître est atteinte (Limite: %1).
Voulez-vous tout de même lier ce contact esclave ?</source>
<target>已达到此主元件的限制(限制:%1)。
是否仍要链接此从属触点?</target>
</phrase>
<phrase>
<source>Largeur</source>
<target>宽度</target>
</phrase>
<phrase>
<source>Le format DXF utilisé ici (AC1006) ne permet pas d&apos;inclure d&apos;image. Les images seront représentées uniquement par un rectangle de contour (position, taille, rotation et inclinaison conservées), sans le contenu de l&apos;image.</source>
<target>此处使用的 DXF 格式 (AC1006) 无法包含图像。图像将仅以轮廓矩形表示(保留位置、大小、旋转和倾斜),不包含图像内容。</target>
<definition>message box content</definition>
</phrase>
<phrase>
<source>Lisse</source>
<target>平滑</target>
</phrase>
<phrase>
<source>Liste de câblage</source>
<target>接线列表</target>
<definition>window title</definition>
</phrase>
<phrase>
<source>Liste de câblage (base de données)</source>
<target>接线列表(数据库)</target>
</phrase>
<phrase>
<source>Longueur</source>
<target>长度</target>
</phrase>
<phrase>
<source>margin: 5px; font-weight: bold;</source>
<target>margin: 5px; font-weight: bold;</target>
</phrase>
<phrase>
<source>Miroir horizontal</source>
<target>水平镜像</target>
</phrase>
<phrase>
<source>Miroir horizontal d&apos;une image</source>
<target>图像水平镜像</target>
</phrase>
<phrase>
<source>Miroir horizontal de %1</source>
<target>%1 的水平镜像</target>
</phrase>
<phrase>
<source>Miroir impossible : inclinaison trop extrême pour cette forme</source>
<target>无法镜像:此形状的倾斜过于极端</target>
</phrase>
<phrase>
<source>Miroir vertical</source>
<target>垂直镜像</target>
</phrase>
<phrase>
<source>Miroir vertical d&apos;une image</source>
<target>图像垂直镜像</target>
</phrase>
<phrase>
<source>Miroir vertical de %1</source>
<target>%1 的垂直镜像</target>
</phrase>
<phrase>
<source>Modifier l&apos;angle d&apos;un arc</source>
<target>修改弧的角度</target>
</phrase>
<phrase>
<source>Modifier l&apos;angle d&apos;une forme</source>
<target>修改形状角度</target>
</phrase>
<phrase>
<source>Modifier l&apos;angle d&apos;une image</source>
<target>修改图像角度</target>
</phrase>
<phrase>
<source>Modifier l&apos;inclinaison d&apos;une image</source>
<target>修改图像倾斜</target>
</phrase>
<phrase>
<source>Modifier la courbure d&apos;%1</source>
<target>修改%1的曲率</target>
</phrase>
<phrase>
<source>Modifier la forme d&apos;%1</source>
<target>修改%1的形状</target>
</phrase>
<phrase>
<source>Modifier la hauteur d&apos;une image</source>
<target>修改图像高度</target>
</phrase>
<phrase>
<source>Modifier la largeur d&apos;une image</source>
<target>修改图像宽度</target>
</phrase>
<phrase>
<source>Modifier la longueur d&apos;une ligne</source>
<target>修改线条长度</target>
</phrase>
<phrase>
<source>Modifier la taille d&apos;une forme</source>
<target>修改形状大小</target>
</phrase>
<phrase>
<source>Modifier le type d&apos;un nœud</source>
<target>修改节点类型</target>
</phrase>
<phrase>
<source>Modifier une image</source>
<target>修改图像</target>
</phrase>
<phrase>
<source>Modèle</source>
<target>型号</target>
</phrase>
<phrase>
<source>Nombre maximum de contacts esclaves définis : non défini
</source>
<target>已定义的从属触点最大数量:未定义
</target>
</phrase>
<phrase>
<source>Notes</source>
<target>备注</target>
</phrase>
<phrase>
<source>Nœud le plus proche</source>
<target>最近节点</target>
</phrase>
<phrase>
<source>pivoter/incliner</source>
<target>旋转/倾斜</target>
</phrase>
<phrase>
<source>Rayon X</source>
<target>X半径</target>
</phrase>
<phrase>
<source>Rayon Y</source>
<target>Y半径</target>
</phrase>
<phrase>
<source>redimensionner</source>
<target>调整大小</target>
</phrase>
<phrase>
<source>Redimensionner %1</source>
<target>调整 %1 大小</target>
</phrase>
<phrase>
<source>Redimensionner une image</source>
<target>调整图像大小</target>
</phrase>
<phrase>
<source>Remplacer l&apos;image...</source>
<target>替换图像...</target>
</phrase>
<phrase>
<source>Remplacer une image</source>
<target>替换图像</target>
</phrase>
<phrase>
<source>Restaurer les proportions</source>
<target>恢复比例</target>
</phrase>
<phrase>
<source>Restaurer les proportions d&apos;une image</source>
<target>恢复图像比例</target>
</phrase>
<phrase>
<source>Retirer cette couleur</source>
<target>移除此颜色</target>
</phrase>
<phrase>
<source>Revenir à l&apos;image complète, sans rognage</source>
<target>恢复为完整图像,不裁剪</target>
</phrase>
<phrase>
<source>rgb(%1, %2, %3)</source>
<target>rgb(%1, %2, %3)</target>
</phrase>
<phrase>
<source>Rogner l&apos;image</source>
<target>裁剪图像</target>
</phrase>
<phrase>
<source>Rogner une image</source>
<target>裁剪图像</target>
</phrase>
<phrase>
<source>Rogner...</source>
<target>裁剪...</target>
</phrase>
<phrase>
<source>Rotation/Inclinaison</source>
<target>旋转/倾斜</target>
</phrase>
<phrase>
<source>Réinitialiser</source>
<target>重置</target>
</phrase>
<phrase>
<source>Selectionner une image...</source>
<target>选择图像...</target>
</phrase>
<phrase>
<source>Supprimer le nœud le plus proche</source>
<target>删除最近节点</target>
</phrase>
<phrase>
<source>Supprimer un point d&apos;une courbe</source>
<target>从曲线删除点</target>
</phrase>
<phrase>
<source>Symétrique</source>
<target>对称</target>
</phrase>
<phrase>
<source>Séparation de potentiel</source>
<target>电位分隔</target>
</phrase>
<phrase>
<source>Taille</source>
<target>大小</target>
</phrase>
<phrase>
<source>Tension nominale</source>
<target>额定电压</target>
</phrase>
<phrase>
<source>Tolérance pour cette couleur</source>
<target>此颜色的容差</target>
</phrase>
<phrase>
<source>Tous les fichiers (*)</source>
<target>所有文件 (*)</target>
</phrase>
<phrase>
<source>Transformer %1</source>
<target>变换 %1</target>
</phrase>
<phrase>
<source>Transparence non conservée</source>
<target>不保留透明度</target>
</phrase>
<phrase>
<source>un arc</source>
<target>一段弧</target>
</phrase>
<phrase>
<source>un coin</source>
<target>一个角</target>
</phrase>
<phrase>
<source>un point</source>
<target>一个点</target>
</phrase>
<phrase>
<source>une courbe</source>
<target>一条曲线</target>
</phrase>
<phrase>
<source>une extrémité</source>
<target>一个端点</target>
</phrase>
<phrase>
<source>une image</source>
<target>一张图像</target>
<definition>part of a sentence listing the content of a diagram</definition>
</phrase>
<phrase>
<source>Verrouiller la numérotation automatique</source>
<target>锁定自动编号</target>
</phrase>
<phrase>
<source>Verrouiller la position</source>
<target>锁定位置</target>
</phrase>
<phrase>
<source>Verrouillé : modifier la largeur ou la hauteur ajuste l&apos;autre pour conserver les proportions. Cliquer pour déverrouiller.</source>
<target>已锁定:修改宽度或高度会调整另一个以保持比例。单击解锁。</target>
</phrase>
<phrase>
<source>Échec de l&apos;enregistrement</source>
<target>保存失败</target>
</phrase>
<phrase>
<source>Édition des nœuds</source>
<target>节点编辑</target>
</phrase>
<phrase>
<source>armoire</source>
<target>机柜</target>
<definition>cabinet / enclosure</definition>
</phrase>
<phrase>
<source>bobine</source>
<target>线圈</target>
<definition>coil</definition>
</phrase>
<phrase>
<source>borne</source>
<target>端子</target>
<definition>terminal - a connection point on a symbol</definition>
</phrase>
<phrase>
<source>bornier</source>
<target>端子排</target>
<definition>terminal strip</definition>
</phrase>
<phrase>
<source>cable</source>
<target>电缆</target>
<definition>cable</definition>
</phrase>
<phrase>
<source>calibre</source>
<target>额定值</target>
<definition>rating - the current rating of a device</definition>
</phrase>
<phrase>
<source>cartouche</source>
<target>标题栏</target>
<definition>title block - the framed information panel</definition>
</phrase>
<phrase>
<source>collection</source>
<target>符号库</target>
<definition>collection - the symbol library</definition>
</phrase>
<phrase>
<source>conducteur</source>
<target>导线</target>
<definition>conductor - the drawn wire between terminals</definition>
</phrase>
<phrase>
<source>contact</source>
<target>触点</target>
<definition>contact</definition>
</phrase>
<phrase>
<source>contacteur</source>
<target>接触器</target>
<definition>contactor</definition>
</phrase>
<phrase>
<source>courant</source>
<target>电流</target>
<definition>current</definition>
</phrase>
<phrase>
<source>disjoncteur</source>
<target>断路器</target>
<definition>circuit breaker</definition>
</phrase>
<phrase>
<source>dossier</source>
<target>文件夹</target>
<definition>folder</definition>
</phrase>
<phrase>
<source>element</source>
<target>元件</target>
<definition>element - a symbol placed on a sheet</definition>
</phrase>
<phrase>
<source>esclave</source>
<target>从</target>
<definition>slave - the contact block belonging to a master</definition>
</phrase>
<phrase>
<source>fusible</source>
<target>熔断器</target>
<definition>fuse</definition>
</phrase>
<phrase>
<source>grille</source>
<target>网格</target>
<definition>grid</definition>
</phrase>
<phrase>
<source>interrupteur</source>
<target>开关</target>
<definition>switch</definition>
</phrase>
<phrase>
<source>maitre</source>
<target>主</target>
<definition>master - the element a cross-reference points from</definition>
</phrase>
<phrase>
<source>modele</source>
<target>模板</target>
<definition>template</definition>
</phrase>
<phrase>
<source>moteur</source>
<target>电动机</target>
<definition>motor</definition>
</phrase>
<phrase>
<source>neutre</source>
<target>中性线</target>
<definition>neutral</definition>
</phrase>
<phrase>
<source>nomenclature</source>
<target>物料清单</target>
<definition>parts list / bill of materials</definition>
</phrase>
<phrase>
<source>numerotation</source>
<target>编号</target>
<definition>numbering - automatic wire and part numbering</definition>
</phrase>
<phrase>
<source>phase</source>
<target>相</target>
<definition>phase</definition>
</phrase>
<phrase>
<source>potentiel</source>
<target>电位</target>
<definition>potential - conductors electrically joined as one node</definition>
</phrase>
<phrase>
<source>projet</source>
<target>项目</target>
<definition>project - the .qet file holding the sheets</definition>
</phrase>
<phrase>
<source>puissance</source>
<target>功率</target>
<definition>power</definition>
</phrase>
<phrase>
<source>relais</source>
<target>继电器</target>
<definition>relay</definition>
</phrase>
<phrase>
<source>renvoi de folio</source>
<target>图纸交叉引用</target>
<definition>sheet cross-reference</definition>
</phrase>
<phrase>
<source>repere</source>
<target>标识</target>
<definition>designation - the identifying mark on a part</definition>
</phrase>
<phrase>
<source>report de folio</source>
<target>图纸交叉引用</target>
<definition>sheet cross-reference (the arrow symbol)</definition>
</phrase>
<phrase>
<source>schema</source>
<target>原理图</target>
<definition>diagram</definition>
</phrase>
<phrase>
<source>section</source>
<target>截面积</target>
<definition>cross-section - conductor size in mm2</definition>
</phrase>
<phrase>
<source>sommaire</source>
<target>目录</target>
<definition>summary / table of contents</definition>
</phrase>
<phrase>
<source>tension</source>
<target>电压</target>
<definition>voltage</definition>
</phrase>
<phrase>
<source>terre</source>
<target>接地</target>
<definition>earth / ground</definition>
</phrase>
<phrase>
<source>texte</source>
<target>文本</target>
<definition>text</definition>
</phrase>
<phrase>
<source>transformateur</source>
<target>变压器</target>
<definition>transformer</definition>
</phrase>
</QPH>
+50
View File
@@ -34,6 +34,16 @@ expects, so QIcon::fromTheme("name") finds them. The dark theme only holds
the icons that need a dark variant: black line art. Colored icons are not
touched; the dark theme inherits them from the light one.
Qt inherits by name, not by size: once a name has any file in the dark
theme, the parent theme is never consulted for that name, and a size the
dark theme lacks is served by scaling the nearest dark file. An icon that
is line art at 22 pixels and colored at 128 (the printer) would then come
out as the 22 pixel copy scaled up on a dark palette. So for every name
the dark theme holds, the .qrc also aliases the light files of the sizes
the dark theme does not have, when they read on the dark window (3:1,
measured as tests/qttest/tst_qeticons.cpp does); a light file that does
not is left out, and Qt scales the nearest dark copy as before.
An icon counts as line art when fewer than 20% of its visible pixels are
saturated. Its dark copy keeps hue and alpha and inverts lightness, scaled
so pure black becomes (220, 220, 220), the dark palette's text color.
@@ -101,6 +111,8 @@ WHITE_LIGHTNESS = 0.85 # a visible pixel this light counts as white
WHITE_FRACTION = 0.30 # at or above this an icon is "light art"
INK = 220 / 255.0 # lightness of pure black after inversion
SVG_INK = "#dcdcdc"
DARK_WINDOW = (53, 53, 53) # QET::Palette::fusionDark() window color
DARK_RATIO = 3.0 # what tst_qeticons requires of a dark theme file
def visible_pixels(image):
@@ -131,6 +143,28 @@ def has_light_fill(image):
return white / len(pixels) >= WHITE_FRACTION
def relative_luminance(rgb):
def linear(c):
c /= 255.0
return c / 12.92 if c <= 0.03928 else ((c + 0.055) / 1.055) ** 2.4
r, g, b = rgb
return 0.2126 * linear(r) + 0.7152 * linear(g) + 0.0722 * linear(b)
def reads_on_dark(image):
"""True when the icon's mean visible color reaches DARK_RATIO against
the dark window, the test tst_qeticons applies to every dark file."""
pixels = visible_pixels(image)
if not pixels:
return False
n = len(pixels)
mean = (sum(p[0] for p in pixels) // n, sum(p[1] for p in pixels) // n,
sum(p[2] for p in pixels) // n)
lighter, darker = sorted((relative_luminance(mean), relative_luminance(DARK_WINDOW)),
reverse=True)
return (lighter + 0.05) / (darker + 0.05) >= DARK_RATIO
def invert_lightness(image):
"""Invert lightness, keeping hue, saturation and alpha.
@@ -240,6 +274,20 @@ def main():
changed += write_if_changed(target, text)
dark.append(f"themes/qet-dark/scalable/{name}")
# Complete each dark name with the light files of its other sizes
# that read on a dark window (see the module docstring): aliases, no
# copies.
dark_sizes = {}
for path in dark:
size, name = path.split("/")[2:]
dark_sizes.setdefault(name, set()).add(size)
dark_aliases = []
for alias, source in light:
size, name = alias.split("/")[2:]
if name in dark_sizes and size not in dark_sizes[name] \
and reads_on_dark(Image.open(ICO / source).convert("RGBA")):
dark_aliases.append((f"themes/qet-dark/{size}/{name}", source))
# Drop dark files from an earlier run that are no longer generated, so
# a reclassified icon falls back to the light theme instead of keeping
# a stale copy.
@@ -264,6 +312,8 @@ def main():
qrc.append(f' <file alias="{alias}">{source}</file>')
for path in dark:
qrc.append(f" <file>{path}</file>")
for alias, source in dark_aliases:
qrc.append(f' <file alias="{alias}">{source}</file>')
qrc += [" </qresource>", "</RCC>", ""]
changed += write_if_changed(QRC, "\n".join(qrc))
+349
View File
@@ -0,0 +1,349 @@
# qet-mcp — a Model Context Protocol server for QElectroTech projects
A small stdio MCP server that lets an AI assistant read and verify
QElectroTech projects: what is in a project, what an edit actually
changed, and what a whole corpus of projects contains.
It has **no third-party dependencies** — Python 3.9+ and the standard
library only. The MCP SDK is not required.
## Why
Verifying a change by screenshot is unreliable, and this tool exists
because that unreliability produced two wrong conclusions in one review
session:
- A drag of a multi-element selection *looked* like it had left the
symbols behind and detached their labels. Diffing the saved file showed
all four elements had moved by an identical `(0, -80)` and **no label
had moved at all**. A bug report was one step away from being filed.
- An "Apply" button *looked* like it did nothing. It was disabled,
because a required field was empty.
Both times the pixels misled and the model told the truth. So the tools
here read the model.
## Tools
| Tool | What it answers |
|---|---|
| `qet_project_info` | title, format version, folios, element and conductor counts |
| `qet_elements` | placed elements: uuid, type, position, label, information bag |
| `qet_conductors` | conductors and their documentation fields; filter by attribute |
| `qet_diff` | **what an edit actually changed** — element moves, adds, removes, relabels; conductor changes; and folio fields, texts, shapes, images, symbol text fields and terminal strips |
| `qet_scan` | sweep a directory of projects, counting nodes carrying an attribute |
| `qet_element_info` | a `.elmt`: translated names, terminals, info fields, part counts |
| `qet_export` | run a headless export (pdf, png, svg, bom, cables, wires, wiring, nets, links, info) |
| `qet_edit` | **change a project** — place, move, rotate, label, wire, number, cross-reference, add text, shapes and images, restyle a symbol's text fields, delete; then diff the result |
| `qet_element_build` | **author a `.elmt`** — draw a new symbol, with terminals to wire it by |
| `qet_project_new` | **start from nothing** — an empty project with a title and folios |
| `qet_element_search` | **find a symbol** in a collection by name (any language), type or terminal count |
| `qet_check` | **design-rule checks** — duplicate labels, unlabelled masters, unnumbered conductors, empty folios |
| `qet_query` | **ask the project database** — read-only SQL over the views and tables |
`qet_export` and `qet_edit` launch QElectroTech. Everything else parses the
file directly, which is faster, needs no display, and cannot be confused by
a dialog.
## Running it
```bash
# list the tools and exit
misc/qet-mcp/qet_mcp.py --list
# speak MCP on stdin/stdout
misc/qet-mcp/qet_mcp.py
```
Register it with an MCP client, for example:
```json
{
"mcpServers": {
"qet": {
"command": "python3",
"args": ["/path/to/qelectrotech/misc/qet-mcp/qet_mcp.py"],
"env": {
"QET_MCP_WORKSPACE": "/home/you/drawings",
"QET_ENABLE_SCRIPTING": "1"
}
}
}
}
```
## Five tools need scripting switched on
A QElectroTech with JavaScript scripting switched off refuses `--run`, and
off is the default from
[#984](https://github.com/qelectrotech/qelectrotech-source-mirror/pull/984)
onwards. Five tools here drive it that way and stop working until it is
turned on:
| | |
|---|---|
| need `QET_ENABLE_SCRIPTING=1` | `qet_query`, `qet_continuity`, `qet_check`, `qet_project_new`, `qet_edit` |
| unaffected | everything else — they read the `.qet` directly, or, in `qet_export`'s case, use a plain CLI flag |
The variable goes in the environment this server is started in, which for an
MCP client is the `env` block above; the server passes its environment
straight through to QElectroTech. It does not set the variable itself, on
purpose — a switch a program turns on for itself is not a switch. Whoever
configured this server and pointed it at a QElectroTech binary made that
choice, and their interactive QElectroTech keeps whatever its own setting
says.
Without it, those five come back `"ok": false` with a `hint` naming the
variable. Older builds, from before the setting existed, need nothing.
## What the server is allowed to touch
Every path in a tool call is chosen by the model, so without a policy this
server would be a read/write primitive for anything the operating system
lets the process reach: read any project on the disk, export one somewhere
else, overwrite an unrelated file, embed an arbitrary local image or PDF.
So **data paths are confined to a workspace**:
| | |
|---|---|
| `QET_MCP_WORKSPACE` | the directories tool calls may read and write, separated by `:` (`;` on Windows) |
| unset | the directory the server was started in |
| `QET_MCP_ALLOW_ANY_PATH=1` | turns the check off entirely |
Set the workspace to the folder your drawings live in. A path outside it is
refused with an error naming what was allowed; symlinks are resolved first,
so a link planted inside the workspace is judged by where it points.
Two arguments are deliberately **not** confined: `binary` (the
`qelectrotech` executable) and `elements_dir` (the element collection).
Those are configuration, chosen once by whoever runs the server, and both
normally live in `/usr` or a build tree — outside any sensible workspace.
Confining them would reject the ordinary case while stopping nothing.
`QET_MCP_ALLOW_ANY_PATH=1` is equivalent to granting the client local
filesystem access with this process's privileges. It exists so that is a
deliberate choice rather than the default.
**Nothing is overwritten unasked.** `qet_export`, `qet_edit`,
`qet_project_new` and `qet_element_build` refuse an `output` that already
exists unless the call passes `"overwrite": true`. Replacing a file is the
one step this server cannot undo, so it is the one step it will not take on
its own.
The confinement is applied where tool arguments enter the server, not inside
each tool. Importing `qet_mcp` and calling `tool_export()` from your own
Python is not confined and is not meant to be — that is your code calling a
library, and you already chose the paths.
## Worked examples
**What did that edit change?**
```json
{"name": "qet_diff", "arguments": {"before": "a.qet", "after": "b.qet"}}
```
```json
"elements": { "moved_count": 4,
"distinct_move_deltas": [[0.0, -80.0]],
"relabelled": [], "info_changed": [] }
```
Four elements moved by one uniform delta; nothing was relabelled. That is
the answer a screenshot gave wrongly.
**Draw something, and check it landed**
```json
{"name": "qet_edit", "arguments": {
"binary": "/path/to/qelectrotech",
"project": "in.qet", "output": "out.qet",
"elements_dir": "/path/to/qelectrotech/elements",
"operations": [
{"op": "add_folio", "id": "f"},
{"op": "set_folio_title", "folio": "$f", "title": "Starter"},
{"op": "add_element", "id": "k1", "folio": "$f", "path": "common://.../coil.elmt", "x": 100, "y": 100},
{"op": "add_element", "id": "k2", "folio": "$f", "path": "common://.../coil.elmt", "x": 320, "y": 100},
{"op": "add_conductor", "folio": "$f", "from": "$k1", "from_terminal": 0, "to": "$k2", "to_terminal": 0},
{"op": "set_conductor", "folio": "$f", "element": "$k1", "terminal": 0, "property": "num", "value": "W7"},
{"op": "set_label", "folio": "$f", "element": "$k1", "label": "KM1"}
]}}
```
An op that creates something takes an `"id"`; later ops name it as `"$id"`.
Terminals are addressed by index — top to bottom, then left to right, **not**
the order the `.elmt` lists them. `qet_element_info` and `qet_element_search`
both report that index order. The answer carries a per-operation result
*and* a `qet_diff`, because "addConductor → true" says the call was
accepted, not that the file came out right:
```json
"diff": {"elements": {"before": 11, "after": 13, "added": ["{0aa3…}", "{6f63…}"]},
"conductors": {"before": 47, "after": 48, "added": ["4:{0aa3…}/{2904…}--{6f63…}/{2904…}"],
"removed": []}}
```
**Draw a symbol that does not exist yet**
```json
{"name": "qet_element_build", "arguments": {
"output": "/path/to/collection/99_custom/my_resistor.elmt",
"names": {"en": "Test resistor", "fr": "Résistance de test"},
"parts": [
{"type": "rect", "x": -10, "y": -20, "width": 20, "height": 40},
{"type": "line", "x1": 0, "y1": -30, "x2": 0, "y2": -20},
{"type": "line", "x1": 0, "y1": 20, "x2": 0, "y2": 30},
{"type": "text", "x": 14, "y": -4, "text": "R"}
],
"terminals": [{"x": 0, "y": -30, "orientation": "n", "name": "1"},
{"x": 0, "y": 30, "orientation": "s", "name": "2"}]}}
```
Then place it with `qet_edit` like any catalogue element. Unlike a
project, a `.elmt` is not rewritten by QElectroTech on a round trip, so
generating one here is safe in a way that generating a `.qet` would not
be — there is no `toXml()` waiting to drop what this writer did not know
to emit.
**Ask a question the XML cannot answer**
```json
{"name": "qet_query", "arguments": {
"binary": "/path/to/qelectrotech", "project": "industrial.qet",
"sql": "SELECT label, COUNT(*) AS n FROM element_nomenclature_view WHERE label <> '' GROUP BY label HAVING n > 1 ORDER BY n DESC"}}
```
```json
"rows": [{"label": "V6", "n": 7}, {"label": "V5", "n": 6}, {"label": "V4", "n": 6}]
```
Duplicate element labels in a shipped example — a design-rule question,
answered by the database that already knew it.
**How much of a corpus uses a field?**
```json
{"name": "qet_scan",
"arguments": {"directory": "examples", "tag": "conductor", "attribute": "cable"}}
```
```json
{ "files": 24, "total": 3190, "non_empty": 0, "distinct_values": [] }
```
Across the shipped examples: 3190 conductors, not one with a cable value.
## Testing
```bash
python3 test_qet_mcp.py # unit + protocol, no QElectroTech needed
QET_BINARY=/path/to/qelectrotech \
QET_ELEMENTS=/path/to/qelectrotech/elements \
QET_EXAMPLES=/path/to/qelectrotech/examples \
QET_ENABLE_SCRIPTING=1 \
python3 test_qet_mcp.py # everything
```
`QET_ENABLE_SCRIPTING=1` matters from #984 onwards: without it the
integration tests that drive QElectroTech through a script all fail, and
they fail as "the edit did nothing" rather than as "scripting is off", which
reads like a regression in the thing under test.
176 tests in three layers: unit (validation, script generation, the terminal
order rule, the diff, the part schema), the real stdio transport, and
integration against a built QElectroTech. Several exist because the
behaviour they pin was once wrong and looked right, and say so in their
docstrings. To check the suite itself rather than trust it, each of those
bugs was reintroduced in turn and the suite confirmed to fail: ten in the
Python, plus the hang guard on `addConductor` and the database refresh in
`ConductorCreator` in the C++.
## Notes and limits
- **The project database is reachable now, through `qet_query`.** It was
not when this server was written, which is why every other structural
tool here re-derives its answer from the XML. Prefer the views —
`element_nomenclature_view`, `project_summary_view`, `wiring_list_view`
— which exist to be queried; the underlying tables are how the cache is
arranged today and a column may move. Call `qet_query` with no `sql` to
list both. Only `SELECT` and `WITH` are accepted, which is the rule
QElectroTech applies to its own custom-query box, not one invented here.
An empty result and a failed query are told apart: `row_count` 0 with no
`error` means nothing matched, and a typo'd column name says so.
- **`qet_export` isolates its launch.** SingleApplication keys its socket
on `applicationFilePath()`, so a second launch of the same binary path
forwards its request to an already-running instance and returns *that*
process's answer with no error. The tool copies the binary to a unique
temporary path, gives it a private `HOME`, and runs it on the offscreen
platform. A symlink would not work: `applicationFilePath()` resolves it
back to the real path.
- **The CLI matches its flags exactly.** `--export-bom out.csv` is the
supported form; `--export-bom=out.csv` is not recognised as an export
at all, so the application starts its interface instead and a headless
run hangs. The tool uses the positional form.
- **Conductor identity is the hard part of `qet_diff`.** A conductor names
its ends with `terminal1`/`terminal2`, and the project format has two
schemes: folio-scoped integer ids in older files, terminal-definition
uuids plus `element1`/`element2` in newer ones. The integer ids are
**renumbered on every save**, so keying on them — which this tool did at
first — made all 47 conductors of an untouched folio read as removed and
re-added the moment the other side had been through QElectroTech, which
is exactly what `qet_edit` produces. They are now keyed by owning element
uuid plus terminal, which is stable across a save: measured at 0 colliding
keys over 3190 conductors in the 24 shipped examples, and 0 churn on a
no-op edit. Where an element predates persisted uuids the end cannot be
resolved and keeps a `#`-marked unstable key; the diff then reports
`unstable_keys` and says so rather than pretending to be comparable.
- **Texts, shapes and images have no uuid**, so `qet_diff` cannot say "the same
text, edited": an edited text reads as the old one removed and a new one
added, both shown. Shapes and images are keyed by position, so a restyle
or rescale *is* reported as a change to that item, but a move reads as a
removal plus an addition. The folio `version` attribute is left out of the
comparison on purpose: QElectroTech rewrites it on every save, and
including it made every folio of any re-saved project look edited.
- **Elements** written before persisted uuids fall back to a positional key,
which makes a move in such a file read as a remove plus an add.
- **`qet_edit` needs a build whose scripting API carries the drawing verbs.**
Against an older one it reports exactly which methods are missing and
changes nothing. `addElement` and the move/delete verbs shipped with the
scripting API; `addConductor`, `rotateElement`, `setElementLabel`,
`setElementInfo` and `setFolioTitle` are newer.
- **`elements_dir` is not optional for `common://` paths.** The sandboxed
run has its own empty HOME, so QElectroTech falls back to the compiled-in
collection path, which on a machine that never ran `make install` does not
exist. The only symptom is `addElement` reporting that a file plainly
present "does not resolve to an element". An absolute `.elmt` path works
without it.
- **`set_conductor` changes the whole potential, not one segment.** That is
what the application does — a wire number describes a potential — so name
a terminal carrying exactly one conductor and the change reaches every
conductor electrically joined to it. A terminal several conductors meet
at names none of them and is refused, so address a potential from one of
its leaves. Property names are the file's own, so `qet_conductors` reads
back exactly what was set.
- **`link_elements` takes a folio for each end**, because a master and its
slave are normally on different folios. Whether a pair may be linked is
decided by QElectroTech's own `isLinkable()`, so a script cannot make a
link the GUI would refuse.
- **An element must live inside a collection to be placeable.** This is
not about the path syntax: an absolute `.elmt` path works, but only if
the file sits under a directory QElectroTech knows as a collection.
Write it under the tree you pass as `elements_dir` and `qet_edit` can
place it, by absolute path or as `common://…`; write it anywhere else
and `add_element` reports only "does not resolve to an element".
- **`qet_element_build` computes the `.elmt` size header, and checks it.**
`width`/`height`/`hotspot_x`/`hotspot_y` relate to the drawing by a
containment constraint, not a formula — the declared box runs from
`(-hotspot_x, -hotspot_y)` to `(width - hotspot_x, height - hotspot_y)`
and the drawing must fit inside it. The shipped collection shows authors
picking their own margins (one element pads 2 units left and 3 right,
another 8 and 2), so there is no convention to copy, only an invariant
to satisfy. A drawing that escaped its box is the classic way a
hand-written element renders clipped in the collection panel while
looking fine in XML.
- **QElectroTech interrupts a script at 30 s** of its own accord, separately
from this tool's `timeout`. A very long operation list will hit that
first.
- **`qet_edit` never writes the input.** It saves to a separate file and
diffs the two, so the original is always the thing the diff is against.
@@ -0,0 +1,44 @@
<definition version="0.100.0" type="element" link_type="master" width="40" height="60" hotspot_x="17" hotspot_y="32">
<uuid uuid="{6d3714f6-a0e1-71b3-e4bd-5a35d4cbbec1}"/>
<names>
<name lang="ar">ملف KA بمحتفظ مغناطيسي</name>
<name lang="ca">Bobina</name>
<name lang="cs">Bistabilní remanentní relé</name>
<name lang="de">Remanenzrelais</name>
<name lang="el">Πηνίο με μανδάλωση</name>
<name lang="en">Coil</name>
<name lang="es">Bobina KA de remanencia</name>
<name lang="fr">Bobine KA à rémanence</name>
<name lang="hu">Tekercs</name>
<name lang="it">Bobina</name>
<name lang="nl">spoel remanent</name>
<name lang="nl_BE">Spoel KA remanent</name>
<name lang="pl">Cewka przekaźnika remanencyjnego</name>
<name lang="pt_BR">Bobina</name>
<name lang="ru">Обмотка</name>
<name lang="zh">剩磁保持线圈</name>
</names>
<kindInformations>
<kindInformation name="type">plc</kindInformation>
</kindInformations>
<informations>Author: The QElectroTech team
License: see http://qelectrotech.org/wiki/doc/elements_license</informations>
<description>
<rect x="14" y="-8" width="6" height="16" rx="0" ry="0" style="line-style:normal;line-weight:normal;filling:none;color:black" antialias="false"/>
<line x1="0" y1="-20" x2="0" y2="-8" end1="none" end2="none" length1="1.5" length2="1.5" style="line-style:normal;line-weight:normal;filling:none;color:black" antialias="false"/>
<dynamic_text x="2" y="11.33" z="5" text_width="-1" Halignment="AlignLeft" Valignment="AlignTop" frame="false" rotation="0" keep_visual_rotation="false" text_from="UserText" uuid="{647e33ed-520b-4d80-bbc4-7b31177b8f26}" font="Liberation Sans,4,-1,5,25,0,0,0,0,0,Regular">
<text>A2</text>
</dynamic_text>
<dynamic_text x="2" y="-24.67" z="6" text_width="-1" Halignment="AlignLeft" Valignment="AlignTop" frame="false" rotation="0" keep_visual_rotation="false" text_from="UserText" uuid="{fb1f8de9-70c0-4801-8dc7-12e6bf88d8f5}" font="Liberation Sans,4,-1,5,25,0,0,0,0,0,Regular">
<text>A1</text>
</dynamic_text>
<line x1="0" y1="8" x2="0" y2="20" end1="none" end2="none" length1="1.5" length2="1.5" style="line-style:normal;line-weight:normal;filling:none;color:black" antialias="false"/>
<dynamic_text x="30" y="-9.17" z="8" text_width="-1" Halignment="AlignLeft" Valignment="AlignTop" frame="false" rotation="0" keep_visual_rotation="false" text_from="ElementInfo" uuid="{b7fccfc3-05f1-459c-9766-f49a481bd0ff}" font="Liberation Sans,9,-1,5,50,0,0,0,0,0,Regular">
<text></text>
<info_name>label</info_name>
</dynamic_text>
<polygon x1="-14" y1="-8" x2="14" y2="-8" x3="20" y3="8" x4="-14" y4="8" antialias="false" style="line-style:normal;line-weight:normal;filling:none;color:black"/>
<terminal uuid="{6a87c921-6f5d-4f5c-8673-228a6d13c5c8}" name="A2" x="0" y="20" orientation="s" type="Generic"/>
<terminal uuid="{2904e5fa-6bbe-4127-acdd-f92feadd6ece}" name="A1" x="0" y="-20" orientation="n" type="Generic"/>
</description>
</definition>
+16
View File
@@ -0,0 +1,16 @@
<definition version="0.100.0" type="element" link_type="slave" width="20" height="60" hotspot_x="9" hotspot_y="30">
<uuid uuid="{94d56f06-6814-5561-9148-2da3a9c4f900}"/>
<names>
<name lang="en">PLC Slave Test</name>
</names>
<kindInformations>
<kindInformation name="type">plc</kindInformation>
<kindInformation name="state">NO</kindInformation>
<kindInformation name="number">1</kindInformation>
</kindInformations>
<description>
<rect x="0" y="-8" width="6" height="16" rx="0" ry="0" style="line-style:normal;line-weight:normal;filling:none;color:black" antialias="false"/>
<terminal uuid="{6a87c921-6f5d-4f5c-8673-228a6d13c500}" name="1" x="0" y="20" orientation="s" type="Generic"/>
<terminal uuid="{2904e5fa-6bbe-4127-acdd-f92feadd6e00}" name="2" x="0" y="-20" orientation="n" type="Generic"/>
</description>
</definition>
+2773
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -49,6 +49,14 @@ ElementsCollectionModel::ElementsCollectionModel(QObject *parent) :
*/
ElementsCollectionModel::~ElementsCollectionModel()
{
// Without cancel(), the wait below runs the whole queued
// QtConcurrent::map() to completion, so closing this dialog on a
// large collection blocks until every remaining item has been
// processed -- a visible hang on the button pressed precisely to
// stop the work. cancel() drops the not-yet-started items so the
// wait that follows (still needed, so an in-flight item can't
// dereference this object after it's gone) is short.
m_future.cancel();
m_future.waitForFinished();
}
@@ -431,7 +439,7 @@ void ElementsCollectionModel::addLocation(const ElementsLocation& location)
collection_name);
}
}
// ANPASSUNG: Makros und Custom Collection werden hier behandelt!
// Macros and Custom Collection are handled here
else if (location.isCustomCollection() || location.isMacrosCollection()) {
QList <ElementCollectionItem *> child_list;
@@ -647,7 +655,7 @@ QModelIndex ElementsCollectionModel::indexFromLocation(
if (eci->type() == FileElementCollectionItem::Type) {
if (FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(eci)) {
// ANPASSUNG: Makro-Prüfung hinzugefügt, damit das Modell den Pfad im Baum findet!
// Macro check added so the model finds the path in the tree
if ( (location.isCommonCollection() && feci->isCommonCollection()) ||
(location.isCompanyCollection() && feci->isCompanyCollection()) ||
(location.isMacrosCollection() && feci->isMacrosCollection()) ||
@@ -653,9 +653,16 @@ QDomElement ElementsLocation::xml() const
if (!m_project)
{
QFile file (m_file_system_path);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return QDomElement();
QDomDocument docu;
if (docu.setContent(&file))
{
file.close();
return docu.documentElement();
}
file.close();
}
else
{
@@ -20,7 +20,7 @@
#include "../NameList/nameslist.h"
#include "../diagramcontext.h"
#include "pugixml/src/pugixml.hpp"
#include "pugixml.hpp"
#include <QIcon>
#include <QString>
@@ -162,7 +162,7 @@ QString FileElementCollectionItem::localName()
else if (m_path == QETApp::customElementsDirN())
setText(QObject::tr("Collection utilisateur"));
else if (m_path == macrosPath)
setText(QObject::tr("Makros"));
setText(QObject::tr("Macros"));
else
setText(QObject::tr("Collection inconnue"));
}
+1 -1
View File
@@ -17,7 +17,7 @@
*/
#ifndef NAMES_LIST_H
#define NAMES_LIST_H
#include "pugixml/src/pugixml.hpp"
#include "pugixml.hpp"
#include <QtXml>
/**
@@ -35,13 +35,17 @@ AddTerminalToStripCommand::AddTerminalToStripCommand(QSharedPointer<RealTerminal
const auto t_label = terminal->label();
const auto ts_name = strip->name();
const auto str_1 = t_label.isEmpty() ? QObject::tr("Ajouter une borne") :
QObject::tr("Ajouter la borne %1").arg(t_label);
const auto str_2 = ts_name.isEmpty() ? QObject::tr("à un groupe de bornes") :
QObject::tr("au groupe de bornes %1").arg(ts_name);
setText(str_1 % " " % str_2);
QString text;
if (ts_name.isEmpty()) {
text = t_label.isEmpty()
? QObject::tr("Ajouter une borne à un groupe de bornes")
: QObject::tr("Ajouter la borne %1 à un groupe de bornes").arg(t_label);
} else {
text = t_label.isEmpty()
? QObject::tr("Ajouter une borne au groupe de bornes %1").arg(ts_name)
: QObject::tr("Ajouter la borne %1 au groupe de bornes %2").arg(t_label, ts_name);
}
setText(text);
}
AddTerminalToStripCommand::AddTerminalToStripCommand(QVector<QSharedPointer<RealTerminal>> terminals, TerminalStrip *strip, QUndoCommand *parent) :
@@ -50,14 +54,11 @@ AddTerminalToStripCommand::AddTerminalToStripCommand(QVector<QSharedPointer<Real
m_new_strip{strip}
{
const auto ts_name = strip->name();
const auto count = m_terminal.size();
const auto str_1 = m_terminal.size() > 1 ? QObject::tr("Ajouter %1 bornes").arg(m_terminal.size()) :
QObject::tr("Ajouter une borne");
const auto str_2 = ts_name.isEmpty() ? QObject::tr("à un groupe de bornes") :
QObject::tr("au groupe de bornes %1").arg(ts_name);
setText(str_1 % " " % str_2);
setText(ts_name.isEmpty()
? QObject::tr("Ajouter %n borne(s) à un groupe de bornes", "", count)
: QObject::tr("Ajouter %n borne(s) au groupe de bornes %1", "", count).arg(ts_name));
}
@@ -137,13 +138,11 @@ void RemoveTerminalFromStripCommand::redo()
void RemoveTerminalFromStripCommand::setCommandTitle()
{
const auto strip_name = m_strip->name();
const auto count = m_terminals.size();
const auto str_1 = m_terminals.size()>1 ? QObject::tr("Enlever %1 bornes").arg(m_terminals.size()):
QObject::tr("Enlever une borne");
const auto str_2 = strip_name.isEmpty() ? QObject::tr("d'un groupe de bornes") :
QObject::tr("du groupe de bornes %1").arg(strip_name);
setText(str_1 % " " % str_2);
setText(strip_name.isEmpty()
? QObject::tr("Enlever %n borne(s) d'un groupe de bornes", "", count)
: QObject::tr("Enlever %n borne(s) du groupe de bornes %1", "", count).arg(strip_name));
}
/**
@@ -166,19 +165,30 @@ MoveTerminalCommand::MoveTerminalCommand(QSharedPointer<PhysicalTerminal> termin
t_label.append(", ");
t_label.append(real_t->label());
}
const auto strip_name = old_strip->name();
const auto new_strip_name = new_strip->name();
auto strip_name = old_strip->name();
auto new_strip_name = new_strip->name();
auto str_1 = t_label.isEmpty() ? QObject::tr("Déplacer une borne") :
QObject::tr("Déplacer la borne %1").arg(t_label);
auto str_2 = strip_name.isEmpty() ? QObject::tr(" d'un groupe de bornes") :
QObject::tr(" du groupe de bornes %1").arg(strip_name);
auto str_3 = new_strip_name.isEmpty() ? QObject::tr("vers un groupe de bornes") :
QObject::tr("vers le groupe de bornes %1").arg(new_strip_name);
setText(str_1 % " " % str_2 % " " % str_3);
QString text;
if (t_label.isEmpty()) {
if (strip_name.isEmpty() && new_strip_name.isEmpty())
text = QObject::tr("Déplacer une borne d'un groupe de bornes vers un autre groupe de bornes");
else if (strip_name.isEmpty())
text = QObject::tr("Déplacer une borne d'un groupe de bornes vers le groupe de bornes %1").arg(new_strip_name);
else if (new_strip_name.isEmpty())
text = QObject::tr("Déplacer une borne du groupe de bornes %1 vers un autre groupe de bornes").arg(strip_name);
else
text = QObject::tr("Déplacer une borne du groupe de bornes %1 vers le groupe de bornes %2").arg(strip_name, new_strip_name);
} else {
if (strip_name.isEmpty() && new_strip_name.isEmpty())
text = QObject::tr("Déplacer la borne %1 d'un groupe de bornes vers un autre groupe de bornes").arg(t_label);
else if (strip_name.isEmpty())
text = QObject::tr("Déplacer la borne %1 d'un groupe de bornes vers le groupe de bornes %2").arg(t_label, new_strip_name);
else if (new_strip_name.isEmpty())
text = QObject::tr("Déplacer la borne %1 du groupe de bornes %2 vers un autre groupe de bornes").arg(t_label, strip_name);
else
text = QObject::tr("Déplacer la borne %1 du groupe de bornes %2 vers le groupe de bornes %3").arg(t_label, strip_name, new_strip_name);
}
setText(text);
}
MoveTerminalCommand::MoveTerminalCommand(QVector<QSharedPointer<PhysicalTerminal>> terminals, TerminalStrip *old_strip,
@@ -191,17 +201,18 @@ MoveTerminalCommand::MoveTerminalCommand(QVector<QSharedPointer<PhysicalTerminal
{
const auto strip_name = old_strip->name();
const auto new_strip_name = new_strip->name();
const auto count = m_terminal.size();
const auto str_1 = m_terminal.size() > 1 ? QObject::tr("Déplacer des bornes") :
QObject::tr("Déplacer une borne");
const auto str_2 = strip_name.isEmpty() ? QObject::tr(" d'un groupe de bornes") :
QObject::tr(" du groupe de bornes %1").arg(strip_name);
const auto str_3 = new_strip_name.isEmpty() ? QObject::tr("vers un groupe de bornes") :
QObject::tr("vers le groupe de bornes %1").arg(new_strip_name);
setText(str_1 % " " % str_2 % " " % str_3);
QString text;
if (strip_name.isEmpty() && new_strip_name.isEmpty())
text = QObject::tr("Déplacer %n borne(s) d'un groupe de bornes vers un autre groupe de bornes", "", count);
else if (strip_name.isEmpty())
text = QObject::tr("Déplacer %n borne(s) d'un groupe de bornes vers le groupe de bornes %1", "", count).arg(new_strip_name);
else if (new_strip_name.isEmpty())
text = QObject::tr("Déplacer %n borne(s) du groupe de bornes %1 vers un autre groupe de bornes", "", count).arg(strip_name);
else
text = QObject::tr("Déplacer %n borne(s) du groupe de bornes %1 vers le groupe de bornes %2", "", count).arg(strip_name, new_strip_name);
setText(text);
}
void MoveTerminalCommand::undo()
@@ -46,10 +46,11 @@ FreeTerminalEditor::FreeTerminalEditor(QETProject *project, QWidget *parent) :
connect(m_project, &QObject::destroyed, this, &FreeTerminalEditor::reload);
}
//Disabled the move if the table is currently edited (yellow cell)
connect(m_model, &FreeTerminalModel::dataChanged, this, [=] {
this->setDisabledMove();
});
//Disable the move button while cells are edited (yellow), re-evaluate on every change
connect(m_model, &FreeTerminalModel::dataChanged, this, &FreeTerminalEditor::selectionChanged);
connect(ui->m_table_view->selectionModel(), &QItemSelectionModel::selectionChanged,
this, &FreeTerminalEditor::selectionChanged);
connect(ui->m_table_view, &QAbstractItemView::doubleClicked, this, [=](const QModelIndex &index)
{
@@ -102,7 +103,7 @@ void FreeTerminalEditor::reload()
QString str(strip->installation() + " " + strip->location() + " " + strip->name());
ui->m_move_in_cb->addItem(str, strip->uuid());
}
setDisabledMove(false);
selectionChanged();
}
}
@@ -273,10 +274,19 @@ void FreeTerminalEditor::on_m_move_pb_clicked()
reload();
}
void FreeTerminalEditor::selectionChanged()
{
const bool has_selection = !ui->m_table_view->selectionModel()->selectedIndexes().isEmpty();
const bool has_pending = !m_model->modifiedModelRealTerminalData().isEmpty();
setDisabledMove(!has_selection || has_pending);
}
void FreeTerminalEditor::setDisabledMove(bool b)
{
ui->m_move_label->setDisabled(b);
ui->m_move_in_cb->setDisabled(b);
ui->m_move_pb->setDisabled(b);
ui->m_move_pb->setToolTip(b ? tr("Appliquez ou annulez les modifications en cours avant de déplacer")
: tr("Déplacer les bornes sélectionnées vers le bornier choisi"));
}
@@ -182,7 +182,7 @@ bool FreeTerminalModel::setData(const QModelIndex &index, const QVariant &value,
modified_ = true;
modified_cell = FUNCTION_CELL;
}
else if (column_ == LED_CELL)
else if (column_ == LED_CELL && mrtd.led_ != value.toBool())
{
mrtd.led_ = value.toBool();
modified_ = true;
+77
View File
@@ -275,3 +275,80 @@ QString NumerotationContext::formatValue(const QStringList &item)
return QString("%1").arg(value.toInt(), 3, 10, QChar('0'));
return QString::number(value.toInt());
}
/**
@brief NumerotationContext::saveToSettings
Save a hash of named NumerotationContexts to QSettings.
@param contexts : the named rules to save
@param currentRule : the name of the currently active rule
@param settings : QSettings instance
@param prefix : settings key prefix (e.g. "autonum/conductor")
*/
void NumerotationContext::saveToSettings(
const QHash<QString, NumerotationContext> &contexts,
const QString &currentRule,
QSettings &settings,
const QString &prefix)
{
settings.setValue(prefix + "/current", currentRule);
// Clear stale array entries before writing (beginWriteArray does not
// remove entries beyond the new size).
settings.remove(prefix + "/rules");
QStringList names = contexts.keys();
settings.beginWriteArray(prefix + "/rules", names.size());
for (int i = 0; i < names.size(); ++i) {
settings.setArrayIndex(i);
const QString &name = names.at(i);
const NumerotationContext &nc = contexts.value(name);
settings.setValue("name", name);
// Serialize context to XML string
QDomDocument doc;
NumerotationContext nc_copy = nc;
QDomElement root = nc_copy.toXml(doc, "context");
doc.appendChild(root);
settings.setValue("xml", doc.toString());
}
settings.endArray();
}
/**
@brief NumerotationContext::loadFromSettings
Load named NumerotationContexts from QSettings.
@param settings : QSettings instance
@param prefix : settings key prefix (e.g. "autonum/conductor")
@return pair of (hash of named rules, name of current rule)
*/
QPair<QHash<QString, NumerotationContext>, QString> NumerotationContext::loadFromSettings(
QSettings &settings,
const QString &prefix)
{
QPair<QHash<QString, NumerotationContext>, QString> result;
QHash<QString, NumerotationContext> &contexts = result.first;
QString &currentRule = result.second;
currentRule = settings.value(prefix + "/current").toString();
int size = settings.beginReadArray(prefix + "/rules");
for (int i = 0; i < size; ++i) {
settings.setArrayIndex(i);
QString name = settings.value("name").toString();
QString xmlStr = settings.value("xml").toString();
if (name.isEmpty() || xmlStr.isEmpty()) continue;
QDomDocument doc;
if (!doc.setContent(xmlStr)) continue;
QDomElement root = doc.documentElement();
NumerotationContext nc;
nc.fromXml(root);
contexts.insert(name, nc);
}
settings.endArray();
return result;
}
+10
View File
@@ -21,6 +21,8 @@
#include <QStringList>
#include <QVariant>
#include <QDomElement>
#include <QHash>
#include <QSettings>
/**
This class represents a numerotation context, i.e. the data (type, value, increase)
@@ -60,6 +62,14 @@ class NumerotationContext
/// UI preview of a part's value matches what actually gets rendered.
static QString formatValue(const QStringList &item);
static void saveToSettings(const QHash<QString, NumerotationContext> &contexts,
const QString &currentRule,
QSettings &settings,
const QString &prefix);
static QPair<QHash<QString, NumerotationContext>, QString> loadFromSettings(
QSettings &settings,
const QString &prefix);
private:
QStringList content_;
};
@@ -0,0 +1,78 @@
/*
Copyright 2006-2026 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "renumberelementscommand.h"
#include "../qetproject.h"
#include "../qetgraphicsitem/element.h"
RenumberElementsCommand::RenumberElementsCommand(
QETProject *project,
QVector<ElementChange> changes,
QHash<QString, NumerotationContext> old_ctx,
QHash<QString, NumerotationContext> new_ctx,
const QString &text)
: QUndoCommand(text)
, project_(project)
, changes_(std::move(changes))
, old_ctx_(std::move(old_ctx))
, new_ctx_(std::move(new_ctx))
{
}
void RenumberElementsCommand::undo()
{
apply(false);
}
void RenumberElementsCommand::redo()
{
// QUndoStack calls redo() once immediately after push(); keep standard behaviour.
if (first_redo_) {
first_redo_ = false;
}
apply(true);
}
void RenumberElementsCommand::apply(bool use_new)
{
if (!project_) return;
// Restore project contexts
const auto &ctx = use_new ? new_ctx_ : old_ctx_;
for (auto it = ctx.constBegin(); it != ctx.constEnd(); ++it) {
project_->addElementAutoNum(it.key(), it.value());
}
// Apply per-element changes
for (const ElementChange &c : changes_) {
if (!c.element) continue;
const bool frozen = use_new ? c.new_frozen : c.old_frozen;
const auto &infos = use_new ? c.new_infos : c.old_infos;
const auto &seq = use_new ? c.new_seq : c.old_seq;
// Temporarily unfreeze so that label/infos update correctly.
const bool was_frozen = c.element->isFreezeLabel();
if (was_frozen) c.element->freezeLabel(false);
c.element->rSequenceStruct() = seq;
c.element->setElementInformations(infos);
c.element->freezeLabel(frozen);
}
}
+70
View File
@@ -0,0 +1,70 @@
/*
Copyright 2006-2026 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RENUMBERELEMENTSCOMMAND_H
#define RENUMBERELEMENTSCOMMAND_H
#include <QUndoCommand>
#include <QHash>
#include <QVector>
#include "../diagramcontext.h"
#include "assignvariables.h" // defines autonum::sequentialNumbers
class Element;
class QETProject;
/**
* @brief Undoable renumbering of element labels and sequence structs.
*/
class RenumberElementsCommand final : public QUndoCommand
{
public:
struct ElementChange
{
Element *element = nullptr;
DiagramContext old_infos;
DiagramContext new_infos;
autonum::sequentialNumbers old_seq;
autonum::sequentialNumbers new_seq;
bool old_frozen = false;
bool new_frozen = false;
};
RenumberElementsCommand(
QETProject *project,
QVector<ElementChange> changes,
QHash<QString, NumerotationContext> old_ctx,
QHash<QString, NumerotationContext> new_ctx,
const QString &text);
void undo() override;
void redo() override;
private:
void apply(bool use_new);
private:
QETProject *project_ = nullptr;
QVector<ElementChange> changes_;
QHash<QString, NumerotationContext> old_ctx_;
QHash<QString, NumerotationContext> new_ctx_;
bool first_redo_ = true;
};
#endif // RENUMBERELEMENTSCOMMAND_H
@@ -23,6 +23,7 @@
#include "formulaautonumberingw.h"
#include "numparteditorw.h"
#include "qdebug.h"
#include "renumberelementsdialog.h"
#include "ui_autonumberingmanagementw.h"
#include "ui_formulaautonumberingw.h"
@@ -48,6 +49,8 @@ AutoNumberingManagementW::AutoNumberingManagementW(QETProject *project,
ui->m_selected_folios_le->setDisabled(true);
ui->m_selected_folios_le->setReadOnly(true);
ui->m_apply_project_rb->setChecked(true);
// Enabled only when project is in "Under Development" status and not read-only.
ui->m_renumber_elements_pb->setEnabled(ui->m_status_cb->currentIndex() == 0 && project_ && !project_->isReadOnly());
setProjectContext();
}
@@ -87,6 +90,7 @@ void AutoNumberingManagementW::on_m_status_cb_currentIndexChanged(int index)
ui->m_both_conductor_rb->setChecked(true);
ui->m_both_element_rb->setChecked(true);
ui->m_both_folio_rb->setChecked(true);
ui->m_renumber_elements_pb->setEnabled(true);
}
//Installing
else if (index == 1) {
@@ -96,15 +100,31 @@ void AutoNumberingManagementW::on_m_status_cb_currentIndexChanged(int index)
ui->m_new_conductor_rb->setChecked(true);
ui->m_new_element_rb->setChecked(true);
ui->m_new_folio_rb->setChecked(true);
ui->m_renumber_elements_pb->setEnabled(true);
}
//Built
else if (index == 2) {
ui->m_disable_conductor_rb->setChecked(true);
ui->m_disable_element_rb->setChecked(true);
ui->m_disable_folio_rb->setChecked(true);
ui->m_renumber_elements_pb->setEnabled(false);
}
}
void AutoNumberingManagementW::on_m_renumber_elements_pb_clicked()
{
if (!project_ || project_->isReadOnly()) return;
// Only allowed during "Under Development"
// if (ui->m_status_cb->currentIndex() != 1) return;
QStringList titles = project_->elementAutoNum().keys();
titles.sort(Qt::CaseInsensitive);
RenumberElementsDialog dlg(titles, this);
if (dlg.exec() != QDialog::Accepted) return;
project_->renumberElementsBySchemeTitle(dlg.selectedSchemeTitle());
}
/**
@brief AutoNumberingManagementW::on_m_apply_folios_rb_clicked
Set From Folios Combobox
@@ -50,6 +50,7 @@ class AutoNumberingManagementW : public QWidget
void on_m_from_folios_cb_currentIndexChanged(int);
void on_m_to_folios_cb_currentIndexChanged(int);
void on_m_status_cb_currentIndexChanged(int);
void on_m_renumber_elements_pb_clicked();
void on_m_apply_folios_rb_clicked();
void on_m_apply_project_rb_clicked();
void on_buttonBox_clicked(QAbstractButton *);
@@ -305,6 +305,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_renumber_elements_pb">
<property name="text">
<string>Renumber element(s)…</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
@@ -0,0 +1,75 @@
/*
Copyright 2006-2026 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "renumberelementsdialog.h"
#include <QComboBox>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QRadioButton>
#include <QVBoxLayout>
RenumberElementsDialog::RenumberElementsDialog(const QStringList &scheme_titles, QWidget *parent)
: QDialog(parent)
, m_scheme_titles(scheme_titles)
{
setWindowTitle(tr("Renumber element(s)"));
setModal(true);
auto *vl = new QVBoxLayout(this);
auto *scope = new QGroupBox(tr("Scope"), this);
auto *scope_l = new QVBoxLayout(scope);
m_all_rb = new QRadioButton(tr("All schemes"), scope);
m_one_rb = new QRadioButton(tr("One scheme"), scope);
scope_l->addWidget(m_all_rb);
scope_l->addWidget(m_one_rb);
vl->addWidget(scope);
auto *form = new QFormLayout();
m_combo = new QComboBox(this);
m_combo->addItems(m_scheme_titles);
form->addRow(new QLabel(tr("Scheme:"), this), m_combo);
vl->addLayout(form);
m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
connect(m_buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
vl->addWidget(m_buttons);
m_all_rb->setChecked(true);
updateUi();
connect(m_all_rb, &QRadioButton::toggled, this, &RenumberElementsDialog::updateUi);
connect(m_one_rb, &QRadioButton::toggled, this, &RenumberElementsDialog::updateUi);
}
QString RenumberElementsDialog::selectedSchemeTitle() const
{
if (m_all_rb && m_all_rb->isChecked()) return QString();
return m_combo ? m_combo->currentText() : QString();
}
void RenumberElementsDialog::updateUi()
{
const bool one = m_one_rb && m_one_rb->isChecked();
if (m_combo) m_combo->setEnabled(one);
}
@@ -0,0 +1,59 @@
/*
Copyright 2006-2026 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RENUMBERELEMENTSDIALOG_H
#define RENUMBERELEMENTSDIALOG_H
#include <QDialog>
#include <QStringList>
class QComboBox;
class QRadioButton;
class QDialogButtonBox;
/**
* @brief Simple dialog to pick renumbering scope for elements.
*
* The user can choose between:
* - all element autonumbering schemes
* - one selected scheme title
*/
class RenumberElementsDialog final : public QDialog
{
Q_OBJECT
public:
explicit RenumberElementsDialog(const QStringList &scheme_titles, QWidget *parent = nullptr);
/**
* @return Empty string if "all" is selected, otherwise the chosen scheme title.
*/
QString selectedSchemeTitle() const;
private slots:
void updateUi();
private:
QStringList m_scheme_titles;
QRadioButton *m_all_rb = nullptr;
QRadioButton *m_one_rb = nullptr;
QComboBox *m_combo = nullptr;
QDialogButtonBox *m_buttons = nullptr;
};
#endif // RENUMBERELEMENTSDIALOG_H
+16 -3
View File
@@ -505,7 +505,10 @@ void BorderTitleBlock::draw(QPainter *painter)
{
//Set the QPainter
painter -> save();
QPen pen(Qt::black);
//Use a pen color that contrasts with the background
QColor border_color = Diagram::background_color.lightness() < 128
? QColor(Qt::white) : QColor(Qt::black);
QPen pen(border_color);
painter -> setPen(pen);
painter -> setBrush(Qt::NoBrush);
@@ -893,10 +896,20 @@ void BorderTitleBlock::updateDiagramContextForTitleBlock(
// An empty page-level value means the variable was auto-added to the
// folio's Custom tab (#495) but never actually set by the user, so it
// must not shadow a real project-level value of the same name (#531).
//
// That guard has to stop short of removing the key outright, though
// (#973). TitleBlockTemplate::interpreteVariables() only replaces a
// "%name"/"%{name}" placeholder when "name" is a key in this context at
// all -- an unset variable that never makes it in is left as its own
// literal placeholder text in the rendered title block, not blank.
// So an empty page-level value is skipped only when a real project-level
// one is already there to show through; otherwise it still goes in
// empty, which is what makes the placeholder resolve to nothing.
DiagramContext context = initial_context;
foreach (QString key, additional_fields_.keys()) {
if (!additional_fields_[key].toString().isEmpty())
context.addValue(key, additional_fields_[key]);
const QVariant value = additional_fields_[key];
if (!value.toString().isEmpty() || !context.contains(key))
context.addValue(key, value);
}
// ... overridden by the historical and/or dynamically generated fields
+13
View File
@@ -499,6 +499,7 @@ void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> lis
horiz_rotate_text = cp.horiz_rotate_text;
m_vertical_alignment = cp.m_vertical_alignment;
m_horizontal_alignment = cp.m_horizontal_alignment;
style = cp.style;
return;
}
@@ -555,6 +556,18 @@ void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> lis
m_dash_size = i_value;
equal = true;
//style
Qt::PenStyle pen_style;
pen_style = clist.first().style;
for(ConductorProperties cp : clist)
{
if (cp.style != pen_style)
equal = false;
}
if (equal)
style = pen_style;
equal = true;
//text
s_value = clist.first().text;
for(ConductorProperties cp : clist)
+74 -26
View File
@@ -17,6 +17,8 @@
*/
#include "projectdatabase.h"
#include "sqlreadonly.h"
#include "../diagram.h"
#include "../diagramposition.h"
#include "../elementprovider.h"
@@ -28,13 +30,15 @@
#include "../qetproject.h"
#include <QLocale>
#include <QFile>
#include <QRegularExpression>
#include <QSqlError>
#include <QSqlDriver>
#include <QSqlError>
#include <sqlite3.h>
/**
@brief projectDataBase::projectDataBase
Default constructor
@@ -208,6 +212,12 @@ bool projectDataBase::isReadOnlySelect(const QString &query, QString *error)
*/
QSqlQuery projectDataBase::newQuery(const QString &query, QString *error) {
QString reason;
// First gate: which kind of statement is acceptable here at all. A
// textual check is the right tool for that and the wrong tool for
// anything else -- see isReadOnlySelect()'s own comment. It is what
// keeps ATTACH, BEGIN and PRAGMA out, none of which SQLite itself
// considers writes.
if (!isReadOnlySelect(query, &reason)) {
qWarning().noquote() << "projectDataBase::newQuery: rejected query:" << reason << "--" << query;
if (error) {
@@ -215,6 +225,24 @@ QSqlQuery projectDataBase::newQuery(const QString &query, QString *error) {
}
return QSqlQuery(m_data_base);
}
// Second gate, and the one that actually enforces read-only: SQLite is
// asked about the statement it compiled, instead of the text being read
// for clues. The first gate cannot see through a CTE prefix --
// "WITH x AS (SELECT 1) DELETE FROM element" starts with WITH, contains
// no semicolon, and deletes every row. That matters beyond the
// custom-query box, because this path is reachable from a file: a
// <graphics_table>'s saved <query> is read straight out of the .qet by
// ProjectDBModel::fromXml() and executed by fillValue(), so opening or
// exporting a project someone else produced would have been enough.
if (!QETSql::isSingleReadOnlyStatement(sqliteHandle(&m_data_base), query, &reason)) {
qWarning().noquote() << "projectDataBase::newQuery: rejected query:" << reason << "--" << query;
if (error) {
*error = reason;
}
return QSqlQuery(m_data_base);
}
return QSqlQuery(query, m_data_base);
}
@@ -291,10 +319,23 @@ void projectDataBase::addElement(Element *element)
void projectDataBase::removeElement(Element *element)
{
m_content_changed = true;
bool changed = false;
m_remove_element_query.bindValue(":uuid", element->uuid().toString());
if(!m_remove_element_query.exec()) {
qDebug() << "projectDataBase::removeElement remove error : " << m_remove_element_query.lastError();
if (m_remove_element_query.exec()) {
changed = true;
} else {
qDebug() << "projectDataBase::removeElement remove error : " << m_remove_element_query.lastError();
}
m_remove_element_info_query.bindValue(":uuid", element->uuid().toString());
if (m_remove_element_info_query.exec()) {
changed = true;
} else {
qDebug() << "projectDataBase::removeElement remove element_info error : " << m_remove_element_info_query.lastError();
}
if (changed) {
emit dataBaseUpdated();
}
}
@@ -1131,6 +1172,21 @@ void projectDataBase::prepareQuery()
m_remove_element_query = QSqlQuery(m_data_base);
m_remove_element_query.prepare(remove_element);
//REMOVE ELEMENT INFO
//element_info has no ON DELETE CASCADE (foreign keys aren't
//enforced by this connection), so removeElement() must clear it
//explicitly. Without this, the row is orphaned under the removed
//element's uuid, and re-adding an element with that same uuid
//later -- undo of this same removal, or a redo replaying it --
//hits element_info's PRIMARY KEY constraint on element_uuid: the
//element re-add succeeds, but its element_info insert silently
//fails and is lost. removeDiagram()'s cascade already clears this
//table when a whole folio goes, but that does not run for a
//single element removed on its own.
QString remove_element_info("DELETE FROM element_info WHERE element_uuid=:uuid");
m_remove_element_info_query = QSqlQuery(m_data_base);
m_remove_element_info_query.prepare(remove_element_info);
//UPDATE ELEMENT INFO
QString update_str("UPDATE element_info SET ");
for (auto string : QETInformation::elementInfoKeys()) {
@@ -1245,7 +1301,6 @@ void projectDataBase::bindDiagramInfoValues(QSqlQuery &query, Diagram *diagram)
}
}
#ifdef QET_EXPORT_PROJECT_DB
/**
@brief projectDataBase::sqliteHandle
@param db
@@ -1263,6 +1318,7 @@ sqlite3 *projectDataBase::sqliteHandle(QSqlDatabase *db)
return handle;
}
#ifdef QET_EXPORT_PROJECT_DB
/**
* @brief projectDataBase::exportDb
@@ -1298,27 +1354,19 @@ void projectDataBase::exportDb(projectDataBase *db,
return;
}
QString connection_name("export_project_db_" % db->project()->uuid().toString());
if (true) //Enter in a scope only to nicely use QSqlDatabase::removeDatabase just after the end of the scope
{
auto file_db = QSqlDatabase::addDatabase("QSQLITE", connection_name);
file_db.setDatabaseName(path_);
if (!file_db.open()) {
return;
}
auto memory_db_handle = sqliteHandle(&db->m_data_base);
auto file_db_handle = sqliteHandle(&file_db);
auto sqlite_backup = sqlite3_backup_init(file_db_handle, "main", memory_db_handle, "main");
if (sqlite_backup)
{
sqlite3_backup_step(sqlite_backup, -1);
sqlite3_backup_finish(sqlite_backup);
}
file_db.close();
// VACUUM INTO requires the destination not to exist. QFileDialog may ask
// about overwriting, but it does not remove the existing file for us.
if (QFile::exists(path_) && !QFile::remove(path_)) {
qWarning() << "Unable to replace project database export:" << path_;
return;
}
// VACUUM INTO creates a standalone copy of the current database without
// requiring access to the SQLite driver's native connection handle.
const auto escaped_path = path_.replace("'", "''");
QSqlQuery query(db->m_data_base);
if (!query.exec("VACUUM INTO '" % escaped_path % "'")) {
qWarning() << "Unable to export project database:" << query.lastError().text();
}
QSqlDatabase::removeDatabase(connection_name);
}
#endif
+28 -2
View File
@@ -29,7 +29,7 @@ class QETProject;
class Diagram;
class Conductor;
class Terminal;
class sqlite3;
struct sqlite3;
/**
@brief The projectDataBase class
@@ -61,6 +61,26 @@ class projectDataBase : public QObject
QETProject *project() const;
QSqlQuery newQuery(const QString &query = QString(), QString *error = nullptr);
static bool isReadOnlySelect(const QString &query, QString *error = nullptr);
/**
The most rows any caller reads out of one query result.
A SELECT is not bounded by how much data the project holds:
SQLite produces rows lazily, so a query that never stops
producing them makes the loop that reads them never stop
either. A recursive CTE does exactly that in one line, and
a <graphics_table>'s <query> is stored in the .qet and run
on load -- so the text can arrive from a file rather than
from the person at the keyboard, and opening that file is
the whole attack.
100000 is far above any real result: the largest table in
the shipped examples is 396 rows. It is a backstop, not a
page size -- a caller that hits it has almost certainly
been handed something it should not run to completion, and
says so rather than truncating quietly.
*/
static constexpr int MaxResultRows = 100000;
QSqlDatabase database() const {return m_data_base;}
int excludedConductorCount() const;
@@ -119,6 +139,7 @@ class projectDataBase : public QObject
QSqlQuery m_insert_elements_query,
m_insert_element_info_query,
m_remove_element_query,
m_remove_element_info_query,
m_update_element_query,
m_insert_diagram_query,
m_remove_diagram_query,
@@ -135,9 +156,14 @@ class projectDataBase : public QObject
m_cascade_remove_conductor_query,
m_cascade_remove_element_query;
public:
// Deliberately outside the QET_EXPORT_PROJECT_DB guard below:
// newQuery() needs the raw connection to ask SQLite whether a
// query only reads, and that check runs in every build.
static sqlite3 *sqliteHandle(QSqlDatabase *db);
#ifdef QET_EXPORT_PROJECT_DB
public:
static sqlite3 *sqliteHandle(QSqlDatabase *db);
static void exportDb(projectDataBase *db,
QWidget *parent = nullptr,
const QString &caption = QString(),
+134
View File
@@ -0,0 +1,134 @@
/*
Copyright 2006-2026 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sqlreadonly.h"
#include <QCoreApplication>
#include <sqlite3.h>
namespace QETSql {
/**
@brief QETSql::isSingleReadOnlyStatement
Ask SQLite itself whether @p query is exactly one statement, and whether
that statement only reads.
Why SQLite is asked rather than the text inspected: a check on the
query's first keyword cannot see what the statement actually does.
SQLite has allowed a CTE prefix in front of a data-modifying statement
since 3.8.3, so
@code
WITH x AS (SELECT 1) DELETE FROM element
@endcode
begins with WITH, contains no semicolon, and deletes every row.
sqlite3_stmt_readonly() reports on the statement SQLite compiled, not
on how it was spelled, so the same query is correctly refused here
while an ordinary WITH ... SELECT still passes.
The statement is compiled and immediately finalised; sqlite3_prepare_v2()
does not run it, so nothing is executed to reach this verdict.
This is a read-only test, NOT a statement-type allowlist: SQLite
considers ATTACH, BEGIN and several PRAGMAs read-only too, because none
of them change the contents of the database. Callers that need to
restrict which *kind* of statement is acceptable must say so separately
-- projectDataBase::newQuery() keeps isReadOnlySelect() in front of this
for exactly that reason.
@param handle the connection the query would run on. A null handle is
refused rather than waved through: without it there is nothing to ask,
and guessing from the text is the weakness this exists to replace.
@param query the raw SQL text
@param error set to a human-readable reason when this returns false
@return true if @p query is a single, read-only statement
*/
bool isSingleReadOnlyStatement(sqlite3 *handle, const QString &query, QString *error)
{
if (error) {
error->clear();
}
if (!handle) {
if (error) {
*error = QCoreApplication::translate("QETSql",
"Impossible de vérifier la requête : "
"aucune connexion SQLite disponible.");
}
return false;
}
const QByteArray utf8 = query.toUtf8();
sqlite3_stmt *statement = nullptr;
const char *tail = nullptr;
if (sqlite3_prepare_v2(handle, utf8.constData(), utf8.size(),
&statement, &tail) != SQLITE_OK)
{
if (error) {
*error = QCoreApplication::translate("QETSql",
"Requête SQL invalide : %1")
.arg(QString::fromUtf8(sqlite3_errmsg(handle)));
}
sqlite3_finalize(statement);
return false;
}
// Whitespace or a bare comment compiles successfully to no statement
// at all, and sqlite3_stmt_readonly() must not be handed that.
if (!statement) {
if (error) {
*error = QCoreApplication::translate("QETSql",
"La requête ne contient aucune instruction.");
}
return false;
}
const bool read_only = sqlite3_stmt_readonly(statement) != 0;
sqlite3_finalize(statement);
if (!read_only) {
if (error) {
*error = QCoreApplication::translate("QETSql",
"Seules les requêtes en lecture seule sont autorisées : "
"cette requête modifierait la base de données.");
}
return false;
}
// tail points just past the first statement, semicolon included.
// Anything left once semicolons and spacing are stripped is a second
// statement -- caught structurally here, where "SELECT ';'" is a
// perfectly ordinary query rather than a suspicious string.
if (tail) {
QString rest = QString::fromUtf8(tail);
rest.remove(QLatin1Char(';'));
if (!rest.trimmed().isEmpty()) {
if (error) {
*error = QCoreApplication::translate("QETSql",
"Une seule requête est autorisée.");
}
return false;
}
}
return true;
}
} // namespace QETSql
+43
View File
@@ -0,0 +1,43 @@
/*
Copyright 2006-2026 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SQLREADONLY_H
#define SQLREADONLY_H
#include <QString>
struct sqlite3;
/**
Deciding whether a piece of SQL only reads.
Deliberately its own translation unit, depending on nothing but QString
and SQLite: it is the enforcement point for every query QElectroTech
runs against a project database, including queries that arrive from
outside the application (a .qet file's saved report/table query), so it
is worth being able to test it in isolation -- see
tests/qttest/tst_sqlreadonly.cpp, which links this file and nothing
else of QElectroTech.
*/
namespace QETSql {
bool isSingleReadOnlyStatement(sqlite3 *handle,
const QString &query,
QString *error = nullptr);
}
#endif // SQLREADONLY_H
+10 -7
View File
@@ -26,6 +26,7 @@
#include "diagramposition.h"
#include "factory/elementfactory.h"
#include "qetapp.h"
#include "qetpalette.h"
#include "qetgraphicsitem/ViewItem/qetgraphicstableitem.h"
#include "qetgraphicsitem/conductor.h"
#include "qetgraphicsitem/conductortextitem.h"
@@ -283,10 +284,11 @@ void Diagram::drawBackground(QPainter *p, const QRectF &r) {
* if background color is black,
* then grid spots shall be white,
* else they shall be black in color.
* A view that shows the sheet with its lightness inverted
* gets softer dots, see QET::Palette::gridDotColor.
*/
QPen pen;
Diagram::background_color == Qt::black? pen.setColor(Qt::white)
: pen.setColor(Qt::black);
pen.setColor(QET::Palette::gridDotColor(Diagram::background_color, m_inverted_lightness));
pen.setCosmetic(true);
p->setPen(pen);
@@ -1707,10 +1709,7 @@ bool Diagram::fromXml(QDomElement &document,
//Get the top left corner of the rectangle that contain all added items
QRectF items_rect;
for (auto item : added_items) {
items_rect = items_rect.united(
item->mapToScene(
item->boundingRect()
).boundingRect());
items_rect = items_rect.united(item->mapToScene(item->boundingRect()).boundingRect());
}
QPointF point_ = items_rect.topLeft();
@@ -1718,8 +1717,12 @@ bool Diagram::fromXml(QDomElement &document,
position.y() - point_.y()));
//Translate all added items
for (auto qgi : added_items)
for (auto qgi : added_items) {
qgi->setPos(qgi->pos() += pos_);
}
}
else
{
}
// Load conductor
+14
View File
@@ -123,6 +123,7 @@ class Diagram : public QGraphicsScene
qreal diagram_qet_version_;
bool draw_grid_;
bool m_inverted_lightness = false;
bool use_border_;
bool draw_guides_;
QList<Diagram::Guide> m_guides_list;
@@ -222,6 +223,7 @@ class Diagram : public QGraphicsScene
ExportProperties applyProperties(const ExportProperties &);
void setDisplayGrid(bool);
bool displayGrid();
void setInvertedLightness(bool);
void setDisplayGuides(bool);
bool displayGuides();
void updateProjectGuides(const QList<GuideProperties> &guides);
@@ -355,6 +357,18 @@ inline void Diagram::setDisplayGrid(bool dg) {
draw_grid_ = dg;
}
/**
@brief Diagram::setInvertedLightness
Tell the diagram whether the view painting it will show the result
with its lightness inverted (PaletteGraphicsView on a dark palette).
drawBackground draws a softer grid in that case. Printing
and export never set this.
@param inverted
*/
inline void Diagram::setInvertedLightness(bool inverted) {
m_inverted_lightness = inverted;
}
/**
@brief Diagram::displayGrid
@return draw_grid_ true if the grid is drawn, false otherwise.
+17 -1
View File
@@ -77,6 +77,23 @@ void PasteDiagramCommand::redo()
{
first_redo = false;
//Resolve a linked master/slave pair pasted together (bugtracker
//#607) before anything below renews their uuids: at this exact
//moment a pasted element's tmp_uuids_link still holds its
//source's original partner uuid, which still equals the
//not-yet-renewed uuid of that partner's own pasted copy if it
//was carried along in the same batch. Scoped to this batch only
//(not a project-wide search), so a pair pasted together links to
//each other and not to an original element left elsewhere that
//happens to still carry that same soon-to-be-replaced uuid. If
//only one half of a linked group was pasted, its link entry
//simply finds no match here and is dropped -- same "leave it
//unlinked" outcome as always.
const QList <Element *> elmts_list = content.m_elements;
for (Element *e : elmts_list) {
e->initLink(elmts_list);
}
//make new uuid for every pasted conductor, because old uuid are
//the uuid of the copied conductor
const QList <Conductor *> all_pasted_conductors = content.conductors();
@@ -85,7 +102,6 @@ void PasteDiagramCommand::redo()
}
//this is the first paste, we do some actions for the new element
const QList <Element *> elmts_list = content.m_elements;
for (Element *e : elmts_list)
{
//make new uuid, because old uuid are the uuid of the copied element
+11 -3
View File
@@ -151,8 +151,8 @@ bool DiagramContext::operator!=(const DiagramContext &dc) const
void DiagramContext::toXml(QDomElement &e, const QString &tag_name) const
{
foreach (QString key, keys()) {
if ((tag_name == "elementInformation") &&
(m_content[key].toString().trimmed().isEmpty())) {
const QString raw = m_content[key].toString();
if ((tag_name == "elementInformation") && raw.trimmed().isEmpty()) {
continue;
}
QDomElement property = e.ownerDocument().createElement(tag_name);
@@ -161,7 +161,15 @@ void DiagramContext::toXml(QDomElement &e, const QString &tag_name) const
property.removeAttribute("name");
property.setAttribute("show", m_content_show[key]);
property.setAttribute("name", key);
QDomText value = e.ownerDocument().createTextNode(m_content[key].toString().trimmed());
// Trim stray leading/trailing whitespace around real content, but
// not a value that IS whitespace: unconditionally trimming an
// all-whitespace string collapses it to "", which is silently
// indistinguishable from a value that was never set. A title-block
// custom variable set to a single space -- a workaround for #973,
// where an unset variable renders as its own literal placeholder --
// would otherwise vanish on the very next save.
const QString stored = raw.trimmed().isEmpty() ? raw : raw.trimmed();
QDomText value = e.ownerDocument().createTextNode(stored);
property.appendChild(value);
e.appendChild(property);
}
+1 -1
View File
@@ -17,7 +17,7 @@
*/
#ifndef DIAGRAM_CONTEXT_H
#define DIAGRAM_CONTEXT_H
#include "pugixml/src/pugixml.hpp"
#include "pugixml.hpp"
#include <QDomElement>
#include <QHash>
+21 -7
View File
@@ -67,7 +67,19 @@ m_preview_item(nullptr)
dummy_diagram->setDisplayGrid(false);
dummy_diagram->fromXml(diagram_node, QPointF(0, 0), false, nullptr);
// Compute bounding rect of TOP-LEVEL items only (matching fromXml's added_items logic)
// Child items (DynamicElementTextItem, Terminal) are NOT included - they move with parents
QRectF top_level_rect;
for (auto *item : dummy_diagram->items()) {
if (!item->parentItem()) {
top_level_rect = top_level_rect.united(
item->mapToScene(item->boundingRect()).boundingRect());
}
}
m_items_top_left = top_level_rect.topLeft();
QRectF scene_rect = dummy_diagram->itemsBoundingRect();
if (!scene_rect.isEmpty()) {
QPixmap pixmap(scene_rect.toAlignedRect().size());
pixmap.fill(Qt::transparent);
@@ -80,10 +92,11 @@ m_preview_item(nullptr)
}
}
if (m_preview_item) {
m_preview_item->setPos(Diagram::snapToGrid(pos));
m_preview_item->setOpacity(0.6);
m_diagram->addItem(m_preview_item);
if (m_preview_item) {
QPointF snapped = Diagram::snapToGrid(pos);
m_preview_item->setPos(snapped);
m_preview_item->setOpacity(0.6);
m_diagram->addItem(m_preview_item);
m_running = true;
}
@@ -117,6 +130,7 @@ void DiagramEventAddMacro::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
if (m_preview_item) {
const auto pos_{Diagram::snapToGrid(event->scenePos())};
m_preview_item->setPos(pos_);
if (m_status_bar) {
@@ -141,7 +155,8 @@ void DiagramEventAddMacro::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
emit finish();
}
else if (event->button() == Qt::LeftButton) {
addMacro(Diagram::snapToGrid(event->scenePos()));
QPointF snapped = Diagram::snapToGrid(event->scenePos());
addMacro(snapped);
}
}
event->setAccepted(true);
@@ -238,10 +253,9 @@ void DiagramEventAddMacro::addMacro(QPointF final_pos)
if (!diagram_node.isNull()) {
QDomElement cloned_node = diagram_node.cloneNode(true).toElement();
DiagramContent pasted_content;
m_diagram->fromXml(cloned_node, final_pos, false, &pasted_content);
m_diagram->fromXml(cloned_node, final_pos + m_items_top_left, false, &pasted_content);
m_diagram->refreshContents();
// Prevent PasteDiagramCommand from erasing labels (BMK)
@@ -40,6 +40,7 @@ private:
QDomDocument m_macro_doc;
QGraphicsPixmapItem *m_preview_item;
QPointer<QStatusBar> m_status_bar;
QPointF m_items_top_left; // top-left of bounding rect of top-level items in the macro (for correct placement offset)
};
#endif // DIAGRAMEVENTADDMACRO_H
+32 -15
View File
@@ -22,6 +22,7 @@
#include "../qetapp.h"
#include "../qetdiagrameditor.h"
#include "../qetgraphicsitem/conductor.h"
#include "../qetproject.h"
#include <QSettings>
@@ -40,6 +41,7 @@
DiagramEventAddPaste::DiagramEventAddPaste(Diagram *diagram, const QPointF &start_pos) :
DiagramEventInterface(diagram)
{
Q_UNUSED(start_pos); // items stay at their original XML position
//DiagramEventInterface::init() is called by Diagram::setEventInterface
//only when it is replacing an earlier interface, so call it here as
//DiagramEventAddMacro does.
@@ -51,8 +53,25 @@
QDomDocument document_xml;
if (!document_xml.setContent(clipboard_text)) return;
//Batch the database work the same way project loading does
//(QETProject::readProjectXml): without this, every addItem()
//below emits dataBaseUpdated(), which makes each connected
//table model re-run its full SQL query -- ~77 queries for a
//typical paste, i.e. the multi-second stall on Ctrl+V.
auto *db = m_diagram->project() ? m_diagram->project()->dataBase() : nullptr;
if (db) {
db->blockSignals(true);
db->setUpdateBlocked(true);
}
//Load items at their original XML coordinates.
m_diagram->fromXml(document_xml, QPointF(), false, &m_content);
if (db) {
db->blockSignals(false);
db->setUpdateBlocked(false);
db->updateDB();
}
if (!m_content.count()) return;
const QList<QGraphicsItem *> movable = m_content.items(MovableItems);
@@ -85,33 +104,23 @@
};
const QPointF grid_origin = snapGrid(top_left);
//Move the group to the cursor, rather than the cursor to the
//group. Both put the copy under the pointer, but warping the
//pointer also drags it back to the original's position, so the
//copy appears exactly on top of what was copied until the mouse
//is moved -- which is the thing pasting under the cursor was
//meant to avoid (issue #913). Taking the pointer away from
//where the user put it is also its own surprise.
m_group_origin = snapGrid(start_pos);
const QPointF offset = m_group_origin - grid_origin;
//Store each item's position after the move. moveTo() applies a
//Store each item's original position. moveTo() applies a
//grid-snapped delta from the baseline to these, so items
//preserve their layout and move in whole grid steps.
for (auto *item : movable) {
item->setPos(item->pos() + offset);
m_relative_pos.insert(item, item->pos());
}
m_group_origin = grid_origin;
//The conductors were laid out against the old terminal
//The conductors were laid out against the original terminal
//positions, so re-route them before anything is drawn.
const QList<Conductor *> conductors = m_content.conductors(DiagramContent::AnyConductor);
for (auto *conductor : conductors) {
conductor->updatePath();
}
//The baseline is known now, so moveTo() does not have to
//capture one from the first mouse movement.
//The baseline is the group's grid-snapped origin, so moveTo()
//does not have to capture one from the first mouse movement.
m_initial_cursor = m_group_origin;
m_baseline_captured = true;
@@ -125,6 +134,14 @@
if (const auto qde = QETApp::diagramEditorAncestorOf(view)) {
m_status_bar = qde->statusBar();
}
//Warp the cursor to the group's grid-snapped origin so
//the actual cursor position matches m_initial_cursor.
//Without this the first mouseMoveEvent computes a large
//delta (cursor is still at the Ctrl+V press location)
//and the items jump on first touch.
const QPoint view_pos = view->mapFromScene(m_initial_cursor);
const QPoint global_pos = view->viewport()->mapToGlobal(view_pos);
QCursor::setPos(global_pos);
}
}
showHint();
+10 -1
View File
@@ -29,7 +29,14 @@
*/
DiagramEventAddText::DiagramEventAddText(Diagram *diagram) :
DiagramEventInterface(diagram)
{}
{
//The tool is armed from the moment it is attached: the next left
//click places a text. DiagramView::keyPressEvent() asks
//Diagram::eventInterfaceIsRunning() -- which is isRunning(), i.e.
//m_running -- before letting Escape through to the tool, so without
//this the view swallows Escape and the tool cannot be cancelled.
m_running = true;
}
/**
@brief DiagramEventAddText::~DiagramEventAddText
@@ -52,6 +59,8 @@ void DiagramEventAddText::mousePressEvent(QGraphicsSceneMouseEvent *event)
event->scenePos()));
text->setTextInteractionFlags(Qt::TextEditorInteraction);
text->setFocus(Qt::MouseFocusReason);
//Placed: the tool is done before it announces it.
m_running = false;
emit finish();
event->setAccepted(true);
}
+91 -3
View File
@@ -39,7 +39,9 @@
#include "ElementsCollection/xmlelementcollection.h"
#include "NameList/nameslist.h"
#include "elementdialog.h"
#include <QApplication>
#include <QDropEvent>
#include <QPainter>
#include <QPointer>
/**
@@ -48,7 +50,7 @@
@param parent Le QWidget parent de cette vue de schema
*/
DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
QGraphicsView (parent),
PaletteGraphicsView (parent),
m_diagram (diagram)
{
grabGesture(Qt::PinchGesture);
@@ -443,6 +445,82 @@ void DiagramView::pasteHere()
paste(mapToScene(m_paste_here_pos));
}
/**
@brief DiagramView::duplicate
Copy the current selection and place the copy at @p stepOffset grid
steps from it, landing immediately rather than following the cursor
like Ctrl+V does (bugtracker #991). @p stepOffset comes from
DuplicateOffsetDialog: (1, 0) is one grid step right, (0, -1) is one
grid step up, and so on -- QET's own scene axes, X right and Y down.
No interactive placement step on purpose: the point of a duplicate
shortcut is unattended, repeatable stamping (configure the offset
once, then tap Ctrl+D to lay out a row), which following the cursor
would interrupt on every press. QET already reselects whatever a
paste just added (see PasteDiagramCommand::redo()), so the next
Ctrl+D naturally continues from the copy just placed, not the
original -- a press-and-hold row falls out of that for free, with no
special-casing needed here for "keep going from the last one".
The offset is applied by hand rather than by asking paste()/
Diagram::fromXml() to place the copy at a target position. Both of
those feed the position through Diagram::snapToGrid(), which reads
QApplication::keyboardModifiers() and rounds to the nearest PIXEL
instead of the grid whenever Ctrl is held -- and Ctrl is always held
here, this action's own shortcut being Ctrl+D. Measured the hard way
before settling on this: routing the offset through paste() first
produced copies off-grid on both axes, by an amount that tracked the
selection's own bounding-box geometry rather than being a fixed
error. fromXml() is instead called with no position at all, which
leaves every item at its source coordinates (landing the copy
exactly on top of the originals -- (0, 0) is not a position, this is
"keep the source coordinates"), and the offset is added directly
with setPos(). A plain addition cannot be off by a rounding rule
that never runs.
Conductors are not in the translated set: fromXml() itself does not
reposition them either -- they are loaded from XML after elements
are already in their final place and take their geometry from their
terminals, which have already moved with the elements that own
them. Likewise dynamic element texts are not translated separately:
they are children of their element and move with it under Qt's
normal parent-child transform.
*/
void DiagramView::duplicate(const QPoint &stepOffset)
{
if (!isInteractive() || m_diagram->isReadOnly()) return;
const QList<QGraphicsItem *> selection = m_diagram->selectedItems();
if (selection.isEmpty()) return;
QSettings settings;
const int x_grid = settings.value(QStringLiteral("diagrameditor/Xgrid"),
Diagram::xGrid).toInt();
const int y_grid = settings.value(QStringLiteral("diagrameditor/Ygrid"),
Diagram::yGrid).toInt();
const QPointF offset(stepOffset.x() * x_grid, stepOffset.y() * y_grid);
// Mirrors copy(), but does not touch the system clipboard: Ctrl+D
// should not clobber whatever the user last copied with Ctrl+C.
QDomDocument document = m_diagram->toXml(false, true);
DiagramContent pasted;
// No position argument -- see the function comment above for why
// the offset is not passed here.
m_diagram->fromXml(document, QPointF(), false, &pasted);
if (!pasted.count()) return;
const int movable = DiagramContent::Elements | DiagramContent::TextFields
| DiagramContent::Images | DiagramContent::Shapes
| DiagramContent::Tables | DiagramContent::TerminalStrip;
for (QGraphicsItem *item : pasted.items(movable))
item->setPos(item->pos() + offset);
m_diagram->clearSelection();
m_diagram->undoStack().push(new PasteDiagramCommand(m_diagram, pasted));
adjustSceneRect();
}
/**
Manage the events press click :
* click to add an independent text field
@@ -1081,6 +1159,16 @@ bool DiagramView::event(QEvent *e) {
return(QGraphicsView::event(e));
}
/**
@brief DiagramView::paintingInverted
Reimplemented from PaletteGraphicsView: tell the diagram it is being
drawn for an inverted display, so it softens its grid.
*/
void DiagramView::paintingInverted(bool inverted)
{
m_diagram->setInvertedLightness(inverted);
}
/**
@brief DiagramView::paintEvent
Reimplemented from QGraphicsView
@@ -1088,7 +1176,7 @@ bool DiagramView::event(QEvent *e) {
*/
void DiagramView::paintEvent(QPaintEvent *event)
{
QGraphicsView::paintEvent(event);
PaletteGraphicsView::paintEvent(event);
if (m_free_rubberbanding && m_free_rubberband.count() >= 3)
{
@@ -1389,7 +1477,7 @@ void DiagramView::createTemplateFromSelection()
collection_node.appendChild(collection_elmt);
} else {
qDebug() << "Warnung: Konnte XML-Definition für" << old_type << "nicht laden.";
qDebug() << "Warning: could not load XML definition for" << old_type;
}
}
}
+4 -2
View File
@@ -22,7 +22,7 @@
#include "titleblock/templatelocation.h"
#include <QClipboard>
#include <QGraphicsView>
#include "palettegraphicsview.h"
class Conductor;
class Diagram;
@@ -35,7 +35,7 @@ class QGestureEvent;
This class provides a widget to render an electric diagram in an editable,
interactive way.
*/
class DiagramView : public QGraphicsView
class DiagramView : public PaletteGraphicsView
{
Q_OBJECT
@@ -84,6 +84,7 @@ class DiagramView : public QGraphicsView
///Set for one call only, by the Escape handler, to let focus leave the view.
bool m_releasing_focus = false;
void paintEvent(QPaintEvent *event) override;
void paintingInverted(bool inverted) override;
void mousePressEvent(QMouseEvent *) override;
void mouseMoveEvent(QMouseEvent *) override;
void mouseReleaseEvent(QMouseEvent *) override;
@@ -136,6 +137,7 @@ class DiagramView : public QGraphicsView
void copy();
void paste(const QPointF & = QPointF(), QClipboard::Mode = QClipboard::Clipboard);
void pasteHere();
void duplicate(const QPoint &stepOffset);
void adjustSceneRect();
void updateWindowTitle();
void resetConductors();
@@ -17,6 +17,7 @@
*/
#include "elementpropertieseditorwidget.h"
#include "../../qet.h"
#include "../../qetapp.h"
#include "../../qetinformation.h"
#include "ui_elementpropertieseditorwidget.h"
@@ -185,13 +186,13 @@ void ElementPropertiesEditorWidget::upDateInterface()
const DiagramContext &info = m_data.m_informations;
ui->m_auto_num_locked_cb->setChecked(
info.value(QStringLiteral("auto_num_locked")).toString() == QLatin1String("true"));
QET::infoFlagIsTrue(info.value(QStringLiteral("auto_num_locked")).toString()));
ui->m_potential_isolating_cb->setChecked(
info.value(QStringLiteral("potential_isolating")).toString() == QLatin1String("true"));
QET::infoFlagIsTrue(info.value(QStringLiteral("potential_isolating")).toString()));
}
ui->m_exclude_from_bom_cb->setChecked(
m_data.m_informations.value(QStringLiteral("exclude_from_bom")).toString() == QLatin1String("true"));
QET::infoFlagIsTrue(m_data.m_informations.value(QStringLiteral("exclude_from_bom")).toString()));
on_m_base_type_cb_currentIndexChanged(ui->m_base_type_cb->currentIndex());
}
+20
View File
@@ -25,6 +25,8 @@
#include "../../qetapp.h"
#include "../../qetmainwindow.h"
#include "../../recentfiles.h"
#include "../../elementscollectioncache.h"
#include "../../factory/elementpicturefactory.h"
#include "../graphicspart/customelementpart.h"
#include "../elementitemeditor.h"
#include "../styleeditor.h"
@@ -348,6 +350,24 @@ bool QETElementEditor::toLocation(const ElementsLocation &location)
tr("Impossible d'enregistrer l'élément", "message box content"));
return(false);
}
//setXml() just wrote the new drawing to disk, but the preview shown
//in the elements panel comes from two caches keyed by path+uuid that
//nothing here has told about the change: ElementPictureFactory's
//in-memory picture cache and ElementsCollectionCache's on-disk
//SQLite cache (see ElementsLocation::icon()). locationWasSaved()
//(elementscollectionwidget.cpp) re-reads the icon right after this
//call returns, but both caches still hand back the pre-edit pixmap,
//so the panel keeps showing the stale preview until the whole
//collection is reloaded. Drop and rebuild them here.
ElementPictureFactory::instance()->dropCache(location);
if (ElementsCollectionCache *cache = QETApp::collectionCache()) {
if (cache->fetchData(location)) {
cache->cacheName(location.toString(), location.uuid());
cache->cachePixmap(location.toString(), location.uuid());
}
}
return(true);
}
+24 -3
View File
@@ -674,6 +674,27 @@ void ElementsPanelWidget::duplicateDiagram()
bool erase_labels = settings.value(
"diagramcommands/erase-label-on-copy", true).toBool();
// Resolve a linked pair duplicated together against each other
// (bugtracker #607) before the loop below renews their uuids or
// clears their pending links: at this exact moment a copy's
// tmp_uuids_link still holds its source's original partner
// uuid, which still equals the not-yet-renewed uuid of that
// partner's own copy if both were duplicated together. Scoped
// to this diagram's own copies, not a project-wide search, so
// this never links back to the source elements the copies were
// made from -- if only one half of a linked pair is here, its
// link entry simply finds no match and is dropped, same as
// clearPendingLinks() used to do unconditionally for every copy.
QList<Element *> new_elements;
for (QGraphicsItem *item : new_diagram->items()) {
if (Element *elmt = dynamic_cast<Element *>(item)) {
new_elements << elmt;
}
}
for (Element *elmt : new_elements) {
elmt->initLink(new_elements);
}
for (QGraphicsItem *item : new_diagram->items()) {
if (Element *elmt = dynamic_cast<Element *>(item)) {
// The XML round-trip kept the source elements' uuids. Give the
@@ -695,9 +716,9 @@ void ElementsPanelWidget::duplicateDiagram()
new_diagram->restoreText(elmt);
}
// Clear pending links so copies don't link back to
// the source elements via stale UUIDs.
elmt->clearPendingLinks();
// initLink() above already cleared tmp_uuids_link for
// every copy, matched or not -- nothing left here that
// could link back to a stale source uuid.
// Clean up copied element data:
// 1. Slaves always lose label/formula/comment/location
+9 -19
View File
@@ -19,6 +19,7 @@
#include "QPropertyUndoCommand/qpropertyundocommand.h"
#include "diagram.h"
#include "qetapp.h"
#include "qetgraphicsitem/dynamicelementtextitem.h"
#include "qetgraphicsitem/elementtextitemgroup.h"
@@ -137,25 +138,14 @@ void ElementTextsMover::endMovement()
QString ElementTextsMover::undoText() const
{
QString undo_text;
QStringList parts;
if (m_text_count)
parts << QObject::tr("%n texte(s) d'élément", "", m_text_count);
if (m_group_count)
parts << QObject::tr("%n groupe(s) de textes", "", m_group_count);
if(m_text_count == 1)
undo_text.append(QObject::tr("Déplacer un texte d'élément"));
else if(m_text_count > 1)
undo_text.append(QObject::tr("Déplacer %1 textes d'élément").arg(m_items_hash.size()));
if (parts.isEmpty())
return QString(); // should never occur
if(m_group_count >= 1)
{
if(undo_text.isEmpty())
undo_text.append(QObject::tr("Déplacer"));
else
undo_text.append(QObject::tr(" et"));
if(m_group_count == 1)
undo_text.append(QObject::tr(" un groupe de texte"));
else
undo_text.append(QObject::tr((" %1 groupes de textes")).arg(m_group_count));
}
return undo_text;
return QObject::tr("Déplacer %1").arg(QLocale(QETApp::interfaceLanguage()).createSeparatedList(parts));
}
+7 -1
View File
@@ -32,8 +32,14 @@ class QetGraphicsTableFactory
static void createAndAddNomenclature(Diagram *diagram);
static void createAndAddSummary(Diagram *diagram);
private:
// Public so a caller that has already built and configured an
// AddTableDialog itself (never shown or exec'd -- the two
// methods above always exec() one, which the scripting API
// cannot use headlessly) can create a table from it directly.
// create() only reads settings already on the dialog; nothing
// about it depends on the dialog having been shown.
static void create(Diagram *diagram, AddTableDialog *dialog);
private:
static QetGraphicsTableItem *newTable(
Diagram *diagram,
AddTableDialog *dialog,
+30
View File
@@ -72,6 +72,15 @@ bool AddTableDialog::adjustTableToFolio() const
return ui->m_adjust_table_size_cb->isChecked();
}
/**
@brief AddTableDialog::setAdjustTableToFolio
@param set
*/
void AddTableDialog::setAdjustTableToFolio(bool set)
{
ui->m_adjust_table_size_cb->setChecked(set);
}
/**
@brief AddTableDialog::addNewTableToNewDiagram
@return
@@ -81,6 +90,15 @@ bool AddTableDialog::addNewTableToNewDiagram() const
return ui->m_add_table_and_folio->isChecked();
}
/**
@brief AddTableDialog::setAddNewTableToNewDiagram
@param set
*/
void AddTableDialog::setAddNewTableToNewDiagram(bool set)
{
ui->m_add_table_and_folio->setChecked(set);
}
/**
@brief AddTableDialog::tableName
@return
@@ -90,6 +108,18 @@ QString AddTableDialog::tableName() const
return ui->m_table_name_le->text();
}
/**
@brief AddTableDialog::setTableName
Set the name field directly, so a caller that builds this dialog to
read from (never shows or execs it -- the scripting API's addTable())
does not need a name typed by a user who was never there to type one.
@param name
*/
void AddTableDialog::setTableName(const QString &name)
{
ui->m_table_name_le->setText(name);
}
/**
@brief AddTableDialog::headerMargins
@return
+3
View File
@@ -44,9 +44,12 @@ class AddTableDialog : public QDialog
void setQueryWidget(QWidget *widget);
bool adjustTableToFolio() const;
void setAdjustTableToFolio(bool set);
bool addNewTableToNewDiagram() const;
void setAddNewTableToNewDiagram(bool set);
QString tableName() const;
void setTableName(const QString &name);
QMargins headerMargins() const;
Qt::Alignment headerAlignment() const;
+32
View File
@@ -22,6 +22,8 @@
#include "logging/eventloopwatchdog.h"
#include "logging/qetlogger.h"
#include "machine_info.h"
#include "diagram.h"
#include "palettegraphicsview.h"
#include "qet.h"
#include "qetapp.h"
#include "qetmessagebox.h"
@@ -31,6 +33,7 @@
#include <QApplication>
#include <QDomImplementation>
#include <QFont>
#include <QStyleFactory>
#include <QtConcurrentRun>
@@ -105,6 +108,19 @@ int main(int argc, char **argv)
// from Qt 6.12 on; opt in explicitly for older Qt 5/6.
QDomImplementation::setInvalidDataPolicy(
QDomImplementation::ReturnNullNode);
#ifdef Q_OS_WIN
// "MS Shell Dlg 2" is not a font but a Windows alias, and many projects
// and settings saved on Windows carry it. Qt 5's GDI font backend let
// Windows resolve it to Tahoma; Qt 6's DirectWrite backend does not know
// the alias and falls back to Arial, so those texts come out heavier on
// screen and in exported PDFs (bugtracker #340). Resolve both aliases
// the way Windows does. Done before any application object exists so
// that the headless export and scripting runs below get it too.
QFont::insertSubstitution("MS Shell Dlg 2", "Tahoma");
QFont::insertSubstitution("MS Shell Dlg", "Microsoft Sans Serif");
#endif
//Creation and execution of the application
//HighDPI
qputenv("QT_ENABLE_HIGHDPI_SCALING", "1");
@@ -144,6 +160,22 @@ int main(int argc, char **argv)
#endif
}
// Re-apply the sheet background last picked in the diagram editor, so
// every project opened from here on -- existing or new, whichever one
// it is -- draws that background instead of the built-in default that
// would otherwise force the user to pick it again after each start.
//
// Done here rather than in main()'s first lines on purpose: the
// headless export and scripting runs above return before reaching
// this point and must keep rendering on plain white. It also has to
// happen before QETApp is constructed below, since that constructor
// already loads the projects given on the command line.
{
const QetSettings::SheetBackground sheet_background = QetSettings::sheetBackground();
PaletteGraphicsView::setCustomBackgroundColor(sheet_background.custom);
Diagram::background_color = sheet_background.color;
}
// Resolve the logger's state (log directory, session filename, open
// file handle) explicitly here, immediately before installing the
// handler -- not implicitly on whichever thread happens to log

Some files were not shown because too many files have changed in this diff Show More