mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
about dialog
This commit is contained in:
51
PdfForQtViewer/pdfaboutdialog.cpp
Normal file
51
PdfForQtViewer/pdfaboutdialog.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
// Copyright (C) 2019 Jakub Melka
|
||||
//
|
||||
// This file is part of PdfForQt.
|
||||
//
|
||||
// PdfForQt is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// PdfForQt is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with PDFForQt. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "pdfaboutdialog.h"
|
||||
#include "ui_pdfaboutdialog.h"
|
||||
|
||||
#include "pdfutils.h"
|
||||
|
||||
PDFAboutDialog::PDFAboutDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::PDFAboutDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
std::vector<pdf::PDFDependentLibraryInfo> infos = pdf::PDFDependentLibraryInfo::getLibraryInfo();
|
||||
|
||||
ui->tableWidget->setColumnCount(4);
|
||||
ui->tableWidget->setRowCount(static_cast<int>(infos.size()));
|
||||
ui->tableWidget->setHorizontalHeaderLabels(QStringList() << tr("Library") << tr("Version") << tr("License") << tr("URL"));
|
||||
ui->tableWidget->setEditTriggers(QTableWidget::NoEditTriggers);
|
||||
ui->tableWidget->setSelectionMode(QTableView::SingleSelection);
|
||||
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
|
||||
for (int i = 0; i < infos.size(); ++i)
|
||||
{
|
||||
const pdf::PDFDependentLibraryInfo& info = infos[i];
|
||||
ui->tableWidget->setItem(i, 0, new QTableWidgetItem(info.library));
|
||||
ui->tableWidget->setItem(i, 1, new QTableWidgetItem(info.version));
|
||||
ui->tableWidget->setItem(i, 2, new QTableWidgetItem(info.license));
|
||||
ui->tableWidget->setItem(i, 3, new QTableWidgetItem(info.url));
|
||||
}
|
||||
}
|
||||
|
||||
PDFAboutDialog::~PDFAboutDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
Reference in New Issue
Block a user