First triangle drawn in Qt Project
This commit is contained in:
@@ -2,8 +2,12 @@
|
||||
#include "OpenGlViewer.h"
|
||||
#include "defines.h"
|
||||
#include <QKeyEvent>
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// constructor/destructor
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui (new Ui::MainWindowClass)
|
||||
@@ -16,6 +20,10 @@ MainWindow::~MainWindow()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// private functions
|
||||
|
||||
void MainWindow::setupWindow()
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -26,11 +34,32 @@ void MainWindow::setupWindow()
|
||||
|
||||
this->setCentralWidget(new OpenGlViewer(this));
|
||||
|
||||
ui->mainToolBar->addAction("File Info", this, &MainWindow::aboutFile);
|
||||
|
||||
ui->statusBar->showMessage(DEFAULT_STATUS_MESSAGE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// private slots
|
||||
|
||||
void MainWindow::openFile()
|
||||
{
|
||||
//TODO: Open file
|
||||
}
|
||||
|
||||
void MainWindow::aboutFile()
|
||||
{
|
||||
//TODO: Open Window with file information
|
||||
QMessageBox* dialog = new QMessageBox(QMessageBox::Information, WINDOW_NAME, "File Info", QMessageBox::StandardButton::Close, this, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
|
||||
dialog->setDetailedText("This is the cool detailed text\n");
|
||||
dialog->exec();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// events
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent * keyEvent)
|
||||
{
|
||||
switch (keyEvent->key())
|
||||
|
||||
Reference in New Issue
Block a user