-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqloadingwidget.cpp
More file actions
40 lines (32 loc) · 985 Bytes
/
qloadingwidget.cpp
File metadata and controls
40 lines (32 loc) · 985 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
29
30
31
32
33
34
35
36
37
38
39
40
#include "qloadingwidget.h"
#include "ui_qloadingwidget.h"
#include <QMovie>
#include <QLabel>
#include <QDesktopWidget>
QLoadingWidget::QLoadingWidget(QWidget *parent) :
QDialog(parent),
ui(new Ui::QLoadingWidget)
{
ui->setupUi(this);
setWindowTitle("设置关联");
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
// setWindowFlags(Qt::FramelessWindowHint);//无边框
setAttribute(Qt::WA_TranslucentBackground);//背景透明
setModal(true);
//屏幕居中显示
int frmX = width();
int frmY = height();
QDesktopWidget w;
int deskWidth = w.width();
int deskHeight = w.height();
QPoint movePoint(deskWidth / 2 - frmX / 2, deskHeight / 2 - frmY / 2);
move(movePoint);
// //加载gif图片
// QMovie *movie = new QMovie(":/new/prefix1/res/loading");
// ui->label->setMovie(movie);
// movie->start();
}
QLoadingWidget::~QLoadingWidget()
{
delete ui;
}