From 476af4ac713b88597e628ff8415ae2890757d574 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Tue, 2 Apr 2019 17:02:20 +0200 Subject: Implement stall cycles counter and view of CPU cycles counter. Signed-off-by: Pavel Pisa --- qtmips_gui/coreview/value.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'qtmips_gui/coreview/value.cpp') diff --git a/qtmips_gui/coreview/value.cpp b/qtmips_gui/coreview/value.cpp index 1250fb1..9dbe2e0 100644 --- a/qtmips_gui/coreview/value.cpp +++ b/qtmips_gui/coreview/value.cpp @@ -43,11 +43,13 @@ using namespace coreview; // TODO orientation Value::Value(bool vertical, unsigned width, std::uint32_t init_val, - unsigned a_base) : QGraphicsObject(nullptr) { + unsigned a_base, QChar fillchr, bool frame) : QGraphicsObject(nullptr) { wid = width; val = init_val; base = a_base; this->vertical = vertical; + this->fillchr = fillchr; + this->frame = frame; } QRectF Value::boundingRect() const { @@ -69,9 +71,12 @@ void Value::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __at rect = QRectF(-(LETWIDTH*(int)wid)/2 - 0.5, -HEIGHT/2 - 0.5, LETWIDTH*wid + 1, HEIGHT + 1); painter->setBrush(QBrush(QColor(Qt::white))); painter->setBackgroundMode(Qt::OpaqueMode); + if (!frame) + painter->setPen(QColor(Qt::white)); painter->drawRect(rect); + painter->setPen(QColor(Qt::black)); painter->setBackgroundMode(Qt::TransparentMode); - QString str = QString("%1").arg(val, wid, base, QChar('0')); + QString str = QString("%1").arg(val, wid, base, fillchr); if (vertical) { rect.setHeight(HEIGHT + 1); for (unsigned i = 0; i < wid; i++) { -- cgit v1.2.3