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
qmlrulelistio.h File Reference

Save / load RuleLists as QGIS .qml style files (Slice Z.17b). More...

#include "render/rulelistio.h"
#include <QString>
Include dependency graph for qmlrulelistio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 
namespace  OpenSWMM::Render::QmlRuleListIO
 

Functions

RuleListIoResult OpenSWMM::Render::QmlRuleListIO::save (const RuleList *list, const QString &path)
 
RuleListIoResult OpenSWMM::Render::QmlRuleListIO::load (const QString &path, RuleList *list)
 

Detailed Description

Save / load RuleLists as QGIS .qml style files (Slice Z.17b).

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
    Cross-tool interop for users who maintain styles in QGIS and
    want to share them with SWMMVis (or vice versa). The native
    .swmm-rule.json round-trip (Z.17-files) is the high-fidelity
    path; .qml is the lowest-common-denominator subset.

    v1 coverage:
      - One Rule + SingleSymbolRenderer + SimpleMarker /
        SimpleLine / SimpleFill → QGIS singleSymbol renderer
      - Multiple Rules with SingleSymbolRenderers → QGIS
        RuleRenderer (one <rule> per Rule, our filterExpression
        passed through as the QGIS filter)

    What's NOT covered (each emits a warning rather than failing):
      - Graduated / Categorized / RuleBased / Unclassed renderers
        on the SWMMVis side — export writes a fallback simple
        symbol; import treats them as singleSymbol fallback.
      - Z.6 raster symbol-layer kinds (RasterColorRamp,
        Hillshade, Contour, MeshEdge, MeshNode). QGIS has no
        direct equivalent at the symbol-layer level.
      - Data-defined overrides + symbol levels — round-trip
        through .swmm-rule.json instead.

    The existing StyleFileIO::importQml path remains the legacy
    layer-primary-renderer entrypoint (used by the
    LayerStyleDialog "Import style…" button); QmlRuleListIO
    supplements it by targeting the Rule Model directly, which
    is what the Style Manager dialog (Z.17c) operates on.