diff options
Diffstat (limited to 'qtmips_gui/coreview')
-rw-r--r-- | qtmips_gui/coreview/alu.cpp | 7 | ||||
-rw-r--r-- | qtmips_gui/coreview/alu.h | 1 | ||||
-rw-r--r-- | qtmips_gui/coreview/latch.cpp | 9 | ||||
-rw-r--r-- | qtmips_gui/coreview/latch.h | 1 | ||||
-rw-r--r-- | qtmips_gui/coreview/programcounter.cpp | 5 | ||||
-rw-r--r-- | qtmips_gui/coreview/programcounter.h | 1 |
6 files changed, 24 insertions, 0 deletions
diff --git a/qtmips_gui/coreview/alu.cpp b/qtmips_gui/coreview/alu.cpp index e1494cb..5494b3f 100644 --- a/qtmips_gui/coreview/alu.cpp +++ b/qtmips_gui/coreview/alu.cpp @@ -58,6 +58,13 @@ coreview::Alu::Alu() : QGraphicsItem(nullptr), name("ALU", this) { setPos(x(), y()); // set connector's position } +coreview::Alu::~Alu() { + delete con_in_a; + delete con_in_b; + delete con_out; + delete con_ctl; +} + QRectF coreview::Alu::boundingRect() const { return QRectF(-PENW / 2, -PENW / 2, WIDTH + PENW, HEIGHT + PENW); } diff --git a/qtmips_gui/coreview/alu.h b/qtmips_gui/coreview/alu.h index ba87693..e0012e6 100644 --- a/qtmips_gui/coreview/alu.h +++ b/qtmips_gui/coreview/alu.h @@ -44,6 +44,7 @@ namespace coreview { class Alu : public QGraphicsItem { public: Alu(); + ~Alu(); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/qtmips_gui/coreview/latch.cpp b/qtmips_gui/coreview/latch.cpp index f0e2db9..e458f9b 100644 --- a/qtmips_gui/coreview/latch.cpp +++ b/qtmips_gui/coreview/latch.cpp @@ -60,6 +60,15 @@ Latch::Latch(machine::QtMipsMachine *machine, qreal height) : QGraphicsObject(nu connect(machine, SIGNAL(tick()), this, SLOT(tick())); } +Latch::~Latch() { + while (!connectors.isEmpty()) { + ConnectorPair cp = connectors.takeFirst(); + delete cp.in; + delete cp.out; + } + delete wedge_animation; +} + QRectF Latch::boundingRect() const { QRectF b(-PENW / 2, -PENW / 2, WIDTH + PENW, height + PENW); b |= title->boundingRect(); diff --git a/qtmips_gui/coreview/latch.h b/qtmips_gui/coreview/latch.h index 4521f9c..565e29c 100644 --- a/qtmips_gui/coreview/latch.h +++ b/qtmips_gui/coreview/latch.h @@ -50,6 +50,7 @@ class Latch : public QGraphicsObject { Q_PROPERTY(QColor wedge_clr READ wedge_color WRITE set_wedge_color) public: Latch(machine::QtMipsMachine *machine, qreal height); + ~Latch(); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/qtmips_gui/coreview/programcounter.cpp b/qtmips_gui/coreview/programcounter.cpp index 018bb38..2fb6980 100644 --- a/qtmips_gui/coreview/programcounter.cpp +++ b/qtmips_gui/coreview/programcounter.cpp @@ -65,6 +65,11 @@ ProgramCounter::ProgramCounter(machine::QtMipsMachine *machine) : QGraphicsObjec setPos(x(), y()); // To set initial connectors positions } +ProgramCounter::~ProgramCounter() { + delete con_in; + delete con_out; +} + QRectF ProgramCounter::boundingRect() const { return QRectF(-PENW / 2, -PENW / 2, WIDTH + PENW, HEIGHT + PENW); } diff --git a/qtmips_gui/coreview/programcounter.h b/qtmips_gui/coreview/programcounter.h index 3f981f3..ae5d45d 100644 --- a/qtmips_gui/coreview/programcounter.h +++ b/qtmips_gui/coreview/programcounter.h @@ -47,6 +47,7 @@ class ProgramCounter : public QGraphicsObject { Q_OBJECT public: ProgramCounter(machine::QtMipsMachine *machine); + ~ProgramCounter(); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |