-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtimesplash.cpp
53 lines (40 loc) · 1.33 KB
/
timesplash.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
47
48
49
50
51
52
53
#include <QEvent>
#include <QDebug>
#include "timesplash.h"
#include "timerwindow.h"
TimeSplash::TimeSplash(TimerWindow* tw, const QPixmap &pixmap, Qt::WindowFlags f)
{
qDebug("ENTER TimeSplash::TimeSplash");
timerwindow = tw;
this->setPixmap(pixmap);
this->setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint);
this->installEventFilter(this);
qDebug("LEAVE TimeSplash::TimeSplash");
}
bool TimeSplash::eventFilter(QObject *target, QEvent *event)
{
qDebug("ENTER TimeSplash::eventFilter");
Q_UNUSED(target)
if( event->type() == QEvent::MouseButtonDblClick ){
timerwindow->setWindowState(Qt::WindowMinimized);
qDebug("LEAVE TimeSplash::eventFilter - Return false");
return false;
}
if( event->type() == QEvent::MouseButtonPress ){
timerwindow->setWindowState(Qt::WindowActive);
timerwindow->show();
timerwindow->raise();
qDebug("LEAVE TimeSplash::eventFilter - Return true");
return true;
}
if(
(event->type() == QEvent::MouseButtonRelease) ||
(event->type() == QEvent::KeyPress) ||
(event->type() == QEvent::KeyRelease)
) {
qDebug("LEAVE TimeSplash::eventFilter - Return true");
return true;
}
qDebug("LEAVE TimeSplash::eventFilter - Return false");
return false;
}