![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Slice BR Phase 6.8.2 — QSyntaxHighlighter for SWMM control rules. More...
#include <QPalette>#include <QStringList>#include <QSyntaxHighlighter>#include <QTextCharFormat>Go to the source code of this file.
Classes | |
| class | openswmmvis::controls::RuleSyntaxHighlighter |
Namespaces | |
| namespace | openswmmvis |
| namespace | openswmmvis::controls |
Slice BR Phase 6.8.2 — QSyntaxHighlighter for SWMM control rules.
Attached to RuleCodeEditor's QTextDocument. Token classes + palette roles:
RULE, IF, THEN, ELSE, AND, OR, NOT, PRIORITY) — bold, HighlightNODE, LINK, CONDUIT, PUMP, ORIFICE, WEIR, OUTLET, SUBCATCH, SIMULATION, GAGE) — bold, LinkVisitedDEPTH, HEAD, FLOW, VOLUME, INFLOW, SETTING, STATUS, CLOCKTIME, DATE, MONTH, DAY, TIME, OVERFLOW) — italic, Link=, <, >, <=, >=, <>, IS) — WindowTextHH:MM[:SS]) — Text; to EOL) — italic, PlaceholderThe keyword/object/variable vocabularies are aligned with the engine's Controls.cpp tokeniser (the attr == / obj_type == ladders at lines 650–736 of that file) so the GUI and engine cannot drift. A small exposed keywordList() accessor lets RuleCodeEditor's QCompleter reuse the same vocabulary without duplication.
Theming. Colours come from the application palette via QPalette colour roles rather than hard-coded RGB, so dark / light themes Just Work. The highlighter rebuilds its QTextCharFormats on setPalette (called by the editor when the palette changes).