diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-07 17:27:22 +0100 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-07 17:27:22 +0100 |
commit | 60c7bfa8260f9aa68bd7947ecddfe64e030b0c7a (patch) | |
tree | 3c5c41ab02dac35a1aafca3d29da3a146a6dfb7e /qtmips_gui/coreview | |
parent | 556d9b08fee6d54a2b2ec62862a84d97c91b9792 (diff) | |
download | qtmips-60c7bfa8260f9aa68bd7947ecddfe64e030b0c7a.tar.gz qtmips-60c7bfa8260f9aa68bd7947ecddfe64e030b0c7a.tar.bz2 qtmips-60c7bfa8260f9aa68bd7947ecddfe64e030b0c7a.zip |
Add address to emitted instruction to allow its use for branch address decoding.
The new Qt5 syntax is used to create connections because
old syntax does not work with multiple arguments for some
unresolved reason.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/coreview')
-rw-r--r-- | qtmips_gui/coreview/instructionview.cpp | 4 | ||||
-rw-r--r-- | qtmips_gui/coreview/instructionview.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/qtmips_gui/coreview/instructionview.cpp b/qtmips_gui/coreview/instructionview.cpp index 5d131eb..342a1d4 100644 --- a/qtmips_gui/coreview/instructionview.cpp +++ b/qtmips_gui/coreview/instructionview.cpp @@ -52,7 +52,7 @@ InstructionView::InstructionView() : QGraphicsObject(nullptr), text(this) { f.setPointSize(6); text.setFont(f); - instruction_update(machine::Instruction()); // Initialize to NOP + instruction_update(machine::Instruction(), 0); // Initialize to NOP } QRectF InstructionView::boundingRect() const { @@ -65,7 +65,7 @@ void InstructionView::paint(QPainter *painter, const QStyleOptionGraphicsItem *o painter->drawRoundRect(-WIDTH/2, 0, WIDTH, HEIGHT, ROUND, ROUND); } -void InstructionView::instruction_update(const machine::Instruction &i) { +void InstructionView::instruction_update(const machine::Instruction &i, std::uint32_t inst_addr) { QRectF prev_box = boundingRect(); text.setText(i.to_str()); QRectF box = text.boundingRect(); diff --git a/qtmips_gui/coreview/instructionview.h b/qtmips_gui/coreview/instructionview.h index 57b1fbc..8c63fc1 100644 --- a/qtmips_gui/coreview/instructionview.h +++ b/qtmips_gui/coreview/instructionview.h @@ -51,7 +51,7 @@ public: void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); public slots: - void instruction_update(const machine::Instruction &i); + void instruction_update(const machine::Instruction &i, std::uint32_t inst_addr); private: QGraphicsSimpleTextItem text; |