Files
qelectrotech-source-mirror/sources/undocommand/changeshapestylecommand.h
blacksun 9c6d362637 QetShapeItem can be edited via the properties editor dock
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4024 bfdf4180-ca20-0410-9c96-a3a8aa849046
2015-06-21 20:16:41 +00:00

45 lines
1.3 KiB
C++

/*
Copyright 2006-2015 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHANGESHAPESTYLECOMMAND_H
#define CHANGESHAPESTYLECOMMAND_H
#include <QUndoCommand>
class QetShapeItem;
/**
* @brief The ChangeShapeStyleCommand class
* This class manage undo/redo to change the shape style.
*/
class ChangeShapeStyleCommand : public QUndoCommand
{
public:
ChangeShapeStyleCommand(QetShapeItem *item, const Qt::PenStyle &old_ps, const Qt::PenStyle new_ps, QUndoCommand *parent = nullptr);
int id() const {return 4;}
bool mergeWith(const QUndoCommand *other);
void undo();
void redo();
private:
QetShapeItem *m_shape;
Qt::PenStyle m_old_ps, m_new_ps;
};
#endif // CHANGESHAPESTYLECOMMAND_H