move undo command: graphics item is animated when undo/redo (testing)

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3202 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-07-09 16:50:30 +00:00
parent 844167f181
commit 5a8bb42153
3 changed files with 52 additions and 6 deletions

View File

@@ -34,6 +34,9 @@ typedef QHash<Qt::Corner, ConductorProfile> ConductorProfilesGroup;
class Conductor : public QObject, public QGraphicsPathItem {
Q_OBJECT
Q_PROPERTY(QPointF pos READ pos WRITE setPos)
Q_PROPERTY(int animPath READ fakePath WRITE updatePathAnimate)
// constructors, destructor
public:
@@ -67,6 +70,12 @@ class Conductor : public QObject, public QGraphicsPathItem {
Diagram *diagram() const;
ConductorTextItem *textItem() const;
void updatePath(const QRectF & = QRectF());
//This method do nothing, it's only made to be used with Q_PROPERTY
//It's used to anim the path when is change
void updatePathAnimate(const int = 1) {updatePath();}
int fakePath() {return 1;}
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
QRectF boundingRect() const;
virtual QPainterPath shape() const;