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
openswmmvis::ui::LabelExpressionDialog Class Reference

#include <labelexpressiondialog.h>

Inheritance diagram for openswmmvis::ui::LabelExpressionDialog:
Collaboration diagram for openswmmvis::ui::LabelExpressionDialog:

Public Member Functions

 LabelExpressionDialog (const QVector< OpenSWMM::Render::AttributeField > &fields, const QString &initial, QWidget *parent=nullptr)
 
QString expression () const
 
void setSampleFeature (const QString &name, const QVariantMap &attrs)
 Sample values used by the preview, keyed by attribute name.
 

Static Public Member Functions

static QString resolve (const QString &expr, const QString &name, const QVariantMap &attrs)
 
static QStringList unknownTokens (const QString &expr, const QVector< OpenSWMM::Render::AttributeField > &fields)
 

Constructor & Destructor Documentation

◆ LabelExpressionDialog()

openswmmvis::ui::LabelExpressionDialog::LabelExpressionDialog ( const QVector< OpenSWMM::Render::AttributeField > &  fields,
const QString &  initial,
QWidget *  parent = nullptr 
)
Parameters
fieldsThemeable attributes for the sublayer being labelled; these become the insertable token list.
initialThe expression to seed the editor with.
Here is the call graph for this function:

Member Function Documentation

◆ expression()

QString openswmmvis::ui::LabelExpressionDialog::expression ( ) const

The edited template.

◆ resolve()

QString openswmmvis::ui::LabelExpressionDialog::resolve ( const QString &  expr,
const QString &  name,
const QVariantMap &  attrs 
)
static

Resolves expr the same way the paint path does: {name}name, any other {token}attrs[token] as a string, unmatched braces kept literally. Mirrors swmmlayeritem.cpp's resolveExpression.

◆ setSampleFeature()

void openswmmvis::ui::LabelExpressionDialog::setSampleFeature ( const QString &  name,
const QVariantMap &  attrs 
)

Sample values used by the preview, keyed by attribute name.

   Optional: without it the preview substitutes each token's own
   placeholder value so the shape of the label is still visible.

◆ unknownTokens()

QStringList openswmmvis::ui::LabelExpressionDialog::unknownTokens ( const QString &  expr,
const QVector< OpenSWMM::Render::AttributeField > &  fields 
)
static

Every {token} in expr that is neither "name" nor a known field. Empty means the template references nothing that would resolve blank.


The documentation for this class was generated from the following files: