Re: Nouveautés de la version de développement 0.9 and 0.100.0 -0.100.1

https://github.com/qelectrotech/qelectr … r/pull/483

ispyisail wrote:

Headless command-line export
Adds a headless (no-GUI) command-line export so projects can be rendered and
exported in batch / CI pipelines without opening the editor. This is a
long-standing request (qelectrotech.org bugtracker #171, GitHub #309; the
list export addresses @pkess's request in #162 to "export all connections as
a list").

Usage

qelectrotech --export-pdf    <project.qet> <output.pdf>
qelectrotech --export-png    <project.qet> <output_dir>
qelectrotech --export-svg    <project.qet> <output_dir>
qelectrotech --export-cables <project.qet> <output.csv>
qelectrotech --export-wires  <project.qet> <output.csv>

pdf — one multi-page document, one diagram per page.
png / svg — one file per diagram, named <NN>_<title>.<ext>.
cables — wiring list (one row per conductor) as CSV.
wires — list of distinct wire numbers as CSV.
How it works
The export request is detected in main() before SingleApplication
is created, so a batch run does not attach to / focus a running GUI
instance. A plain QApplication is used (offscreen-capable).
Rendering reuses Diagram::render() over
BorderTitleBlock::borderAndTitleBlockRect() — the same path the GUI export
uses — so output matches the on-screen drawing.
The image/PDF code lives in a new CLIExport namespace
(sources/cli_export.{h,cpp}); main.cpp only gains a small dispatch hook.
List exports
The CSV list exports reuse the existing exporters rather than duplicating
logic:

--export-cables → WiringListExport. To make it usable headlessly,
WiringListExport::toCsv() (which mixed CSV generation with a file dialog
and file write) is refactored: a new const method toCsvString() builds and
returns the CSV, and toCsv() now calls it before doing the dialog + write.
No behavioural change to the existing GUI export.
--export-wires → ConductorNumExport::wiresNum() (already a pure string
producer).
Testing
PDF/PNG/SVG verified against native example projects (e.g.
Habitat-Schemas_developpes.qet) — output opens and matches the GUI render.
--export-cables / --export-wires verified end-to-end: both exit 0 and
produce the same CSV the GUI exporters produce.

https://github.com/qelectrotech/qelectr … r/pull/485

ispyisail wrote:

CLI export: don't draw the editor grid in PDF/PNG/SVG output
#485


https://github.com/qelectrotech/qelectr … r/pull/488

kellermorph wrote:

Fix “Exclude from auto-numbering” and “Potential isolation” tick boxes fault #482
Closed
Potential Isolation option for terminals #471

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Nouveautés de la version de développement 0.9 and 0.100.0 -0.100.1

https://github.com/qelectrotech/qelectr … r/pull/489

ispyisail wrote:

CLI: add verification & data-export tools (info, BOM, nets, links, check-elements, resave)
#489

Follow-up to #483, extending the headless CLI with six read-only tools. The structured outputs (JSON/CSV) are aimed at automation and AI-driven pipelines — the CLI is effectively QET's programmatic surface — plus an element-library validator.

| flag | output | purpose |
|------|--------|---------|
| `--info` | JSON | structural project summary: per-folio element/conductor counts, page size, free (unconnected) terminals, project totals |
| `--export-bom` | CSV | bill of materials, one row per element (from `element_nomenclature_view`, same source as the GUI BOM) |
| `--export-nets` | JSON | electrical nets (connected-terminal potentials) — connectivity ground truth, via `Conductor::relatedPotentialConductors()` |
| `--export-links` | CSV | element cross-references (master/slave/report), flagging unresolved links |
| `--check-elements` | stdout | validate one `.elmt` or a directory against the element schema (XML, root definition, bounding box, terminals); OK/WARN/FAIL, non-zero exit on failure |
| `--resave` | .qet | load and rewrite the project XML (round-trip integrity check) |

All read-only and **additive** — no change to the existing pdf/png/svg/cables/wires options. `run()` is adjusted to handle the differing argument arity (`--info` takes an optional output; `--check-elements` takes a path, not a project).

Built and verified on Qt5 + KF5 (Ubuntu). `--check-elements` validated against the full bundled element collection (0 false failures, agreeing with QET's own loader).

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Nouveautés de la version de développement 0.9 and 0.100.0 -0.100.1

https://github.com/qelectrotech/qelectr … r/pull/490
CLI: clickable cross-reference hyperlinks in PDF export
#490

Brings the GUI's clickable PDF cross-reference / folio navigation (cd76b6a) to the headless `--export-pdf` path, via a shared helper — as discussed on #483.

Two commits, bisectable per your suggested order:

**1. Extract `pdf_links.{cpp,h}` shared helper.** Moves the link-injection logic and `convertUriToGoTo()` post-processor out of `ProjectPrintWindow` into a standalone translation unit. The scene→page mapping is passed in as a `PageGeometry` (transform + `devToPdf` + source-rect lookup) so each caller supplies its own correct geometry — the helper never assumes a `QPrinter`. `ProjectPrintWindow` stays a pure caller: it builds its `PageGeometry` from the printer page layout exactly as before. No behavioural change to GUI print; no class-structure changes.

**2. Wire into CLI `exportPdf()`.** Builds the geometry from the `QPdfWriter` (96 dpi, zero margins, page sized to the diagram → scale ~1, no centering) — rebuilt from scratch, not reused from the printer path — and calls the helper per page, then post-processes after the painter closes.

**Verified** on `examples/industrial.qet` (50 pages): the exported PDF contains 304 `/GoTo` + `/FitR` internal link annotations (0 leftover `/URI`), well-formed. Builds clean on Qt5 + KF5 (Ubuntu).

Independent of the CLI tools in #489.
*Developed with assistance from Claude (Anthropic).*

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !