forked from hitfyd/ShowJCR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaboutdialog.cpp
49 lines (41 loc) · 1.2 KB
/
aboutdialog.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
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
#include <QDesktopServices>
#include <QUrl>
AboutDialog::AboutDialog(const QString &appName, const QString &version, const QString &email, const QString &codeURL, const QString &updateURL, QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
this->appName = appName;
this->version = version;
this->email = email;
this->codeURL = codeURL;
this->updateURL = updateURL;
this->setWindowFlags(this->windowFlags()&~Qt::WindowMinMaxButtonsHint);
this->setWindowTitle(appName);
ui->label_version->setText(appName + ", " + version + "版");
ui->pushButton_email->setToolTip(email);
ui->pushButton_code->setToolTip(codeURL);
ui->pushButton_update->setToolTip(updateURL);
}
AboutDialog::~AboutDialog()
{
delete ui;
}
void AboutDialog::on_pushButton_email_clicked()
{
QDesktopServices::openUrl(QUrl("mailto:"+email));
}
void AboutDialog::on_pushButton_code_clicked()
{
QDesktopServices::openUrl(QUrl(codeURL));
}
void AboutDialog::on_pushButton_OK_clicked()
{
this->close();
}
void AboutDialog::on_pushButton_update_clicked()
{
QDesktopServices::openUrl(QUrl(updateURL));
}