From bad9f0780e8dfca230e0cc6c32d60e845887aaf9 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Thu, 7 Feb 2019 21:57:02 +0100 Subject: View register numbers in decimal notation. Signed-off-by: Pavel Pisa --- qtmips_gui/coreview/value.cpp | 6 ++++-- 1 file changed, 4 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 12f7a55..9a3ab09 100644 --- a/qtmips_gui/coreview/value.cpp +++ b/qtmips_gui/coreview/value.cpp @@ -41,9 +41,11 @@ using namespace coreview; #define LETWIDTH 7 // TODO orientation -Value::Value(bool vertical, unsigned width, std::uint32_t init_val) : QGraphicsObject(nullptr) { +Value::Value(bool vertical, unsigned width, std::uint32_t init_val, + unsigned a_base) : QGraphicsObject(nullptr) { wid = width; val = init_val; + base = a_base; this->vertical = vertical; } @@ -68,7 +70,7 @@ void Value::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __at painter->setBackgroundMode(Qt::OpaqueMode); painter->drawRect(rect); painter->setBackgroundMode(Qt::TransparentMode); - QString str = QString("%1").arg(val, wid, 16, QChar('0')); + QString str = QString("%1").arg(val, wid, base, QChar('0')); if (vertical) { rect.setHeight(HEIGHT + 1); for (unsigned i = 0; i < wid; i++) { -- cgit v1.2.3