Basic Shapes: Edit property(style) added, undo/redo style added

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2910 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
abhishekm71
2014-03-07 08:05:25 +00:00
parent dbd1607a7a
commit 82ad6168c1
7 changed files with 128 additions and 2 deletions

View File

@@ -1188,6 +1188,47 @@ void ImageResizerCommand::redo() {
image_ -> setScale(new_size);
}
/**
* @brief ChangeShapeStyleCommand::ChangeShapeStyleCommand Constructor
* @param shape
* @param old_ old style of shape
* @param new_ new style of shape
* @param parent undocommand parent
*/
ChangeShapeStyleCommand::ChangeShapeStyleCommand(QetShapeItem *shape, Qt::PenStyle &old_, Qt::PenStyle &new_, QUndoCommand *parent):
QUndoCommand(parent),
shape_(shape),
old_style (old_),
new_style (new_),
diagram(shape->diagram())
{}
/**
* @brief ChangeShapeStyleCommand::~ChangeShapeStyleCommand destructor
*/
ChangeShapeStyleCommand::~ChangeShapeStyleCommand() {}
/**
* @brief ChangeShapeStyleCommand::undo set the old style
*/
void ChangeShapeStyleCommand::undo() {
shape_ -> setStyle(old_style);
diagram -> showMe();
QUndoCommand::undo();
}
/**
* @brief ChangeShapeStyleCommand::redo set the new style
*/
void ChangeShapeStyleCommand::redo() {
shape_ -> setStyle(new_style);
diagram -> showMe();
QUndoCommand::redo();
}
/**
* @brief LinkElementsCommand::LinkElementsCommand
*Constructor