Added new Project using Qt,
There is garbage left from Qt??
This commit is contained in:
44
MeshViewerQt/Source/MainWindow.cpp
Normal file
44
MeshViewerQt/Source/MainWindow.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#include "MainWindow.h"
|
||||
#include "OpenGlViewer.h"
|
||||
#include "defines.h"
|
||||
#include <QKeyEvent>
|
||||
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui (new Ui::MainWindowClass)
|
||||
{
|
||||
setupWindow();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::setupWindow()
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
this->setWindowTitle(WINDOW_NAME);
|
||||
this->setWindowIcon(QIcon(":/MainWindow/icon.ico"));
|
||||
this->resize(WINDOW_WIDTH, WINDOW_HEIGHT);
|
||||
|
||||
this->setCentralWidget(new OpenGlViewer(this));
|
||||
|
||||
ui->statusBar->showMessage(DEFAULT_STATUS_MESSAGE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent * keyEvent)
|
||||
{
|
||||
switch (keyEvent->key())
|
||||
{
|
||||
case Qt::Key::Key_Escape:
|
||||
close();
|
||||
break;
|
||||
}
|
||||
|
||||
QMainWindow::keyPressEvent(keyEvent);
|
||||
}
|
||||
Reference in New Issue
Block a user