MainWindow.cpp 726 Bytes
Newer Older
Anakin's avatar
Anakin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 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);
}