blob: dace3691693b55c146a3ba265cb3b316a9e1c15b (
plain)
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
|
#include "drape_head/mainwindow.hpp"
#include "drape_head/drape_surface.hpp"
#include <QtWidgets/QWidget>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, m_surface(nullptr)
{
resize(1200, 800);
DrapeSurface * surface = new DrapeSurface();
QSurfaceFormat format = surface->requestedFormat();
format.setDepthBufferSize(16);
surface->setFormat(format);
m_surface = QWidget::createWindowContainer(surface, this);
m_surface->setMouseTracking(true);
setCentralWidget(m_surface);
}
MainWindow::~MainWindow()
{
ASSERT(m_surface == NULL, ());
}
void MainWindow::closeEvent(QCloseEvent * closeEvent)
{
delete m_surface;
m_surface = NULL;
}
|