5 |
6 | AboutWindow::AboutWindow(QWidget *parent) :
7 | QWidget(parent),
8 | ui(new Ui::AboutWindow)
9 | {
10 | parentWidget = parent;
11 |
12 | ui->setupUi(this);
13 |
14 | initUI();
15 | }
16 |
17 | AboutWindow::~AboutWindow()
18 | {
19 | delete ui;
20 | }
21 |
22 | void AboutWindow::closeWindow()
23 | {
24 | this->close();
25 | this->setAttribute(Qt::WA_DeleteOnClose, true);
26 | }
27 |
28 | void AboutWindow::paintEvent(QPaintEvent *)
29 | {
30 | QPainterPath path;
31 | path.setFillRule(Qt::WindingFill);
32 | path.addRect(0, 0, this->width(), this->height());
33 |
34 | QPainter painter(this);
35 | painter.fillPath(path, QBrush(Qt::white));
36 |
37 | path.setFillRule(Qt::WindingFill);
38 | path.addRect(0, 0, this->width()-1, this->height()-1);
39 |
40 | painter.setPen("#0063B1");
41 | painter.drawPath(path);
42 | }
43 |
44 | void AboutWindow::initUI()
45 | {
46 | QString str;
47 |
48 | this->setMinimumSize(DEFAULT_ABOUT_WINDOW_WIDTH, DEFAULT_ABOUT_WINDOW_HEIGHT);
49 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint);
50 | // this->setWindowIcon(QIcon(":/img/etc/logo.png"));
51 | this->setWindowIcon(QIcon(":/img/etc/icon.png"));
52 | this->setWindowTitle(tr("关于"));
53 | this->setWindowOpacity(1); //窗体透明度设置
54 |
55 | titleBarWidget = new TitleBarWidget(this, ABOUT_WINDOW_TITLE, 30, false);
56 | titleBarWidget->initConnect();
57 | connect(titleBarWidget, SIGNAL(closeWindow()), this, SLOT(closeWindow()));
58 |
59 | gifLabel = new QLabel(this);
60 | gifLabel->setFixedSize(this->width(), 300);
61 | gifLabel->move(0, 30);
62 | QMovie *movie=new QMovie(":/img/etc/start.gif");
63 | gifLabel->setMovie(movie);
64 | movie->start();
65 |
66 | titleText = new QLabel(this);
67 | titleText->setFixedSize(gifLabel->width(), gifLabel->height());
68 | titleText->move(0, titleBarWidget->height());
69 | str.sprintf("%s %s
",MAIN_WINDOW_TITLE,UDSO_VERSION);
70 | // str += "The open source, free, cross platform virtual oscilloscope.