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

Building a custom nomenclature or summary table

Nomenclature (BOM) and sheet-summary tables aren't fixed layouts β€” each one is backed by a query you build interactively, over the same views The project database documents. The same builder also drives Projet β†’ Exporter au format CSV, for a report you want as a file rather than a table on a sheet.

Source: sources/dataBase/ui/elementquerywidget.{cpp,h} (nomenclature), sources/dataBase/ui/summaryquerywidget.{cpp,h} (sheet summary) β€” wired into a table's properties via projectdbmodelpropertieswidget.cpp, and into the CSV export dialog via ui/bomexportdialog.{cpp,h}.


1. Two builders, two views

Widget Queries Table it configures
ElementQueryWidget element_nomenclature_view nomenclature / BOM
SummaryQueryWidget project_summary_view sheet summary

Both work the same way: pick columns, order them, optionally filter and group, and the widget assembles the SELECT for you.


2. Picking and ordering columns

A two-list layout: available columns on one side, chosen columns on the other. Double-click (or the Add button) moves a column across; Up/Down buttons reorder the chosen list, which is also the column order the finished table renders in.


3. Filtering

Select a chosen column and set a filter on it. Seven modes:

Filter SQL it builds
No filter (column ignored for filtering)
Not empty column != ''
Empty column IS NULL OR column = ''
Contains column LIKE '%value%'
Does not contain column NOT LIKE '%value%'
Is equal column = 'value'
Is not equal column != 'value'

The first two need no value and disable the text box; the rest take one.

Which kinds of element are listed

The Type d'Γ©lΓ©ments (kind of elements) box of the nomenclature builder has one tick per kind:

Tick Lists
Tous (all) every kind below
Simples plain symbols
Borniers terminals
Organes de protection protective devices
Contacteurs et relais contactors and relays
Vignettes thumbnails
Boutons et commutateurs push buttons and switches
Automates (MAE/SPS) PLCs
Contacts esclaves contact blocks: the slave elements linked to a coil or other master (see Linking elements)

Contacts esclaves is unticked by default in a nomenclature table placed on a sheet, so tables keep the rows they had. In the CSV export (Β§7) it is ticked by default, so each contact block, which usually has its own order code, gets a row of its own β€” the same rows as --export-bom on the command line. Untick it to leave contact blocks out of the export.


4. Grouping, counting, and dropping to raw SQL

  • Group by a column, to roll up rows β€” e.g. one row per manufacturer reference instead of one per element.
  • Count β€” a running total alongside the grouping.
  • Edit SQL query β€” a checkbox that hands you the generated SELECT directly for hand-editing. This is the escape hatch for anything the column/filter builder can't express; once you've edited it by hand, the widget is just showing you raw SQL, not trying to keep the two in sync. Once you're editing raw SQL, nothing restricts the FROM clause to the view the builder normally targets β€” you can query any table the project database exposes. What is restricted, and checked whether you got here by hand-editing or by typing a query from scratch, is covered next.

5. Saving a configuration for reuse

Give the current column/filter/group setup a name and save it; load it back later rather than rebuilding a report from scratch every time. Handy for a BOM layout you use across many projects.


6. Read-only enforcement

Whatever you type into "Edit SQL query" has to be a single SELECT or WITH ... SELECT statement. This is checked at two levels:

  • As you type, the field's border turns red and a message appears underneath explaining why β€” before you've tried to run or save anything.
  • Whenever the query actually runs β€” Preview, CSV export, or inserting the table onto a sheet β€” as a second, independent check. A query that reached this widget some other way (loaded from a saved report, or from a table already placed on a sheet) is checked here too, not just the live typing feedback.

The quick check rejects a query that isn't a single statement (a trailing ; is fine, a second one after it is not) or doesn't start with SELECT/WITH. On its own that could be fooled β€” WITH x AS (SELECT 1) DELETE FROM element starts with WITH β€” so when a query runs, SQLite itself runs it in read-only mode (PRAGMA query_only) and refuses anything that would write, before any row is touched. This also covers a query stored inside a project file, which runs when the project opens.


7. Live preview, and the CSV export's own options

Projet β†’ Exporter au format CSV opens this same column/filter/SQL builder inside a dedicated export dialog, with a Preview button below it: run the current query and see the actual result in a table before deciding to save it as a CSV file. This is the export path specifically β€” inserting a table onto a sheet (Projet β†’ Ajouter une nomenclature / Ajouter un sommaire) uses the same builder widget but doesn't have a separate preview step, since the table itself is the live result once placed.

Above the builder, the export dialog has two ticks of its own:

Option Default Does
Formater en tant que liste de materiel (format as a bill of materials) unticked groups the rows by designation and adds a count column, so each part appears once with its quantity
Laisser de cΓ΄tΓ© les jonctions (leave out the junctions) unticked drops the rows of junctions: terminal-type elements with no label, no designation, no manufacturer and no manufacturer reference β€” the splice, corner and cross symbols some people draw where wires branch. A terminal block with a label or a part number stays

With junctions drawn as symbols, they can be most of a parts list: on one reporter's cabinet, 109 of 151 rows were empty junction rows (issue #1178). Leaving out junctions and contact blocks (Β§3) are also options of the command-line export (--no-junctions, --no-slaves, see CLI reference).


8. Sharing a report between users or installs

Saved reports (Β§5 above) live in nomenclature.json, in this install's own config directory β€” there's no built-in way for someone else to see a report you've saved, until now:

  • Exporter... writes every saved report to a .json file you choose.
  • Importer... reads one of those files back in, merging its reports into your own nomenclature.json. A name that already exists locally isn't overwritten silently β€” you're asked, per report, whether to replace it.

Both buttons sit next to the existing save/load controls in Β§5.


9. What this is not

  • Not a general SQL client, once you leave "Edit SQL query" mode: the column/filter builder only ever targets the one view it's bound to (element_nomenclature_view or project_summary_view). "Edit SQL query" itself can target any table β€” see Β§4 β€” but every query, built or hand-written, still has to be read-only (Β§6).
  • Not live outside the app. Like the rest of the project database, this queries the in-memory cache β€” see The project database for what that means and doesn't mean.
  • Not the same as --export-bom. The CLI export reads the same view but with its own fixed column set β€” see Automating QElectroTech. This widget is for a table rendered on a sheet, and its column choices don't affect the CLI export or vice versa.

See also: The project database Β· Automating QElectroTech

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