From 0ccd55c011f72b5bb7d11a1f683e5ac949702417 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Mon, 18 Feb 2019 20:49:08 +0100 Subject: Report forward and stall for branches and add forward to execution phase. Signed-off-by: Pavel Pisa --- qtmips_gui/coreview/multitext.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'qtmips_gui/coreview/multitext.cpp') diff --git a/qtmips_gui/coreview/multitext.cpp b/qtmips_gui/coreview/multitext.cpp index d28b5be..1658b55 100644 --- a/qtmips_gui/coreview/multitext.cpp +++ b/qtmips_gui/coreview/multitext.cpp @@ -47,13 +47,14 @@ using namespace coreview; #define PENW 1 ////////////////////// -MultiText::MultiText(QMap value_map) : +MultiText::MultiText(QMap value_map, bool nonzero_red) : QGraphicsObject(nullptr), text(this) { QFont f; f.setPointSize(6); text.setFont(f); this->value_map = value_map; + this->nonzero_red = nonzero_red; multitext_update(0); } @@ -64,7 +65,11 @@ QRectF MultiText::boundingRect() const { void MultiText::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __attribute__((unused)), QWidget *widget __attribute__((unused))) { painter->setPen(QPen(QColor(240, 240, 240))); - painter->setBrush(QBrush(QColor(240, 240, 240))); + if (value != 0 && nonzero_red) + painter->setBrush(QBrush(QColor(255, 100, 100))); + else + painter->setBrush(QBrush(QColor(240, 240, 240))); + painter->drawRoundRect(-WIDTH/2, 0, WIDTH, HEIGHT, ROUND, ROUND); } -- cgit v1.2.3