From 78534f29b90fcf7484ed8b64e404a7059a69abea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 15 Jan 2018 14:10:25 +0100 Subject: Add instruction views to core view Positioning and probably even graphics are just temporally for now. --- qtmips_gui/coreview/instructionview.cpp | 10 ++++++++-- qtmips_gui/coreview/instructionview.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'qtmips_gui/coreview') 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 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); }; } -- cgit v1.2.3