Undoable bulk attribute write on one node / link / rain gage, routed through the object's property adapter so every engine setter convention (enum handling, read-modify-write tuples, loss-coeff triples, …) is reused instead of re-implemented.
More...
#include <importcommands.h>
Undoable bulk attribute write on one node / link / rain gage, routed through the object's property adapter so every engine setter convention (enum handling, read-modify-write tuples, loss-coeff triples, …) is reused instead of re-implemented.
Keys of newValues / oldValues are adapter Q_PROPERTY names. oldValues must contain the pre-change value of every key in newValues (captured by the executor before pushing). redo() writes newValues, undo() writes oldValues. The adapter is built fresh on every redo()/undo() so the command never holds a stale engine index.
◆ SetAdapterPropertiesCommand()
| SetAdapterPropertiesCommand::SetAdapterPropertiesCommand |
( |
SWMMModelLayer * |
layer, |
|
|
quint8 |
kind, |
|
|
QString |
name, |
|
|
QVariantMap |
newValues, |
|
|
QVariantMap |
oldValues, |
|
|
MapCanvas * |
canvas, |
|
|
QUndoCommand * |
parent = nullptr |
|
) |
| |
◆ createAdapter()
| QObject * SetAdapterPropertiesCommand::createAdapter |
( |
SWMMModelLayer * |
layer, |
|
|
quint8 |
kind, |
|
|
const QString & |
name |
|
) |
| |
|
static |
Build the kind-appropriate concrete adapter for name on layer (junction/outfall/storage/divider subclass for nodes, per-link-type subclass for links, rain-gage adapter for gages). Returns nullptr when the object no longer exists. Caller owns the returned object. Exposed statically so the executor can use the same factory to snapshot old values.
◆ id()
| int SetAdapterPropertiesCommand::id |
( |
| ) |
const |
|
inlineoverride |
◆ redo()
| void SetAdapterPropertiesCommand::redo |
( |
| ) |
|
|
override |
◆ undo()
| void SetAdapterPropertiesCommand::undo |
( |
| ) |
|
|
override |
The documentation for this class was generated from the following files: