Skip to content
ispyisail edited this page Oct 7, 2026 · 11 revisions

Using the element editor

Linking elements documents the .elmt file that results from element authoring β€” master/slave/terminal, contact groups, information flags. This page documents the other half: actually drawing an element in QET's built-in editor.

Source: sources/editor/ (~22,900 lines) β€” qetelementeditor.cpp (the window), elementscene.cpp (the canvas), graphicspart/ (one class per drawable primitive), esevent/ (the interactive placement tools), ui/ (the property panels).


1. Starting an element

New element opens a three-step wizard:

  1. Parent category β€” where in the collection tree the element will live.
  2. File name β€” the *.elmt extension is added automatically if you leave it off.
  3. Name(s) β€” the element's display name, one per language; only your current UI language is required, the rest can be filled in later.

The editor opens on an empty canvas. There is no separate "set the element's size" step β€” see Β§3.

You can also open an existing element to edit it, or start from a DXF file imported as line art into a new element via File β†’ Import a DXF file β€” a way to trace CAD geometry rather than draw from scratch.


2. The drawing tools

One toolbar button per primitive type:

Tool Draws
Line a straight segment
Rectangle click-drag a corner-to-corner rectangle
Ellipse click-drag a bounding box
Polygon click each vertex; double-click to finish, right-click to undo the last point
Arc a circular arc
Text a fixed label, not editable once placed on a diagram
Dynamic text field a text item that can be edited per-instance on a diagram β€” this is what element information and formula variables attach to, see Variables & formulas
Terminal a connection point

Placing terminals

A terminal needs an orientation β€” which side of the body it points out of, and therefore which direction a wire may approach it from. While placing one, press Space to rotate it through the four cardinal directions before clicking to commit.

After you place a terminal, the tool immediately starts another one at the same orientation β€” convenient for a row of same-facing pins. Right-click ends the tool.

Terminal type and function (generic, fuse, diode, ground…) are set afterward in the terminal's own properties, not while placing it β€” see Linking elements Β§4.

Give every terminal a name in its properties too, and never the same name twice in one symbol β€” see Β§5, Terminal names.


3. Width, height and hotspot are computed, not typed

There is no dialog where you enter the element's width, height or hotspot. They are derived automatically from whatever you've drawn, recalculated on every save:

  • The bounding rectangle of every primitive on the canvas is measured.
  • Width and height are rounded up to the next multiple of 10 β€” with a quirk: if the remainder is more than 6, it rounds up an extra ten. A drawing 42 px wide becomes 50 (this is the exact case Elements XML uses as its rounding example β€” now you know where the number comes from).
  • The hotspot is placed at the centre of that rounded bounding box.

The gotcha: drawing away from the scene origin moves your parts

If your drawing doesn't straddle the scene's origin point (0,0), QET re-centres every primitive on save so that it does β€” parts actually move on the canvas, not just in the saved coordinates. Draw comfortably near the crosshair at the canvas centre and this never surprises you; draw far off to one side and a save can visibly shift everything.


4. Saving

Three related actions, easy to confuse:

Action Destination
Save wherever the element was opened from β€” a collection location if opened from the elements panel, a plain file path if opened by file
Save As asks for a collection location (category + name), the normal way to save a new element into your custom collection
Save As File asks for a plain filesystem path, outside any collection

All three run the same validation first (Β§5); a failed check blocks the save and none of them writes anything.


5. What's checked before saving

QET validates the element and reports problems as either a warning (save proceeds) or an error (save is blocked):

Condition Severity
No terminals at all warning β€” unless the element is a sheet report, a conductor definition, or a thumbnail, which are allowed to have none
A sheet report element has anything other than exactly one terminal error
A conductor definition element has anything other than exactly one terminal error

An element with zero terminals still saves β€” you'll just get a dialog telling you it can't be wired to anything, which is sometimes exactly what you want (a thumbnail, a text block, a title-block decoration).

Terminal names

Every terminal of a symbol should have a name, and no two terminals of the same symbol may share one. The wiring list (what connects to what) names each end of a wire as symbol label : terminal name, so two terminals both called N on -K1 give two different wires the same address, -K1:N, and nobody wiring the panel can tell them apart. IEC 61666 Β§4.1 states the rule: "Each terminal shall be unambiguously identified with respect to the object itself."

Condition Severity
Two or more terminals share a name error β€” the save is blocked, and the terminals involved are selected so you can find them
One or more terminals have no name warning β€” the save goes ahead. Sheet reports, conductor definitions and thumbnails are not checked

The error dialog when saving a Shelly Pro 2PM with three terminals named N: "Plusieurs bornes portent le mΓͺme nom : N Γ—3", with the fix "Donner un nom unique Γ  chaque borne, par exemple N.1 et N.2"

How names are compared:

  • Spaces at the start and end are ignored: PE and PE are the same name.
  • Case counts: n and N are different names.
  • Unnamed terminals are counted as unnamed, never as duplicates of each other.

Real devices sometimes print the same marking twice. Some Shelly relays have two terminals marked N or two marked L, bridged inside the device. The marking on the device is still not enough for the drawing: IEC 61666 Β§4.2 says that when the manufacturer's marking is insufficient to tell terminals apart, you assign your own designations and explain them. Give each one a distinct name that keeps the printed marking, for example N.1 and N.2.

The warning dialog for a feed-through terminal whose two terminals have no name: "2 borne(s) sans nom"

Turning the check off

Configuration β†’ Configurer QElectroTech β†’ GΓ©nΓ©ral β†’ Editor β†’ VΓ©rifier les noms des bornes Γ  l'enregistrement (Check terminal names when saving). It is on by default. Unticked, neither the error nor the warning appears and every symbol saves as before.

The Editor tab of the configuration dialog, with the "VΓ©rifier les noms des bornes Γ  l'enregistrement" checkbox ticked

The setting belongs to your QElectroTech installation, not to the symbol or the project. The command-line check (--check-elements, see Automating QElectroTech) ignores it and always checks names.


6. The panels around the canvas

Panel What it gives you
Parties every primitive in the element, as a list. Selecting in the list selects on the canvas and the other way round β€” the reliable way to reach a primitive buried under another one
Profondeur the stacking order. A filled shape drawn last hides what is under it; this is where you push it back
Status bar a live X / Y readout of the pointer, in the element's own coordinates

The parts list gives up past 200 primitives. Above that it shows "Trop de primitives, liste non gΓ©nΓ©rΓ©e" with the count instead of the list, because building it for a very complex element is slow. The element is fine and still editable β€” only the list is withheld. The ceiling is the setting elementeditor/max-parts-element-editor-list, so it can be raised if you routinely draw elements that big.

The background frame

The canvas is an endless grid of dots, which gives nothing to judge how big a symbol will look on a real sheet. Affichage β–Έ Afficher le cadre de fond (View β–Έ Show background frame), also a button on the view toolbar, draws a dashed frame centred on the symbol's origin, the size of a default sheet's drawing area: 1020 Γ— 640.

Affichage β–Έ Taille du cadre de fond... (Background frame size) sets another width and height, for example the size of one cell or of the space a symbol usually gets. Both settings are remembered between sessions; the frame is off by default.

The symbol editor with a relay symbol in the middle of a large dashed blue frame; the frame toggle is checked on the toolbar

The frame is only drawn on screen. It is not saved in the symbol, and it does not appear in an SVG export.

Since PR #1164 (merged 2026-09-29).


7. Getting drawings in and out

Action What it does
Importer un Γ©lΓ©ment Γ  redimensionner opens another .elmt and brings it in scaled by any X and Y factor, using the separate QET_ElementScaler program (asked for if it is not installed) β€” the way to build a variant of an existing symbol rather than redrawing it. To scale the element you have open and keep its terminals on the grid, see Β§8
Importer un fichier dxf brings DXF geometry in as primitives β€” see DXF import & export
Exporter en SVG writes the element out as an SVG image, for documentation rather than for QElectroTech
Recharger l'Γ©lΓ©ment re-reads the element from disk. If you have unsaved changes it warns first, and says plainly that reloading loses them

An element opened from a collection you cannot write to opens read-only: the title bar says so, and saving is refused. Use Save as to put a copy somewhere writable β€” see Managing collections for which collections are writable.


8. Reshaping a primitive

Select a primitive and drag its handles. The modifiers are the same ones the diagram editor uses, and they are worth knowing here because the element editor is where you use them most:

Hold While dragging
Ctrl ignore the grid β€” fine positioning
Shift keep proportions when resizing; snap to 15Β° when rotating or skewing
Alt on a corner turn a rectangle or an ellipse into a polygon, so each corner moves on its own

The full list is on Mouse modifiers.

Scaling the whole element

Status: pending. This section describes PR #1378, not yet merged. Nothing here works until that lands β€” check the PR before trying any of this against your own build. This section will drop this notice once it does.

Γ‰dition β†’ Mettre l'Γ©lΓ©ment Γ  l'Γ©chelle… (Edit β†’ Scale element…) scales every part at once by Γ—0.5 to Γ—4, offering only the factors that keep the terminals on the grid. Texts, terminal names and arrows scale with it, and one undo restores the element. Which factors you get, and why, is on Grid size and element size Β§4.


9. Beyond the basics

  • PLC master tables. Setting a master element's type to PLC replaces the usual contact-budget controls with an interactive I/O table β€” see Linking elements Β§5. No element in the shipped collection currently uses this.
  • Line style (weight, colour, dash pattern) is set per-primitive from its own properties panel, not the toolbar.
  • Grid and snap work the same way as the diagram editor.

See also: Linking elements Β· Elements XML Β· DXF import & export Β· Variables & formulas Β· Mouse modifiers Β· Managing collections Β· Grid size and element size

Getting Started

Home

🌐 Languages β€” English Β· FranΓ§ais Β· Deutsch

Downloads

Windows without admin rights β€” the portable archive, no installer

Quick Start Guide

User Manual

FAQ

Tips & Tricks

Guides

Conductors β€” wire properties, what feeds which export, cables, and hops where wires cross

Wires per terminal β€” limit the wires on a terminal, chain wiring instead of stars

Printing and exporting β€” paper, PDF, images, and what each path does differently

Linking elements β€” master, slave, terminal

PLC modules β€” I/O tables and linking a wire to a specific point

Using the element editor β€” drawing tools, saving, checks

Grid size and element size β€” why symbols aren't all the same scale, and scaling one without leaving the grid

Preferences reference β€” what each settings page does

Saving and loading settings β€” your whole setup in one file, to copy or keep

Keyboard-only control β€” mouseless QET, and what still needs a mouse

Mouse modifiers β€” what Shift, Ctrl and Alt change while you drag

3D mouse β€” SpaceMouse pan, zoom and buttons

Aligning items β€” snap symbols back to the grid, or line them up

Pictures on a sheet β€” labels, crop, transparency, what they cost in the file

Arcs and curved wires β€” the Arc tool, pulling an arc in or out, rounding a corner with a fillet, dashed arcs for lighting layouts

Grouping items β€” select, move and copy several items as one

Finding your place on a sheet β€” go to a cell like B13 or 4-B7, keep the headers in sight, show the cell limits, zoom and pan

Showing and hiding kinds of items β€” hide texts, wire numbers, shapes, pictures, tables or cross-references on every sheet

Drawing faster β€” place without dragging, the S shortcut bar, command search, gestures

Customising QElectroTech β€” keys, toolbar size and contents, the gesture ring (partly pending)

Managing collections β€” folders, writability, building your own shortlist

Templates β€” reusable multi-element blocks, placed by double-click or drag

Search & Replace β€” bulk property changes

Building a nomenclature query β€” the BOM/summary table builder

Linking wires across pages β€” sheet reports

Variables & formulas β€” %f, %{label}, sequences

Auto-numbering β€” schemes, sequences, freezing

Terminal strips β€” strips, levels, bridges

Title block templates β€” the .titleblock format

Importing EPLAN parts (.edz) β€” EPLAN Data Portal

DXF import & export β€” two unrelated features, one format; command-line export and layers

The project database β€” the in-memory SQLite cache

File formats
Elements XML
Project XML
Development

Building from Source

Contributing Code

Automating QET β€” CLI, XML formats, external tools

CLI Reference β€” command line usage

JavaScript Scripting β€” --run, geometry editing, undo

MCP server β€” let an AI assistant read, verify and edit projects

Connecting an AI assistant β€” setup for Claude, Copilot, Gemini, Codex, Cursor, LM Studio

Script buttons β€” stored scripts with an icon, by hand or by an assistant

Live mode β€” an assistant working in the open project while you watch

Macro recorder β€” record a task by hand, for an assistant to script

Development Roadmap

Vision β€” proposal, under discussion

Developer Tools

About

Features

History

Community

License

Contributing to this Wiki

Clone this wiki locally