-
Notifications
You must be signed in to change notification settings - Fork 0
/
startwindow.cpp
executable file
·43 lines (35 loc) · 1.02 KB
/
startwindow.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
#include "startwindow.h"
#include <QRect>
#include <QPoint>
#include <QApplication>
#include <cstdio>
#include <cstdlib>
#include <QIcon>
#include <windows.h>
StartWindow::StartWindow(QWidget* _q, QWidget* parent): QDesktopWidget(){
q=_q;
this->resize(600,500);
this->setWindowFlags(Qt::FramelessWindowHint);
QRect rect=QApplication::desktop()->screenGeometry();
QPoint point=rect.center();
point.setX(point.x()-this->width()/2);
point.setY(point.y()-this->height()/2);
this->move(point);
timer=new QTimer(this);
connect(timer,SIGNAL(timeout()),this,SLOT(Exit()));
timer->start(2200);
QIcon icon("start/2.jpg");
this->setWindowIcon(icon);
QPalette p = palette();
QPixmap pixmap1("start/2.jpg");
QSize size(600,500);
QPixmap pixmap(pixmap1.scaled(size));
p.setBrush(QPalette::Background, pixmap);
setPalette(p);
}
void StartWindow::Exit(){
this->close();
q->showMaximized();
}
StartWindow::~StartWindow(){
}