From 1008f8180161b3ab7c6b885cb6f6a19df59dd398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 21 Dec 2017 15:01:18 +0100 Subject: A lot of small changes in gui Added machine status. Widgets now hold size and registers dock has now scrollbars. And more... --- qtmips_gui/registersdock.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'qtmips_gui/registersdock.cpp') diff --git a/qtmips_gui/registersdock.cpp b/qtmips_gui/registersdock.cpp index 20eb9e4..5d965ca 100644 --- a/qtmips_gui/registersdock.cpp +++ b/qtmips_gui/registersdock.cpp @@ -3,8 +3,10 @@ RegistersDock::RegistersDock(QWidget *parent) : QDockWidget(parent) { regs = nullptr; - widg = new QScrollArea(this); + scrollarea = new QScrollArea(this); + widg = new QWidget(scrollarea); layout = new QFormLayout(widg); + layout->setSizeConstraint(QLayout::SetMinAndMaxSize); #define INIT(X, LABEL) do{ \ X = new QLabel(widg); \ @@ -17,10 +19,13 @@ RegistersDock::RegistersDock(QWidget *parent) : QDockWidget(parent) { INIT(gp[i], QString("GP") + QString::number(i) + QString(" ($") + QString::number(i) + QString("):")); INIT(lo, "LO:"); INIT(hi, "HI:"); - #undef INIT + widg->setLayout(layout); + scrollarea->setWidget(widg); - setWidget(widg); + setWidget(scrollarea); + setObjectName("Registers"); + setWindowTitle("Registers"); } RegistersDock::~RegistersDock() { -- cgit v1.2.3