|
wiRedPanda
Logic Circuit Simulator
|
Hosts a temporary QLineEdit directly on the canvas to rename an element's label in place, in response to GraphicElement::inlineEditRequested(). More...
#include <InlineLabelEditor.h>
Public Member Functions | |
| void | cancel () |
| Discards the current edit (if any) and closes the editor without changing anything. | |
| void | commit () |
| InlineLabelEditor (Scene *scene) | |
| void | start (GraphicElement *element) |
| Starts inline-editing element's label, committing any already-in-progress edit first. | |
| ~InlineLabelEditor () | |
Hosts a temporary QLineEdit directly on the canvas to rename an element's label in place, in response to GraphicElement::inlineEditRequested().
Follows the SceneDropHandler/ConnectionManager pattern: holds a back-reference to the owning Scene and delegates the undo command back to it. Only one inline edit is ever active at a time; starting a new one commits whatever was already in progress.
Definition at line 23 of file InlineLabelEditor.h.
|
explicit |
Definition at line 47 of file InlineLabelEditor.cpp.
|
default |
| void InlineLabelEditor::cancel | ( | ) |
Discards the current edit (if any) and closes the editor without changing anything.
Definition at line 113 of file InlineLabelEditor.cpp.
| void InlineLabelEditor::commit | ( | ) |
Commits the current edit (if any): pushes an UpdateCommand only if the text actually changed, then closes the editor. Safe to call when nothing is being edited (no-op).
Definition at line 91 of file InlineLabelEditor.cpp.
References InMemorySnapshot, and Serialization::writePandaHeader().
Referenced by start().
| void InlineLabelEditor::start | ( | GraphicElement * | element | ) |
Starts inline-editing element's label, committing any already-in-progress edit first.
Definition at line 54 of file InlineLabelEditor.cpp.
References commit(), GraphicElement::label(), and GraphicElement::labelSceneBoundingRect().