add OuputDevice as singleton to manage output to statusbar,

This commit is contained in:
Anakin
2017-01-29 11:35:43 +01:00
parent 96b7d6f736
commit 98302664ca
9 changed files with 52 additions and 34 deletions

View File

@@ -1,6 +1,7 @@
#include "..\Header\MainWindow.h"
#include "..\Header\OglViewerWidget.h"
#include "..\Header\FileInterface.h"
#include "..\Header\OutputDevice.h"
#include <QSurfaceFormat>
#include <QSignalMapper>
#include <QToolButton>
@@ -29,7 +30,7 @@ MainWindow::MainWindow(QWidget *parent)
setWindowTitle(WINDOW_NAME);
setWindowIcon(QIcon(":/images/icon.ico"));
printMessage("MeshViewer by Anakin", 0);
connect(OutputDevice::getInstance(this), &OutputDevice::sendMessage, this, &MainWindow::printMessage);
// setup opengl things
QSurfaceFormat format;
@@ -49,6 +50,8 @@ MainWindow::MainWindow(QWidget *parent)
QFile styleSheet(":/files/StyleSheet.txt");
styleSheet.open(QIODevice::ReadOnly);
this->setStyleSheet(styleSheet.readAll());
printMessage("MeshViewer by Anakin", 0);
}
MainWindow::~MainWindow()
@@ -67,7 +70,6 @@ void MainWindow::setupWidgets()
// Ogl Viewer
OglViewerWidget* viewer = new OglViewerWidget(this);
setCentralWidget(viewer);
connect(viewer, &OglViewerWidget::sendMessage, this, &MainWindow::printMessage);
// open file
QToolButton *openFile = new QToolButton(this);