![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Macro command that holds one SWMMModelLayer::BulkEdit scope open across every child command. More...
#include <mapundostack.h>
Public Member Functions | |
| BulkEditCommand (SWMMModelLayer *layer, const QString &text, QUndoCommand *parent=nullptr) | |
| void | redo () override |
| void | undo () override |
Macro command that holds one SWMMModelLayer::BulkEdit scope open across every child command.
Use this instead of a bare QUndoCommand whenever a macro carries more than a couple of model mutations. Each child still does its own engine call and SoA update; what the scope removes is the per-child rebuild of the category index, the model extent and the link spatial grid, plus the repaintRequested()/geometryChanged() pair whose listeners each cost O(model).
The macro object is the ONLY correct attachment point. Guarding the call site that builds the macro would cover the initial QUndoStack::push() (which calls redo()) but not a later Ctrl+Z — and undo replays the same storm through the add path, so an unguarded undo is as slow as the delete it reverses.
Children are unchanged: QUndoCommand::redo() runs them in order and QUndoCommand::undo() in reverse, exactly as before.
|
inline |
|
inlineoverride |
|
inlineoverride |