Newer
Older
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
45
46
47
48
49
50
51
52
53
54
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::keyPressEvent(QKeyEvent* event)
{
// TODO manage program-level shortcuts
// else forward to active document key handler
ui->openGLWidget->keyPressEvent(event);
}
void MainWindow::keyReleaseEvent(QKeyEvent* event)
{
// TODO manage program-level shortcuts
// else forward to active document key handler
ui->openGLWidget->keyReleaseEvent(event);
}
void MainWindow::addTab(QWidget *widget, QString name)
{
ui->tabWidget->addTab(widget, name);
auto newtab = new QWidget();
newtab->setObjectName(QStringLiteral("tab_2"));
auto gridLayout = new QGridLayout(newtab);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(11, 11, 11, 11);
gridLayout->setObjectName(QStringLiteral("gridLayout_2"));
//openGLWidget = new QOpenGLWidget(newtab);
widget->setParent(newtab);
widget->setObjectName(QStringLiteral("openGLWidget"));
gridLayout->addWidget(widget, 0, 0, 1, 1);
ui->tabWidget->addTab(newtab, QString());
ui->gridLayout->addWidget(ui->tabWidget, 0, 0, 1, 1);
}
OE_interfaceDisplay* MainWindow::getItfDisplay()
{
return ui->openGLWidget;
}