diff options
author | Karel Kočí <cynerd@email.cz> | 2018-01-08 21:43:58 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-01-08 21:43:58 +0100 |
commit | 506174a8266eb9842ff9e50a89ddf86cb975be30 (patch) | |
tree | cd1c2905d48c172d2b83e4230b1f76dc46e8f3d3 /qtmips_gui/coreview/alu.cpp | |
parent | bcdd7c87b1eda7dc6b294cfa0796ce7e36f12b23 (diff) | |
download | qtmips-506174a8266eb9842ff9e50a89ddf86cb975be30.tar.gz qtmips-506174a8266eb9842ff9e50a89ddf86cb975be30.tar.bz2 qtmips-506174a8266eb9842ff9e50a89ddf86cb975be30.zip |
Add coreview progress
Diffstat (limited to 'qtmips_gui/coreview/alu.cpp')
-rw-r--r-- | qtmips_gui/coreview/alu.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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); |