From 506174a8266eb9842ff9e50a89ddf86cb975be30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 8 Jan 2018 21:43:58 +0100 Subject: Add coreview progress --- qtmips_gui/coreview/alu.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'qtmips_gui/coreview/alu.cpp') diff --git a/qtmips_gui/coreview/alu.cpp b/qtmips_gui/coreview/alu.cpp index bb48c7e..e048578 100644 --- a/qtmips_gui/coreview/alu.cpp +++ b/qtmips_gui/coreview/alu.cpp @@ -7,9 +7,11 @@ #define PENW 1 ////////////////////// -coreview::Alu::Alu() : QGraphicsObject(nullptr), name(this) { - name.setText("ALU"); +coreview::Alu::Alu() : QGraphicsItem(nullptr), name("ALU", this) { name.setPos(3, 25); + QFont font; + font.setPointSize(7); + name.setFont(font); con_in_a = new Connector(); con_in_b = new Connector(); @@ -37,7 +39,8 @@ void coreview::Alu::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt } void coreview::Alu::setPos(qreal x, qreal y) { - QGraphicsObject::setPos(x, y); + QGraphicsItem::setPos(x, y); + // TODO fix this (should be relative to x and y) qreal off = ((HEIGHT/2) - DENT) / 2; con_in_a->setPos(0, off); con_in_b->setPos(0, HEIGHT - off); -- cgit v1.2.3