diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-06-27 13:52:06 +0200 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-06-27 14:30:52 +0200 |
commit | 78803ae2c4cd5e3a8014ad8516cfa53d91a77589 (patch) | |
tree | 60b1ecf9fe1e3d9f3aa1d71deac8840cf3ed52d1 /qtmips_gui | |
parent | 687c32acda3350f91f605ae575fb394788fb4565 (diff) | |
download | qtmips-78803ae2c4cd5e3a8014ad8516cfa53d91a77589.tar.gz qtmips-78803ae2c4cd5e3a8014ad8516cfa53d91a77589.tar.bz2 qtmips-78803ae2c4cd5e3a8014ad8516cfa53d91a77589.zip |
Set default location of the program view on the left.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui')
-rw-r--r-- | qtmips_gui/mainwindow.cpp | 27 | ||||
-rw-r--r-- | qtmips_gui/mainwindow.h | 2 |
2 files changed, 15 insertions, 14 deletions
diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp index 0dc6bd5..f4473c7 100644 --- a/qtmips_gui/mainwindow.cpp +++ b/qtmips_gui/mainwindow.cpp @@ -62,7 +62,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { registers = new RegistersDock(this); registers->hide(); program = new ProgramDock(this, settings); - program->hide(); + addDockWidget(Qt::LeftDockWidgetArea, program); + program->show(); memory = new MemoryDock(this, settings); memory->hide(); cache_program = new CacheDock(this, "Program"); @@ -281,18 +282,18 @@ void MainWindow::print_action() { #endif // QTMIPS_WITH_PRINTING } -#define SHOW_HANDLER(NAME) void MainWindow::show_##NAME() { \ - show_dockwidget(NAME); \ +#define SHOW_HANDLER(NAME, DEFAULT_AREA) void MainWindow::show_##NAME() { \ + show_dockwidget(NAME, DEFAULT_AREA); \ } \ -SHOW_HANDLER(registers) -SHOW_HANDLER(program) -SHOW_HANDLER(memory) -SHOW_HANDLER(cache_program) -SHOW_HANDLER(cache_data) -SHOW_HANDLER(peripherals) -SHOW_HANDLER(terminal) -SHOW_HANDLER(cop0dock) +SHOW_HANDLER(registers, Qt::RightDockWidgetArea) +SHOW_HANDLER(program, Qt::LeftDockWidgetArea) +SHOW_HANDLER(memory, Qt::RightDockWidgetArea) +SHOW_HANDLER(cache_program, Qt::RightDockWidgetArea) +SHOW_HANDLER(cache_data, Qt::RightDockWidgetArea) +SHOW_HANDLER(peripherals, Qt::RightDockWidgetArea) +SHOW_HANDLER(terminal, Qt::RightDockWidgetArea) +SHOW_HANDLER(cop0dock, Qt::RightDockWidgetArea) #undef SHOW_HANDLER void MainWindow::show_symbol_dialog(){ @@ -345,10 +346,10 @@ void MainWindow::closeEvent(QCloseEvent *event __attribute__((unused))) { settings->sync(); } -void MainWindow::show_dockwidget(QDockWidget *dw) { +void MainWindow::show_dockwidget(QDockWidget *dw, Qt::DockWidgetArea area) { if (dw->isHidden()) { dw->show(); - addDockWidget(Qt::RightDockWidgetArea, dw); + addDockWidget(area, dw); } else { dw->raise(); dw->setFocus(); diff --git a/qtmips_gui/mainwindow.h b/qtmips_gui/mainwindow.h index 8a63bd8..1ee8032 100644 --- a/qtmips_gui/mainwindow.h +++ b/qtmips_gui/mainwindow.h @@ -114,7 +114,7 @@ private: machine::QtMipsMachine *machine; // Current simulated machine - void show_dockwidget(QDockWidget *w); + void show_dockwidget(QDockWidget *w, Qt::DockWidgetArea area = Qt::RightDockWidgetArea); }; #endif // MAINWINDOW_H |