SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
rulecodeeditor.h File Reference

Slice BR Phase 6.8.2 — rich-text code editor for SWMM control rules. More...

#include <QPointer>
#include <QTextEdit>
Include dependency graph for rulecodeeditor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openswmmvis::ui::RuleCodeEditor
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::controls
 
namespace  openswmmvis::ui
 

Detailed Description

Slice BR Phase 6.8.2 — rich-text code editor for SWMM control rules.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

QTextEdit subclass (rich text, per user spec — not QPlainTextEdit). Wires in:

  • RuleSyntaxHighlighter attached to the document.
  • QCompleter whose source model is rebuilt on each popup from the bound SWMMModelLayer's live node / link / subcatchment names plus the static keyword vocabulary from RuleSyntaxHighlighter::allKeywords().
  • Ctrl+Space force-trigger; otherwise the popup is auto-triggered after two characters typed at any position with completions.

Save semantics live in RulesEditorDialog, not here — the editor is a pure view widget that emits textChanged (inherited) which the dialog picks up to (a) schedule validation via RuleValidator::validateDebounced and (b) flush via applyControlRuleReplace on focus-out or list-selection change.