diff options
author | Karel Kočí <cynerd@email.cz> | 2018-01-07 19:32:28 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-01-07 19:32:28 +0100 |
commit | 9db54180133bb7598fff3f702c37163f4f5d4c9e (patch) | |
tree | 7604b1d5ccf35ea681e924e272318c0c160ea801 /qtmips_gui/coreview/latch.h | |
parent | e7e2a8b894ef2523e7ac0281b6632aafa4ba3f2e (diff) | |
download | qtmips-9db54180133bb7598fff3f702c37163f4f5d4c9e.tar.gz qtmips-9db54180133bb7598fff3f702c37163f4f5d4c9e.tar.bz2 qtmips-9db54180133bb7598fff3f702c37163f4f5d4c9e.zip |
Animate time wedge in latch with step
Diffstat (limited to 'qtmips_gui/coreview/latch.h')
-rw-r--r-- | qtmips_gui/coreview/latch.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qtmips_gui/coreview/latch.h b/qtmips_gui/coreview/latch.h index ff1ff6e..951f16a 100644 --- a/qtmips_gui/coreview/latch.h +++ b/qtmips_gui/coreview/latch.h @@ -3,6 +3,7 @@ #include <QGraphicsObject> #include <QList> +#include <QPropertyAnimation> #include "qtmipsexception.h" #include "qtmipsmachine.h" #include "../coreview.h" @@ -12,18 +13,25 @@ namespace coreview { class Latch : public QGraphicsObject { Q_OBJECT + Q_PROPERTY(QColor wedge_clr READ wedge_color WRITE set_wedge_color) public: Latch(machine::QtMipsMachine *machine, qreal height); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + QColor wedge_color(); + void set_wedge_color(QColor &c); + void setPos(qreal x, qreal y); struct ConnectorPair { Connector *in, *out; }; struct ConnectorPair new_connector(qreal y); // Create new connectors pair that is given y from top of latch +protected: + void updateCurrentValue(const QColor &color); + private slots: void tick(); @@ -32,6 +40,8 @@ private: QList<ConnectorPair> connectors; QList<qreal> connectors_off; + QPropertyAnimation *wedge_animation; + QColor wedge_clr; }; } |