aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-15 14:10:25 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-15 14:10:25 +0100
commit78534f29b90fcf7484ed8b64e404a7059a69abea (patch)
treebeaec381396e753783b2358625ee83ccd4fccc38 /qtmips_gui/coreview
parentbd1ff3b84310ed6c4227f880f294bf62284331cb (diff)
downloadqtmips-78534f29b90fcf7484ed8b64e404a7059a69abea.tar.gz
qtmips-78534f29b90fcf7484ed8b64e404a7059a69abea.tar.bz2
qtmips-78534f29b90fcf7484ed8b64e404a7059a69abea.zip
Add instruction views to core view
Positioning and probably even graphics are just temporally for now.
Diffstat (limited to 'qtmips_gui/coreview')
-rw-r--r--qtmips_gui/coreview/instructionview.cpp10
-rw-r--r--qtmips_gui/coreview/instructionview.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/qtmips_gui/coreview/instructionview.cpp b/qtmips_gui/coreview/instructionview.cpp
index 202aa3c..bab9bc8 100644
--- a/qtmips_gui/coreview/instructionview.cpp
+++ b/qtmips_gui/coreview/instructionview.cpp
@@ -1,9 +1,15 @@
#include "instructionview.h"
+#include <QFont>
using namespace coreview;
-InstructionView::InstructionView() : QObject(), QGraphicsSimpleTextItem() { }
+InstructionView::InstructionView() : QObject(), QGraphicsSimpleTextItem() {
+ QFont f;
+ f.setPointSize(8);
+ setFont(f);
+ instruction_update(machine::Instruction());
+}
-void InstructionView::instruction_update(machine::Instruction &i) {
+void InstructionView::instruction_update(const machine::Instruction &i) {
setText(i.to_str());
}
diff --git a/qtmips_gui/coreview/instructionview.h b/qtmips_gui/coreview/instructionview.h
index 8db4756..4b7d171 100644
--- a/qtmips_gui/coreview/instructionview.h
+++ b/qtmips_gui/coreview/instructionview.h
@@ -12,7 +12,7 @@ public:
InstructionView();
public slots:
- void instruction_update(machine::Instruction &i);
+ void instruction_update(const machine::Instruction &i);
};
}