Modify startup sequence to fix maximized issues on Windows
MODIFY
main.cpp
main.cpp
#include <QFileInfo>
#include <QMessageBox>
#include <QResource>
+#include <QTimer>
#include <iostream>
#include "src/mainwindow.h"
@@ -16,6 +17,13 @@ int main(int argc, char** argv) {
QApplication app(argc, argv);
Ripes::MainWindow m;
+
+ // The following sequence of events manages to successfully start the application as maximized, with the processor
+ // at a reasonable size. This has been found to be specially a problem on windows.
+ m.resize(800, 600);
m.showMaximized();
+ m.setWindowState(Qt::WindowMaximized);
+ QTimer::singleShot(100, [&m] { m.fitToView(); });
+
return app.exec();
}

MODIFY
src/mainwindow.cpp
src/mainwindow.cpp
@@ -77,12 +77,9 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), m_ui(new Ui::Main
connect(m_ui->actionOpen_wiki, &QAction::triggered, this, &MainWindow::wiki);
connect(m_ui->actionVersion, &QAction::triggered, this, &MainWindow::version);
+}
- // fitToView performs unexpectetly if the eventloop has not been processed (presumably this has something to do with
- // the visibility state of the VSRTLView within the VSRTL widget. Whilst not pretty, it has been found that updating
- // the entire Ripes widget and processing all events will result in correct fitting.
- update();
- QCoreApplication::processEvents();
+void MainWindow::fitToView() {
m_processorTab->fitToView();
}

MODIFY
src/mainwindow.h
src/mainwindow.h
@@ -28,6 +28,7 @@ public:
~MainWindow() override;
void closeEvent(QCloseEvent* event) override;
+ void fitToView();
private slots:
void wiki();

Modify startup sequence to fix maximized issues on Windows