QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
RotateSelectionCommand Class Reference

The RotateSelectionCommand class Rotate the selected items in the given diagram. More...

#include <rotateselectioncommand.h>

Inherits QUndoCommand.

Collaboration diagram for RotateSelectionCommand:
Collaboration graph

Public Member Functions

 RotateSelectionCommand (Diagram *diagram, qreal angle=90, QUndoCommand *parent=nullptr, bool rotate_as_group=false)
void undo () override
 RotateSelectionCommand::undo.
void redo () override
 RotateSelectionCommand::redo.
bool isValid ()
 RotateSelectionCommand::isValid.

Private Member Functions

void addGroupPositionUndo (QGraphicsItem *item, const QPointF &pivot, qreal angle)
 RotateSelectionCommand::addGroupPositionUndo Queue a "pos" QPropertyUndoCommand that rotates item's position around pivot by angle degrees (Qt's clockwise-positive convention, matching QGraphicsItem::setRotation() so a group rotation turns the same direction as each item's own spin). Only meaningful for items whose pos() is in scene coordinates (Element, IndependentTextItem, DiagramImageItem) – never call this for a child item positioned relative to its own parent.

Private Attributes

Diagramm_diagram =nullptr
QList< QPointer< ConductorTextItem > > m_cond_text
QHash< ConductorTextItem *, bool > m_rotate_by_user
QList< QPropertyUndoCommand * > m_undo

Detailed Description

The RotateSelectionCommand class Rotate the selected items in the given diagram.

Constructor & Destructor Documentation

◆ RotateSelectionCommand()

RotateSelectionCommand::RotateSelectionCommand ( Diagram * diagram,
qreal angle = 90,
QUndoCommand * parent = nullptr,
bool rotate_as_group = false )
Here is the call graph for this function:

Member Function Documentation

◆ addGroupPositionUndo()

void RotateSelectionCommand::addGroupPositionUndo ( QGraphicsItem * item,
const QPointF & pivot,
qreal angle )
private

RotateSelectionCommand::addGroupPositionUndo Queue a "pos" QPropertyUndoCommand that rotates item's position around pivot by angle degrees (Qt's clockwise-positive convention, matching QGraphicsItem::setRotation() so a group rotation turns the same direction as each item's own spin). Only meaningful for items whose pos() is in scene coordinates (Element, IndependentTextItem, DiagramImageItem) – never call this for a child item positioned relative to its own parent.

Parameters
item: item to reposition, its own rotation undo already queued
pivot: shared pivot point, in scene coordinates
angle: rotation angle in degrees
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isValid()

bool RotateSelectionCommand::isValid ( )

RotateSelectionCommand::isValid.

Returns
true if this command rotate a least one item.
Here is the caller graph for this function:

◆ redo()

void RotateSelectionCommand::redo ( )
override

◆ undo()

void RotateSelectionCommand::undo ( )
override

RotateSelectionCommand::undo.

Here is the caller graph for this function:

Member Data Documentation

◆ m_cond_text

QList<QPointer<ConductorTextItem> > RotateSelectionCommand::m_cond_text
private

◆ m_diagram

Diagram* RotateSelectionCommand::m_diagram =nullptr
private

◆ m_rotate_by_user

QHash<ConductorTextItem *, bool> RotateSelectionCommand::m_rotate_by_user
private

◆ m_undo

QList<QPropertyUndoCommand*> RotateSelectionCommand::m_undo
private

The documentation for this class was generated from the following files: