Repository navigation
templates
A template is a saved chunk of a sheet β the elements you had selected,
with their own symbol definitions travelling inside the file β that you can
drop back onto any sheet, in any project, as a group. QElectroTech calls them
templates in the interface and macros in the source and on disk (.qetmak);
the two words mean the same thing.
They are the right tool for the wiring block you draw over and over: a motor starter, a lighting circuit, a standard supply arrangement. An element is one symbol; a template is an arrangement of them.
To place a template, double-click it or drag it onto the sheet. A single click only selects it, and its right-click menu has no "insert" entry. Builds from before 27 September 2026 only accept the drag β there a double-click does nothing.
- On a sheet, select the items you want to keep. Anything you can select works β elements, conductors, texts, images.
- Right-click the selection β "CrΓ©er un template". The entry only appears when something is selected; right-clicking empty space gives you the sheet menu instead (properties, add/remove row or column).
- A dialog, "Enregistrer un template", asks where to put it. Pick the collection in the tree, type a name in "Nom du nouveau template", and press Save.
- A message box, Modèle enregistré (template saved), confirms the full path it was written to. The new template shows in the Modèles tab at once; builds from before 30 September 2026 only listed it after reloading the collections or restarting.
The .qetmak extension is added for you, and is hidden again when the
template is listed in the panel.
The tab is called ModΓ¨les but the collection inside it is called Macros β the two names mean the same thing. It is the user templates folder described below.
Open the Modèles tab of the elements panel (beside Collections), then either:
- double-click the template: the preview appears at the mouse pointer if it is over the sheet, otherwise in the middle of the view; or
- drag the template onto the sheet.
| Step | What happens |
|---|---|
| You double-click it, or drop it on the sheet | A semi-transparent preview of the whole template appears and follows the pointer, snapped to the grid. The template's top-left corner sits at the pointer |
| Left click | The template is placed at the preview's position |
| Right click | Placement is cancelled, nothing is added |
| Escape | Also cancels β from the moment you drop, not just after the first click |
While a placement is in progress the sheet's own right-click menu is switched off, which is why right-click cancels rather than opening a menu.
The template lands where the preview shows it, whatever part of the sheet it was saved from. In builds from before 30 September 2026 it landed as far from the pointer as its items had sat from the top-left corner of the sheet it was saved from, so a template made in the lower right of a sheet could land off the sheet (PR #1171).
What does not place a template:
| Action | Result |
|---|---|
| Single click on the name | selects the row, nothing else |
| Double click, with Double-cliquer dans la collection ouvre l'Γ©diteur d'Γ©lΓ©ment au lieu de l'insΓ©rer ticked | nothing: that preference makes a double-click open the element editor, and a template has no editor. See Managing collections |
| Right-click menu on the template | offers delete (and folder management), never "insert" |
Templates live in their own collection, separate from elements:
| Path | |
|---|---|
| Default |
(application data folder)/macros/
|
| Linux | ~/.local/share/QElectroTech/QElectroTech/macros/ |
| Windows | %APPDATA%\QElectroTech\QElectroTech\macros\ |
| macOS | ~/Library/Application Support/QElectroTech/QElectroTech/macros/ |
The exact base is Qt's application data location, so a portable or sandboxed install (Snap, Flatpak, AppImage with a custom home) will resolve it inside that sandbox rather than in your normal home folder.
You can move the folder elsewhere β a shared network drive, for instance, so a team draws from the same template library β in Preferences β General, in the same group of settings that relocates the custom element and title-block collections. QElectroTech falls back to the default folder if the configured path no longer exists, so a missing network share leaves you with an empty template list rather than an error.
Each template is one file. Copying a .qetmak into the folder makes it appear
in the panel, and deleting the file removes it; you can also create
subfolders to organise them.
A template is XML, and it carries the symbol definitions with it. That is what makes a template portable between projects and between machines: the receiving project does not need the elements to be installed already.
<qet_macro>
<collection>
<element path="import/lampe_pe.elmt">
<definition height="50" hotspot_x="15" hotspot_y="25" ...>
...the full symbol drawing...
</definition>
</element>
</collection>
<diagram_content>
<diagram projectId="0" ...>
<elements>
...the items you had selected...
</elements>
</diagram>
</diagram_content>
</qet_macro>| Part | What it holds |
|---|---|
<collection> |
one <element> per distinct symbol used, with its complete definition β a template using six identical relays stores the relay once |
<diagram_content> |
the selected content itself, as a normal sheet fragment |
type attributes |
rewritten to macro://β¦ so the placed items resolve against the definitions carried in the file |
A template holding a single lamp is around 3 KB, almost all of it the symbol definition.
Template (.qetmak) |
Element (.elmt) |
Copy & paste | |
|---|---|---|---|
| Holds several items and their wiring | yes | no β one symbol | yes |
| Survives closing the project | yes | yes | no, clipboard only |
| Reusable across projects | yes | yes | only while both are open |
| Carries symbol definitions with it | yes | n/a | no |
| Placed by | double-click or drag from the Modèles tab | double-click or drag from the Collections tab | Ctrl+V |
| Edited after saving | re-create it from a new selection | element editor | n/a |
There is no template editor: to change a template, place it, adjust it on a sheet, and save a new template over the old name.
- No menu or keyboard route to place one. Double-click or drag it from the Modèles tab. A (Insérer le dernier élément) and Enter repeat the last placed symbol, never a template.
- Templates cannot be edited in place. Re-create them from a corrected selection.
- No preview thumbnail in the panel β templates are listed by name only, so the names you choose are the only clue to what they contain β issue #932.
- If you are running a development build from before 13 September 2026, dragging a template onto a sheet does nothing on Qt 6 builds; that was fixed in PR #853. Update before concluding the feature is broken.
"I select my template in the list and nothing lands on the sheet." Expected: selecting does nothing. Double-click it, or drag it onto the sheet. If double-clicking does nothing either, check the preference above, or the build date.
"I dragged it and still nothing happened." Check the build date β see the Qt 6 note above. Then check you dropped inside the sheet's drawing area rather than the grey surround.
"The template landed far from where I clicked." That is the bug fixed on 30 September 2026 (Β§2). Update, or move the placed items afterwards.
"The preview is stuck to my pointer." A placement is in progress: left click to place it, or press Escape or right click to cancel.
"My templates have disappeared."
The templates folder is configurable in Preferences β General. If it points at
a drive that is not mounted, QElectroTech shows an empty collection. Check the
path, or copy the .qetmak files into the default folder above.
- Managing collections β the panel the ModΓ¨les tab lives in, and how folders and writability work
- Using the element editor β for building the single symbols a template is assembled from
- Preferences reference β where the templates folder is set
- Grouping items β keeping items together on the sheet, rather than saving them for reuse
- Tips & Tricks β other ways to speed up repeated drawing
Getting Started
π Languages β English Β· FranΓ§ais Β· Deutsch
Windows without admin rights β the portable archive, no installer
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
Development
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
Vision β proposal, under discussion
