QElectroTech
0.70
|
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can use QPropertyAnimation to animate the change when undo/redo is call To use animation call setAnimated(true). By default animation is disable. Some QVariant date can't be animated and result this command don't work. More...
#include <qpropertyundocommand.h>
Public Member Functions | |
QPropertyUndoCommand (QObject *object, const char *property_name, const QVariant &old_value, const QVariant &new_value, QUndoCommand *parent=nullptr) | |
QPropertyUndoCommand::QPropertyUndoCommand Default constructor with old and new value This command don't take ownership of . More... | |
QPropertyUndoCommand (QObject *object, const char *property_name, const QVariant &old_value, QUndoCommand *parent=nullptr) | |
QPropertyUndoCommand::QPropertyUndoCommand Default constructor with old value. Call setNewValue to setup the new value of the edited QObject This command don't take ownership of . More... | |
QPropertyUndoCommand (const QPropertyUndoCommand *other) | |
void | setNewValue (const QVariant &new_value) |
QPropertyUndoCommand::setNewValue Set the new value of the property (set with redo) to . More... | |
void | enableAnimation (bool animate=true) |
QPropertyUndoCommand::enableAnimation True to enable animation. More... | |
void | setAnimated (bool animate=true, bool first_time=true) |
QPropertyUndoCommand::setAnimated. More... | |
int | id () const override |
bool | mergeWith (const QUndoCommand *other) override |
QPropertyUndoCommand::mergeWith Try to merge this command with other command. More... | |
void | redo () override |
QPropertyUndoCommand::redo Redo this command. More... | |
void | undo () override |
QPropertyUndoCommand::undo Undo this command. More... | |
Private Attributes | |
QObject * | m_object = nullptr |
const char * | m_property_name |
QVariant | m_old_value |
QVariant | m_new_value |
bool | m_animate = false |
bool | m_first_time = true |
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can use QPropertyAnimation to animate the change when undo/redo is call To use animation call setAnimated(true). By default animation is disable. Some QVariant date can't be animated and result this command don't work.
Definition at line 33 of file qpropertyundocommand.h.
QPropertyUndoCommand::QPropertyUndoCommand | ( | QObject * | object, |
const char * | property_name, | ||
const QVariant & | old_value, | ||
const QVariant & | new_value, | ||
QUndoCommand * | parent = nullptr |
||
) |
QPropertyUndoCommand::QPropertyUndoCommand Default constructor with old and new value This command don't take ownership of .
object | |
old_value | |
new_value |
Definition at line 29 of file qpropertyundocommand.cpp.
QPropertyUndoCommand::QPropertyUndoCommand | ( | QObject * | object, |
const char * | property_name, | ||
const QVariant & | old_value, | ||
QUndoCommand * | parent = nullptr |
||
) |
QPropertyUndoCommand::QPropertyUndoCommand Default constructor with old value. Call setNewValue to setup the new value of the edited QObject This command don't take ownership of .
object | |
old_value | |
parent |
Definition at line 46 of file qpropertyundocommand.cpp.
QPropertyUndoCommand::QPropertyUndoCommand | ( | const QPropertyUndoCommand * | other | ) |
Definition at line 53 of file qpropertyundocommand.cpp.
References m_animate, m_first_time, m_new_value, m_object, m_old_value, and m_property_name.
void QPropertyUndoCommand::enableAnimation | ( | bool | animate = true | ) |
QPropertyUndoCommand::enableAnimation True to enable animation.
animate |
Definition at line 78 of file qpropertyundocommand.cpp.
References m_animate.
Referenced by ImagePropertiesWidget::associatedUndo(), RectangleEditor::editingFinished(), ElementTextsMover::endMovement(), PartEllipse::handlerMousePressEvent(), PartArc::handlerMousePressEvent(), PartLine::handlerMousePressEvent(), ElementScene::keyPressEvent(), LineEditor::lineEditingFinished(), PartText::mouseReleaseEvent(), PartDynamicTextField::mouseReleaseEvent(), CustomElementGraphicPart::mouseReleaseEvent(), DynamicTextFieldEditor::on_m_rotation_sb_editingFinished(), DynamicTextFieldEditor::on_m_x_sb_editingFinished(), DynamicTextFieldEditor::on_m_y_sb_editingFinished(), ArcEditor::updateArcA(), ArcEditor::updateArcRect(), ArcEditor::updateArcS(), LineEditor::updateLineEndLength1(), LineEditor::updateLineEndLength2(), and TerminalEditor::updatePos().
|
inlineoverride |
Definition at line 44 of file qpropertyundocommand.h.
|
override |
QPropertyUndoCommand::mergeWith Try to merge this command with other command.
other |
Definition at line 100 of file qpropertyundocommand.cpp.
References m_new_value, m_object, m_property_name, and undo().
|
override |
QPropertyUndoCommand::redo Redo this command.
Definition at line 113 of file qpropertyundocommand.cpp.
References m_animate, m_first_time, m_new_value, m_object, m_old_value, and m_property_name.
void QPropertyUndoCommand::setAnimated | ( | bool | animate = true , |
bool | first_time = true |
||
) |
QPropertyUndoCommand::setAnimated.
animate | = true for animate this undo |
first_time | = if true, the first animation is done at the first call of redo if false, the first animation is done at the second call of redo. |
Definition at line 88 of file qpropertyundocommand.cpp.
References m_animate, and m_first_time.
Referenced by IndiTextPropertiesWidget::associatedUndo(), RectangleEditor::editingFinished(), PartRectangle::handlerMouseReleaseEvent(), QetShapeItem::handlerMouseReleaseEvent(), DynamicElementTextModel::undoForEditedGroup(), and DynamicElementTextModel::undoForEditedText().
void QPropertyUndoCommand::setNewValue | ( | const QVariant & | new_value | ) |
QPropertyUndoCommand::setNewValue Set the new value of the property (set with redo) to .
new_value |
Definition at line 69 of file qpropertyundocommand.cpp.
References m_new_value.
Referenced by PartEllipse::handlerMouseReleaseEvent(), PartArc::handlerMouseReleaseEvent(), PartPolygon::handlerMouseReleaseEvent(), and PartLine::handlerMouseReleaseEvent().
|
override |
QPropertyUndoCommand::undo Undo this command.
Definition at line 138 of file qpropertyundocommand.cpp.
References m_animate, m_new_value, m_object, m_old_value, and m_property_name.
Referenced by mergeWith().
|
private |
Definition at line 53 of file qpropertyundocommand.h.
Referenced by enableAnimation(), QPropertyUndoCommand(), redo(), setAnimated(), and undo().
|
private |
Definition at line 54 of file qpropertyundocommand.h.
Referenced by QPropertyUndoCommand(), redo(), and setAnimated().
|
private |
Definition at line 52 of file qpropertyundocommand.h.
Referenced by mergeWith(), QPropertyUndoCommand(), redo(), setNewValue(), and undo().
|
private |
Definition at line 50 of file qpropertyundocommand.h.
Referenced by mergeWith(), QPropertyUndoCommand(), redo(), and undo().
|
private |
Definition at line 52 of file qpropertyundocommand.h.
Referenced by QPropertyUndoCommand(), redo(), and undo().
|
private |
Definition at line 51 of file qpropertyundocommand.h.
Referenced by mergeWith(), QPropertyUndoCommand(), redo(), and undo().