![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Records the placement of a single text annotation. More...
#include <mapundostack.h>
Public Member Functions | |
| AddAnnotationCommand (OpenSWMMVisAnnotationLayer *layer, AnnotationTextItem *item, MapCanvas *canvas, QUndoCommand *parent=nullptr) | |
| ~AddAnnotationCommand () override | |
| void | undo () override |
| void | redo () override |
| int | id () const override |
Public Member Functions inherited from MapCommand | |
| MapCommand (const QString &text, MapCanvas *canvas, QUndoCommand *parent=nullptr) | |
Constructs a map command with a human-readable text. | |
| MapCanvas * | canvas () const |
Additional Inherited Members | |
Protected Attributes inherited from MapCommand | |
| MapCanvas * | m_canvas |
Records the placement of a single text annotation.
The command owns the AnnotationTextItem while it is detached from the layer (undo state). On redo, the item is moved into the layer (which takes QObject parent ownership). On undo, the layer detaches the item via takeAnnotation, returning it to the command. This pattern keeps the item's id stable across redo/undo cycles so any side-channel references survive.
| AddAnnotationCommand::AddAnnotationCommand | ( | OpenSWMMVisAnnotationLayer * | layer, |
| AnnotationTextItem * | item, | ||
| MapCanvas * | canvas, | ||
| QUndoCommand * | parent = nullptr |
||
| ) |
| item | Newly-created annotation. The command takes ownership; it transfers to the layer on each redo and back to the command on undo. |
|
override |
|
inlineoverride |
|
override |
|
override |