-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaboutdialog.cpp
42 lines (36 loc) · 1.05 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
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
#include <QDesktopServices>
#include <QFileSystemModel>
#include <QStringListModel>
#include <QUrl>
AboutDialog::AboutDialog(QWidget* parent)
: QDialog(parent)
, ui(new Ui::AboutDialog)
{
ui->setupUi(this);
this->setWindowIcon(
QIcon(QApplication::applicationDirPath() + "/etc/images/ic_app.png"));
this->setWindowTitle("使用到的开源库及其版权说明");
setAttribute(Qt::WA_DeleteOnClose);
fileModel = new QFileSystemModel;
fileModel->setRootPath(licenseFilePath);
ui->licenseListView->setModel(fileModel);
ui->licenseListView->setRootIndex(fileModel->index(licenseFilePath));
ui->licenseListView->show();
connect(ui->licenseListView,
SIGNAL(clicked(QModelIndex)),
this,
SLOT(itemClicked(QModelIndex)));
}
AboutDialog::~AboutDialog()
{
delete fileModel;
delete ui;
}
void
AboutDialog::itemClicked(QModelIndex index)
{
QString path = licenseFilePath + "/" + index.data().toByteArray();
QDesktopServices::openUrl(QUrl("file:///" + path));
}