-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
50 lines (34 loc) · 1.03 KB
/
mainwindow.cpp
File metadata and controls
50 lines (34 loc) · 1.03 KB
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
#include "mainwindow.h"
MainWindow::MainWindow(bool debug, RemoteControl *remoteControl)
: m_debug(debug), m_remoteControl(remoteControl)
{
if (m_debug) {
qDebug() << "Qore2: Running MainWindow::MainWindow()";
}
setWindowTitle(QString::fromUtf8("Qore2"));
setFixedSize(490, 154);
tabWidget = new QTabWidget(this);
tabWidget->setFixedSize(490, 154);
connect(tabWidget, &QTabWidget::currentChanged, this, &MainWindow::saveTabIndexToDisk);
show();
}
void MainWindow::addTabWithText(QString text)
{
tabWidget->addTab(m_remoteControl, text);
}
void MainWindow::saveTabIndexToDisk()
{
if (m_debug) {
qDebug() << "Qore2: Running MainWindow:saveTabIndexToDisk() and setting tabIndex to"<<tabWidget->currentIndex();
}
emit tabIndexChangedSignal(tabWidget->currentIndex());
}
void MainWindow::closeEvent(QCloseEvent *event)
{
if (m_debug) {
qDebug() << "Qore2: Running MainWindow::closeEvent()";
}
event->ignore();
this->hide();
this->destroy();
}