-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (25 loc) · 715 Bytes
/
main.cpp
File metadata and controls
28 lines (25 loc) · 715 Bytes
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
#include "foryouos.h"
#include <QApplication>
#include <QWidget>
#include <QPropertyAnimation>
#include <QGraphicsOpacityEffect>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
#if 1
foryouos w;
w.show();
#else
QWidget window;
window.resize(200, 150);
QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect(&window);
window.setGraphicsEffect(effect);
window.show();
QPropertyAnimation *animation = new QPropertyAnimation(effect, "windowOpacity");
animation->setDuration(2000); // 2 seconds
animation->setStartValue(1.0); // Fully opaque
animation->setEndValue(0.0); // Fully transparent
animation->start();
#endif
return a.exec();
}