forked from InvictusInnovations/keyhotee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ATopLevelWindow.cpp
47 lines (36 loc) · 904 Bytes
/
ATopLevelWindow.cpp
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
#include "ATopLevelWindow.hpp"
#include "ATopLevelWindowsContainer.hpp"
#include <QAction>
#include <QKeyEvent>
ATopLevelWindow::ATopLevelWindow(ATopLevelWindowsContainer *parent) :
SelfSizingMainWindow()
{
parentWin = parent;
actionMenu = new QAction(tr("[*]"), this);
actionMenu->setCheckable(true);
parentWin->registration(actionMenu);
}
ATopLevelWindow::~ATopLevelWindow(void)
{
}
void ATopLevelWindow::setWindowTitle(const QString& title_string)
{
QWidget::setWindowTitle(title_string);
SetActionText(title_string);
}
void ATopLevelWindow::SetActionText(QString string)
{
actionMenu->setText(string);
}
void ATopLevelWindow::closeEvent(QCloseEvent *event)
{
parentWin->unRegistration(actionMenu);
}
bool ATopLevelWindow::event(QEvent *event)
{
if(event->type() == QEvent::WindowActivate)
{
actionMenu->setChecked(true);
}
return QMainWindow::event(event);
}