|
QElectroTech
0.70
|
#include <editorcommands.h>
Public Member Functions | |
| ScalePartsCommand (ElementScene *=nullptr, QUndoCommand *=nullptr) | |
| ~ScalePartsCommand () override | |
| void | undo () override |
| void | redo () override |
| ElementScene * | elementScene () const |
| void | setScaledPrimitives (const QList< CustomElementPart *> &) |
| QList< CustomElementPart * > | scaledPrimitives () const |
| void | setTransformation (const QRectF &, const QRectF &) |
| QPair< QRectF, QRectF > | transformation () |
Public Member Functions inherited from ElementEditionCommand | |
| ElementEditionCommand (ElementScene *=nullptr, ElementView *=nullptr, QUndoCommand *=nullptr) | |
| ElementEditionCommand (const QString &, ElementScene *=nullptr, ElementView *=nullptr, QUndoCommand *=nullptr) | |
| ~ElementEditionCommand () override | |
| ElementScene * | elementScene () const |
| void | setElementScene (ElementScene *) |
| ElementView * | elementView () const |
| void | setElementView (ElementView *) |
Protected Member Functions | |
| void | scale (const QRectF &before, const QRectF &after) |
| void | adjustText () |
Private Member Functions | |
| ScalePartsCommand (const ScalePartsCommand &) | |
Private Attributes | |
| QList< CustomElementPart * > | scaled_primitives_ |
| List of moved primitives. More... | |
| QRectF | original_rect_ |
| original rect items fit in More... | |
| QRectF | new_rect_ |
| new rect items should fit in More... | |
| bool | first_redo |
| Prevent the first call to redo() More... | |
Additional Inherited Members | |
Protected Attributes inherited from ElementEditionCommand | |
| ElementScene * | m_scene |
| Element editor/view/scene the command should take place on. More... | |
| ElementView * | m_view |
This command scales primitives when editing an electrical element.
Definition at line 257 of file editorcommands.h.
| ScalePartsCommand::ScalePartsCommand | ( | ElementScene * | scene = nullptr, |
| QUndoCommand * | parent = nullptr |
||
| ) |
Constructor
| scene | Modified ElementScene |
| parent | Parent QUndoCommand |
Definition at line 494 of file editorcommands.cpp.
|
override |
Destructor
Definition at line 502 of file editorcommands.cpp.
|
private |
|
protected |
Generate the text describing what this command does exactly.
Definition at line 581 of file editorcommands.cpp.
References scaled_primitives_, and QET::Icons::tr.
Referenced by setScaledPrimitives().
| ElementScene * ScalePartsCommand::elementScene | ( | ) | const |
Definition at line 526 of file editorcommands.cpp.
References ElementEditionCommand::m_scene.
|
override |
Redo the scaling operation
Definition at line 515 of file editorcommands.cpp.
References first_redo, new_rect_, original_rect_, and scale().
|
protected |
Apply the scaling operation from before to after.
Definition at line 567 of file editorcommands.cpp.
References scaled_primitives_.
| QList< CustomElementPart * > ScalePartsCommand::scaledPrimitives | ( | ) | const |
Definition at line 541 of file editorcommands.cpp.
References scaled_primitives_.
| void ScalePartsCommand::setScaledPrimitives | ( | const QList< CustomElementPart *> & | primitives | ) |
Set primitives as the list of primitives to be scaled by this command
Definition at line 533 of file editorcommands.cpp.
References adjustText(), and scaled_primitives_.
| void ScalePartsCommand::setTransformation | ( | const QRectF & | original_rect, |
| const QRectF & | new_rect | ||
| ) |
Define the transformation applied by this command
| original_rect | Bounding rectangle for all scaled primitives before the operation |
| original_rect | Bounding rectangle for all scaled primitives after the operation |
Definition at line 550 of file editorcommands.cpp.
References new_rect_, and original_rect_.
| QPair< QRectF, QRectF > ScalePartsCommand::transformation | ( | ) |
Definition at line 560 of file editorcommands.cpp.
References new_rect_, and original_rect_.
|
override |
Undo the scaling operation
Definition at line 508 of file editorcommands.cpp.
References new_rect_, original_rect_, and scale().
|
private |
Prevent the first call to redo()
Definition at line 288 of file editorcommands.h.
Referenced by redo().
|
private |
new rect items should fit in
Definition at line 286 of file editorcommands.h.
Referenced by redo(), setTransformation(), transformation(), and undo().
|
private |
original rect items fit in
Definition at line 284 of file editorcommands.h.
Referenced by redo(), setTransformation(), transformation(), and undo().
|
private |
List of moved primitives.
Definition at line 282 of file editorcommands.h.
Referenced by adjustText(), scale(), scaledPrimitives(), and setScaledPrimitives().
1.8.15