DocDiff application: line ending renormalization

This commit is contained in:
Jakub Melka 2021-09-27 11:29:00 +02:00
parent 3b6784b8e4
commit 5cdb6cdab6
13 changed files with 3020 additions and 3020 deletions

View File

@ -1,58 +1,58 @@
# Copyright (C) 2021 Jakub Melka # Copyright (C) 2021 Jakub Melka
# #
# This file is part of PDF4QT. # This file is part of PDF4QT.
# #
# PDF4QT is free software: you can redistribute it and/or modify # PDF4QT is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by # 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 # the Free Software Foundation, either version 3 of the License, or
# with the written consent of the copyright owner, any later version. # with the written consent of the copyright owner, any later version.
# #
# PDF4QT is distributed in the hope that it will be useful, # PDF4QT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details. # GNU Lesser General Public License for more details.
# #
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. # along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
QT += core gui widgets winextras QT += core gui widgets winextras
TARGET = Pdf4QtDocDiff TARGET = Pdf4QtDocDiff
TEMPLATE = app TEMPLATE = app
VERSION = 1.0.0 VERSION = 1.0.0
RC_ICONS = $$PWD/app-icon.ico RC_ICONS = $$PWD/app-icon.ico
QMAKE_TARGET_DESCRIPTION = "PDF Document Diff" QMAKE_TARGET_DESCRIPTION = "PDF Document Diff"
QMAKE_TARGET_COPYRIGHT = "(c) Jakub Melka 2018-2021" QMAKE_TARGET_COPYRIGHT = "(c) Jakub Melka 2018-2021"
DEFINES += QT_DEPRECATED_WARNINGS DEFINES += QT_DEPRECATED_WARNINGS
QMAKE_CXXFLAGS += /std:c++latest /utf-8 QMAKE_CXXFLAGS += /std:c++latest /utf-8
INCLUDEPATH += $$PWD/../PDF4QtLib/Sources INCLUDEPATH += $$PWD/../PDF4QtLib/Sources
DESTDIR = $$OUT_PWD/.. DESTDIR = $$OUT_PWD/..
LIBS += -L$$OUT_PWD/.. LIBS += -L$$OUT_PWD/..
LIBS += -lPDF4QtLib LIBS += -lPDF4QtLib
CONFIG += force_debug_info no_check_exist CONFIG += force_debug_info no_check_exist
application.files = $$DESTDIR/Pdf4QtDocDiff.exe application.files = $$DESTDIR/Pdf4QtDocDiff.exe
application.path = $$DESTDIR/install application.path = $$DESTDIR/install
application.CONFIG += no_check_exist application.CONFIG += no_check_exist
INSTALLS += application INSTALLS += application
SOURCES += \ SOURCES += \
aboutdialog.cpp \ aboutdialog.cpp \
main.cpp \ main.cpp \
mainwindow.cpp mainwindow.cpp
FORMS += \ FORMS += \
aboutdialog.ui \ aboutdialog.ui \
mainwindow.ui mainwindow.ui
HEADERS += \ HEADERS += \
aboutdialog.h \ aboutdialog.h \
mainwindow.h mainwindow.h
RESOURCES += \ RESOURCES += \
resources.qrc resources.qrc

View File

@ -1,64 +1,64 @@
// Copyright (C) 2021 Jakub Melka // Copyright (C) 2021 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
// PDF4QT is free software: you can redistribute it and/or modify // PDF4QT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // 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 // the Free Software Foundation, either version 3 of the License, or
// with the written consent of the copyright owner, any later version. // with the written consent of the copyright owner, any later version.
// //
// PDF4QT is distributed in the hope that it will be useful, // PDF4QT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. // along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
#include "aboutdialog.h" #include "aboutdialog.h"
#include "ui_aboutdialog.h" #include "ui_aboutdialog.h"
#include "pdfutils.h" #include "pdfutils.h"
#include "pdfwidgetutils.h" #include "pdfwidgetutils.h"
namespace pdfdocdiff namespace pdfdocdiff
{ {
PDFAboutDialog::PDFAboutDialog(QWidget* parent) : PDFAboutDialog::PDFAboutDialog(QWidget* parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::PDFAboutDialog) ui(new Ui::PDFAboutDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
QString html = ui->copyrightLabel->text(); QString html = ui->copyrightLabel->text();
html.replace("PdfForQtViewer", QApplication::applicationDisplayName()); html.replace("PdfForQtViewer", QApplication::applicationDisplayName());
ui->copyrightLabel->setText(html); ui->copyrightLabel->setText(html);
std::vector<pdf::PDFDependentLibraryInfo> infos = pdf::PDFDependentLibraryInfo::getLibraryInfo(); std::vector<pdf::PDFDependentLibraryInfo> infos = pdf::PDFDependentLibraryInfo::getLibraryInfo();
ui->tableWidget->setColumnCount(4); ui->tableWidget->setColumnCount(4);
ui->tableWidget->setRowCount(static_cast<int>(infos.size())); ui->tableWidget->setRowCount(static_cast<int>(infos.size()));
ui->tableWidget->setHorizontalHeaderLabels(QStringList() << tr("Library") << tr("Version") << tr("License") << tr("URL")); ui->tableWidget->setHorizontalHeaderLabels(QStringList() << tr("Library") << tr("Version") << tr("License") << tr("URL"));
ui->tableWidget->setEditTriggers(QTableWidget::NoEditTriggers); ui->tableWidget->setEditTriggers(QTableWidget::NoEditTriggers);
ui->tableWidget->setSelectionMode(QTableView::SingleSelection); ui->tableWidget->setSelectionMode(QTableView::SingleSelection);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
for (int i = 0; i < infos.size(); ++i) for (int i = 0; i < infos.size(); ++i)
{ {
const pdf::PDFDependentLibraryInfo& info = infos[i]; const pdf::PDFDependentLibraryInfo& info = infos[i];
ui->tableWidget->setItem(i, 0, new QTableWidgetItem(info.library)); ui->tableWidget->setItem(i, 0, new QTableWidgetItem(info.library));
ui->tableWidget->setItem(i, 1, new QTableWidgetItem(info.version)); ui->tableWidget->setItem(i, 1, new QTableWidgetItem(info.version));
ui->tableWidget->setItem(i, 2, new QTableWidgetItem(info.license)); ui->tableWidget->setItem(i, 2, new QTableWidgetItem(info.license));
ui->tableWidget->setItem(i, 3, new QTableWidgetItem(info.url)); ui->tableWidget->setItem(i, 3, new QTableWidgetItem(info.url));
} }
pdf::PDFWidgetUtils::scaleWidget(this, QSize(750, 600)); pdf::PDFWidgetUtils::scaleWidget(this, QSize(750, 600));
pdf::PDFWidgetUtils::style(this); pdf::PDFWidgetUtils::style(this);
} }
PDFAboutDialog::~PDFAboutDialog() PDFAboutDialog::~PDFAboutDialog()
{ {
delete ui; delete ui;
} }
} // namespace pdfdocdiff } // namespace pdfdocdiff

View File

@ -1,45 +1,45 @@
// Copyright (C) 2021 Jakub Melka // Copyright (C) 2021 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
// PDF4QT is free software: you can redistribute it and/or modify // PDF4QT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // 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 // the Free Software Foundation, either version 3 of the License, or
// with the written consent of the copyright owner, any later version. // with the written consent of the copyright owner, any later version.
// //
// PDF4QT is distributed in the hope that it will be useful, // PDF4QT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. // along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
#ifndef PDFDOCDIFF_PDFABOUTDIALOG_H #ifndef PDFDOCDIFF_PDFABOUTDIALOG_H
#define PDFDOCDIFF_PDFABOUTDIALOG_H #define PDFDOCDIFF_PDFABOUTDIALOG_H
#include <QDialog> #include <QDialog>
namespace Ui namespace Ui
{ {
class PDFAboutDialog; class PDFAboutDialog;
} }
namespace pdfdocdiff namespace pdfdocdiff
{ {
class PDFAboutDialog : public QDialog class PDFAboutDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit PDFAboutDialog(QWidget* parent); explicit PDFAboutDialog(QWidget* parent);
virtual ~PDFAboutDialog() override; virtual ~PDFAboutDialog() override;
private: private:
Ui::PDFAboutDialog* ui; Ui::PDFAboutDialog* ui;
}; };
} // namespace pdfdocdiff } // namespace pdfdocdiff
#endif // PDFDOCDIFF_PDFABOUTDIALOG_H #endif // PDFDOCDIFF_PDFABOUTDIALOG_H

View File

@ -1,269 +1,269 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>PDFAboutDialog</class> <class>PDFAboutDialog</class>
<widget class="QDialog" name="PDFAboutDialog"> <widget class="QDialog" name="PDFAboutDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>900</width> <width>900</width>
<height>600</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>900</width> <width>900</width>
<height>600</height> <height>600</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>About</string> <string>About</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="copyrightLabel"> <widget class="QLabel" name="copyrightLabel">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;PdfForQtViewer&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Copyright 2018-2021 Jakub Melka. All rights reserved.&lt;/p&gt;&lt;p&gt;THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;PdfForQtViewer&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Copyright 2018-2021 Jakub Melka. All rights reserved.&lt;/p&gt;&lt;p&gt;THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextEdit" name="textEdit"> <widget class="QTextEdit" name="textEdit">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="html"> <property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:7.875pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:7.875pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; GNU LESSER GENERAL PUBLIC LICENSE&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; GNU LESSER GENERAL PUBLIC LICENSE&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Version 3, 29 June 2007&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Version 3, 29 June 2007&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Copyright (C) 2007 Free Software Foundation, Inc. &amp;lt;https://fsf.org/&amp;gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Copyright (C) 2007 Free Software Foundation, Inc. &amp;lt;https://fsf.org/&amp;gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Everyone is permitted to copy and distribute verbatim copies&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Everyone is permitted to copy and distribute verbatim copies&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; of this license document, but changing it is not allowed.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; of this license document, but changing it is not allowed.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; This version of the GNU Lesser General Public License incorporates&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; This version of the GNU Lesser General Public License incorporates&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;the terms and conditions of version 3 of the GNU General Public&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;the terms and conditions of version 3 of the GNU General Public&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;License, supplemented by the additional permissions listed below.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;License, supplemented by the additional permissions listed below.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 0. Additional Definitions.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 0. Additional Definitions.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; As used herein, &amp;quot;this License&amp;quot; refers to version 3 of the GNU Lesser&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; As used herein, &amp;quot;this License&amp;quot; refers to version 3 of the GNU Lesser&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;General Public License, and the &amp;quot;GNU GPL&amp;quot; refers to version 3 of the GNU&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;General Public License, and the &amp;quot;GNU GPL&amp;quot; refers to version 3 of the GNU&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;General Public License.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;General Public License.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; &amp;quot;The Library&amp;quot; refers to a covered work governed by this License,&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; &amp;quot;The Library&amp;quot; refers to a covered work governed by this License,&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;other than an Application or a Combined Work as defined below.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;other than an Application or a Combined Work as defined below.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; An &amp;quot;Application&amp;quot; is any work that makes use of an interface provided&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; An &amp;quot;Application&amp;quot; is any work that makes use of an interface provided&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;by the Library, but which is not otherwise based on the Library.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;by the Library, but which is not otherwise based on the Library.&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Defining a subclass of a class defined by the Library is deemed a mode&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Defining a subclass of a class defined by the Library is deemed a mode&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;of using an interface provided by the Library.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;of using an interface provided by the Library.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; A &amp;quot;Combined Work&amp;quot; is a work produced by combining or linking an&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; A &amp;quot;Combined Work&amp;quot; is a work produced by combining or linking an&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Application with the Library. The particular version of the Library&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Application with the Library. The particular version of the Library&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;with which the Combined Work was made is also called the &amp;quot;Linked&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;with which the Combined Work was made is also called the &amp;quot;Linked&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Version&amp;quot;.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Version&amp;quot;.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; The &amp;quot;Minimal Corresponding Source&amp;quot; for a Combined Work means the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; The &amp;quot;Minimal Corresponding Source&amp;quot; for a Combined Work means the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Corresponding Source for the Combined Work, excluding any source code&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Corresponding Source for the Combined Work, excluding any source code&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;for portions of the Combined Work that, considered in isolation, are&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;for portions of the Combined Work that, considered in isolation, are&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;based on the Application, and not on the Linked Version.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;based on the Application, and not on the Linked Version.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; The &amp;quot;Corresponding Application Code&amp;quot; for a Combined Work means the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; The &amp;quot;Corresponding Application Code&amp;quot; for a Combined Work means the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;object code and/or source code for the Application, including any data&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;object code and/or source code for the Application, including any data&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;and utility programs needed for reproducing the Combined Work from the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;and utility programs needed for reproducing the Combined Work from the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Application, but excluding the System Libraries of the Combined Work.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Application, but excluding the System Libraries of the Combined Work.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 1. Exception to Section 3 of the GNU GPL.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 1. Exception to Section 3 of the GNU GPL.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; You may convey a covered work under sections 3 and 4 of this License&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; You may convey a covered work under sections 3 and 4 of this License&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;without being bound by section 3 of the GNU GPL.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;without being bound by section 3 of the GNU GPL.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 2. Conveying Modified Versions.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 2. Conveying Modified Versions.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; If you modify a copy of the Library, and, in your modifications, a&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; If you modify a copy of the Library, and, in your modifications, a&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;facility refers to a function or data to be supplied by an Application&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;facility refers to a function or data to be supplied by an Application&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;that uses the facility (other than as an argument passed when the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;that uses the facility (other than as an argument passed when the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;facility is invoked), then you may convey a copy of the modified&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;facility is invoked), then you may convey a copy of the modified&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;version:&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;version:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a) under this License, provided that you make a good faith effort to&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a) under this License, provided that you make a good faith effort to&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; ensure that, in the event an Application does not supply the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; ensure that, in the event an Application does not supply the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; function or data, the facility still operates, and performs&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; function or data, the facility still operates, and performs&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; whatever part of its purpose remains meaningful, or&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; whatever part of its purpose remains meaningful, or&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; b) under the GNU GPL, with none of the additional permissions of&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; b) under the GNU GPL, with none of the additional permissions of&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; this License applicable to that copy.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; this License applicable to that copy.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 3. Object Code Incorporating Material from Library Header Files.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 3. Object Code Incorporating Material from Library Header Files.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; The object code form of an Application may incorporate material from&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; The object code form of an Application may incorporate material from&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;a header file that is part of the Library. You may convey such object&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;a header file that is part of the Library. You may convey such object&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;code under terms of your choice, provided that, if the incorporated&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;code under terms of your choice, provided that, if the incorporated&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;material is not limited to numerical parameters, data structure&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;material is not limited to numerical parameters, data structure&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;layouts and accessors, or small macros, inline functions and templates&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;layouts and accessors, or small macros, inline functions and templates&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(ten or fewer lines in length), you do both of the following:&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(ten or fewer lines in length), you do both of the following:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a) Give prominent notice with each copy of the object code that the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a) Give prominent notice with each copy of the object code that the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Library is used in it and that the Library and its use are&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Library is used in it and that the Library and its use are&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; covered by this License.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; covered by this License.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; b) Accompany the object code with a copy of the GNU GPL and this license&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; b) Accompany the object code with a copy of the GNU GPL and this license&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; document.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; document.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 4. Combined Works.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 4. Combined Works.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; You may convey a Combined Work under terms of your choice that,&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; You may convey a Combined Work under terms of your choice that,&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;taken together, effectively do not restrict modification of the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;taken together, effectively do not restrict modification of the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;portions of the Library contained in the Combined Work and reverse&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;portions of the Library contained in the Combined Work and reverse&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;engineering for debugging such modifications, if you also do each of&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;engineering for debugging such modifications, if you also do each of&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;the following:&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;the following:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a) Give prominent notice with each copy of the Combined Work that&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a) Give prominent notice with each copy of the Combined Work that&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; the Library is used in it and that the Library and its use are&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; the Library is used in it and that the Library and its use are&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; covered by this License.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; covered by this License.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; b) Accompany the Combined Work with a copy of the GNU GPL and this license&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; b) Accompany the Combined Work with a copy of the GNU GPL and this license&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; document.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; document.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; c) For a Combined Work that displays copyright notices during&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; c) For a Combined Work that displays copyright notices during&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; execution, include the copyright notice for the Library among&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; execution, include the copyright notice for the Library among&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; these notices, as well as a reference directing the user to the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; these notices, as well as a reference directing the user to the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; copies of the GNU GPL and this license document.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; copies of the GNU GPL and this license document.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; d) Do one of the following:&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; d) Do one of the following:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 0) Convey the Minimal Corresponding Source under the terms of this&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 0) Convey the Minimal Corresponding Source under the terms of this&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; License, and the Corresponding Application Code in a form&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; License, and the Corresponding Application Code in a form&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; suitable for, and under terms that permit, the user to&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; suitable for, and under terms that permit, the user to&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; recombine or relink the Application with a modified version of&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; recombine or relink the Application with a modified version of&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; the Linked Version to produce a modified Combined Work, in the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; the Linked Version to produce a modified Combined Work, in the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; manner specified by section 6 of the GNU GPL for conveying&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; manner specified by section 6 of the GNU GPL for conveying&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Corresponding Source.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Corresponding Source.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 1) Use a suitable shared library mechanism for linking with the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 1) Use a suitable shared library mechanism for linking with the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Library. A suitable mechanism is one that (a) uses at run time&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Library. A suitable mechanism is one that (a) uses at run time&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a copy of the Library already present on the user's computer&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a copy of the Library already present on the user's computer&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; system, and (b) will operate properly with a modified version&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; system, and (b) will operate properly with a modified version&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; of the Library that is interface-compatible with the Linked&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; of the Library that is interface-compatible with the Linked&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Version.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Version.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; e) Provide Installation Information, but only if you would otherwise&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; e) Provide Installation Information, but only if you would otherwise&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; be required to provide such information under section 6 of the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; be required to provide such information under section 6 of the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; GNU GPL, and only to the extent that such information is&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; GNU GPL, and only to the extent that such information is&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; necessary to install and execute a modified version of the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; necessary to install and execute a modified version of the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Combined Work produced by recombining or relinking the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Combined Work produced by recombining or relinking the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Application with a modified version of the Linked Version. (If&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Application with a modified version of the Linked Version. (If&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; you use option 4d0, the Installation Information must accompany&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; you use option 4d0, the Installation Information must accompany&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; the Minimal Corresponding Source and Corresponding Application&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; the Minimal Corresponding Source and Corresponding Application&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Code. If you use option 4d1, you must provide the Installation&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Code. If you use option 4d1, you must provide the Installation&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Information in the manner specified by section 6 of the GNU GPL&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Information in the manner specified by section 6 of the GNU GPL&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; for conveying Corresponding Source.)&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; for conveying Corresponding Source.)&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 5. Combined Libraries.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 5. Combined Libraries.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; You may place library facilities that are a work based on the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; You may place library facilities that are a work based on the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Library side by side in a single library together with other library&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Library side by side in a single library together with other library&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;facilities that are not Applications and are not covered by this&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;facilities that are not Applications and are not covered by this&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;License, and convey such a combined library under terms of your&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;License, and convey such a combined library under terms of your&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;choice, if you do both of the following:&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;choice, if you do both of the following:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a) Accompany the combined library with a copy of the same work based&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; a) Accompany the combined library with a copy of the same work based&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; on the Library, uncombined with any other library facilities,&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; on the Library, uncombined with any other library facilities,&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; conveyed under the terms of this License.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; conveyed under the terms of this License.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; b) Give prominent notice with the combined library that part of it&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; b) Give prominent notice with the combined library that part of it&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; is a work based on the Library, and explaining where to find the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; is a work based on the Library, and explaining where to find the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; accompanying uncombined form of the same work.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; accompanying uncombined form of the same work.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 6. Revised Versions of the GNU Lesser General Public License.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 6. Revised Versions of the GNU Lesser General Public License.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; The Free Software Foundation may publish revised and/or new versions&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; The Free Software Foundation may publish revised and/or new versions&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;of the GNU Lesser General Public License from time to time. Such new&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;of the GNU Lesser General Public License from time to time. Such new&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;versions will be similar in spirit to the present version, but may&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;versions will be similar in spirit to the present version, but may&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;differ in detail to address new problems or concerns.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;differ in detail to address new problems or concerns.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Each version is given a distinguishing version number. If the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Each version is given a distinguishing version number. If the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Library as you received it specifies that a certain numbered version&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Library as you received it specifies that a certain numbered version&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;of the GNU Lesser General Public License &amp;quot;or any later version&amp;quot;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;of the GNU Lesser General Public License &amp;quot;or any later version&amp;quot;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;applies to it, you have the option of following the terms and&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;applies to it, you have the option of following the terms and&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;conditions either of that published version or of any later version&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;conditions either of that published version or of any later version&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;published by the Free Software Foundation. If the Library as you&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;published by the Free Software Foundation. If the Library as you&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;received it does not specify a version number of the GNU Lesser&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;received it does not specify a version number of the GNU Lesser&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;General Public License, you may choose any version of the GNU Lesser&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;General Public License, you may choose any version of the GNU Lesser&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;General Public License ever published by the Free Software Foundation.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;General Public License ever published by the Free Software Foundation.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; If the Library as you received it specifies that a proxy can decide&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; If the Library as you received it specifies that a proxy can decide&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;whether future versions of the GNU Lesser General Public License shall&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;whether future versions of the GNU Lesser General Public License shall&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;apply, that proxy's public statement of acceptance of any version is&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;apply, that proxy's public statement of acceptance of any version is&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;permanent authorization for you to choose that version for the&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;permanent authorization for you to choose that version for the&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Library.&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Library.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="usedLibrariesLabel"> <widget class="QLabel" name="usedLibrariesLabel">
<property name="text"> <property name="text">
<string>Used libraries</string> <string>Used libraries</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTableWidget" name="tableWidget"/> <widget class="QTableWidget" name="tableWidget"/>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
<connections> <connections>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>PDFAboutDialog</receiver> <receiver>PDFAboutDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>248</x> <x>248</x>
<y>254</y> <y>254</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>157</x> <x>157</x>
<y>274</y> <y>274</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>PDFAboutDialog</receiver> <receiver>PDFAboutDialog</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>316</x> <x>316</x>
<y>260</y> <y>260</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>286</x> <x>286</x>
<y>274</y> <y>274</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
</connections> </connections>
</ui> </ui>

View File

@ -1,47 +1,47 @@
// Copyright (C) 2021 Jakub Melka // Copyright (C) 2021 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
// PDF4QT is free software: you can redistribute it and/or modify // PDF4QT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // 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 // the Free Software Foundation, either version 3 of the License, or
// with the written consent of the copyright owner, any later version. // with the written consent of the copyright owner, any later version.
// //
// PDF4QT is distributed in the hope that it will be useful, // PDF4QT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. // along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
#include "pdfconstants.h" #include "pdfconstants.h"
#include "mainwindow.h" #include "mainwindow.h"
#include <QApplication> #include <QApplication>
#include <QCommandLineParser> #include <QCommandLineParser>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication::setAttribute(Qt::AA_CompressHighFrequencyEvents, true); QApplication::setAttribute(Qt::AA_CompressHighFrequencyEvents, true);
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true); QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
QApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity, true); QApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity, true);
QApplication application(argc, argv); QApplication application(argc, argv);
QCoreApplication::setOrganizationName("MelkaJ"); QCoreApplication::setOrganizationName("MelkaJ");
QCoreApplication::setApplicationName("PDF4QT Document Diff"); QCoreApplication::setApplicationName("PDF4QT Document Diff");
QCoreApplication::setApplicationVersion(pdf::PDF_LIBRARY_VERSION); QCoreApplication::setApplicationVersion(pdf::PDF_LIBRARY_VERSION);
QApplication::setApplicationDisplayName(QApplication::translate("Application", "PDF4QT Document Diff")); QApplication::setApplicationDisplayName(QApplication::translate("Application", "PDF4QT Document Diff"));
QCommandLineParser parser; QCommandLineParser parser;
parser.setApplicationDescription(QCoreApplication::applicationName()); parser.setApplicationDescription(QCoreApplication::applicationName());
parser.addHelpOption(); parser.addHelpOption();
parser.addVersionOption(); parser.addVersionOption();
parser.addPositionalArgument("file1", "The PDF file to be compared."); parser.addPositionalArgument("file1", "The PDF file to be compared.");
parser.addPositionalArgument("file2", "The PDF file to be compared."); parser.addPositionalArgument("file2", "The PDF file to be compared.");
parser.process(application); parser.process(application);
pdfdocdiff::MainWindow mainWindow(nullptr); pdfdocdiff::MainWindow mainWindow(nullptr);
mainWindow.show(); mainWindow.show();
return application.exec(); return application.exec();
} }

View File

@ -1,386 +1,386 @@
// Copyright (C) 2021 Jakub Melka // Copyright (C) 2021 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
// PDF4QT is free software: you can redistribute it and/or modify // PDF4QT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // 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 // the Free Software Foundation, either version 3 of the License, or
// with the written consent of the copyright owner, any later version. // with the written consent of the copyright owner, any later version.
// //
// PDF4QT is distributed in the hope that it will be useful, // PDF4QT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. // along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "aboutdialog.h" #include "aboutdialog.h"
#include "pdfwidgetutils.h" #include "pdfwidgetutils.h"
#include "pdfdocumentreader.h" #include "pdfdocumentreader.h"
#include <QToolBar> #include <QToolBar>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QDesktopServices> #include <QDesktopServices>
#include <QMessageBox> #include <QMessageBox>
#include <QInputDialog> #include <QInputDialog>
#include <QFileDialog> #include <QFileDialog>
namespace pdfdocdiff namespace pdfdocdiff
{ {
MainWindow::MainWindow(QWidget* parent) : MainWindow::MainWindow(QWidget* parent) :
QMainWindow(parent), QMainWindow(parent),
ui(new Ui::MainWindow), ui(new Ui::MainWindow),
m_progress(new pdf::PDFProgress(this)), m_progress(new pdf::PDFProgress(this)),
m_taskbarButton(new QWinTaskbarButton(this)), m_taskbarButton(new QWinTaskbarButton(this)),
m_progressTaskbarIndicator(nullptr), m_progressTaskbarIndicator(nullptr),
m_diff(nullptr), m_diff(nullptr),
m_isChangingProgressStep(false), m_isChangingProgressStep(false),
m_dontDisplayErrorMessage(false) m_dontDisplayErrorMessage(false)
{ {
ui->setupUi(this); ui->setupUi(this);
setMinimumSize(pdf::PDFWidgetUtils::scaleDPI(this, QSize(800, 600))); setMinimumSize(pdf::PDFWidgetUtils::scaleDPI(this, QSize(800, 600)));
// Initialize task bar progress // Initialize task bar progress
m_progressTaskbarIndicator = m_taskbarButton->progress(); m_progressTaskbarIndicator = m_taskbarButton->progress();
ui->actionGet_Source->setData(int(Operation::GetSource)); ui->actionGet_Source->setData(int(Operation::GetSource));
ui->actionAbout->setData(int(Operation::About)); ui->actionAbout->setData(int(Operation::About));
ui->actionOpen_Left->setData(int(Operation::OpenLeft)); ui->actionOpen_Left->setData(int(Operation::OpenLeft));
ui->actionOpen_Right->setData(int(Operation::OpenRight)); ui->actionOpen_Right->setData(int(Operation::OpenRight));
ui->actionCompare->setData(int(Operation::Compare)); ui->actionCompare->setData(int(Operation::Compare));
ui->actionClose->setData(int(Operation::Close)); ui->actionClose->setData(int(Operation::Close));
QToolBar* mainToolbar = addToolBar(tr("Main")); QToolBar* mainToolbar = addToolBar(tr("Main"));
mainToolbar->setObjectName("main_toolbar"); mainToolbar->setObjectName("main_toolbar");
mainToolbar->addActions({ ui->actionOpen_Left, ui->actionOpen_Right }); mainToolbar->addActions({ ui->actionOpen_Left, ui->actionOpen_Right });
mainToolbar->addSeparator(); mainToolbar->addSeparator();
mainToolbar->addAction(ui->actionCompare); mainToolbar->addAction(ui->actionCompare);
QSize iconSize = pdf::PDFWidgetUtils::scaleDPI(this, QSize(24, 24)); QSize iconSize = pdf::PDFWidgetUtils::scaleDPI(this, QSize(24, 24));
auto toolbars = findChildren<QToolBar*>(); auto toolbars = findChildren<QToolBar*>();
for (QToolBar* toolbar : toolbars) for (QToolBar* toolbar : toolbars)
{ {
toolbar->setIconSize(iconSize); toolbar->setIconSize(iconSize);
ui->menuToolbars->addAction(toolbar->toggleViewAction()); ui->menuToolbars->addAction(toolbar->toggleViewAction());
} }
connect(&m_mapper, QOverload<int>::of(&QSignalMapper::mapped), this, &MainWindow::onMappedActionTriggered); connect(&m_mapper, QOverload<int>::of(&QSignalMapper::mapped), this, &MainWindow::onMappedActionTriggered);
QList<QAction*> actions = findChildren<QAction*>(); QList<QAction*> actions = findChildren<QAction*>();
for (QAction* action : actions) for (QAction* action : actions)
{ {
QVariant actionData = action->data(); QVariant actionData = action->data();
if (actionData.isValid()) if (actionData.isValid())
{ {
connect(action, &QAction::triggered, &m_mapper, QOverload<>::of(&QSignalMapper::map)); connect(action, &QAction::triggered, &m_mapper, QOverload<>::of(&QSignalMapper::map));
m_mapper.setMapping(action, actionData.toInt()); m_mapper.setMapping(action, actionData.toInt());
} }
} }
connect(m_progress, &pdf::PDFProgress::progressStarted, this, &MainWindow::onProgressStarted); connect(m_progress, &pdf::PDFProgress::progressStarted, this, &MainWindow::onProgressStarted);
connect(m_progress, &pdf::PDFProgress::progressStep, this, &MainWindow::onProgressStep); connect(m_progress, &pdf::PDFProgress::progressStep, this, &MainWindow::onProgressStep);
connect(m_progress, &pdf::PDFProgress::progressFinished, this, &MainWindow::onProgressFinished); connect(m_progress, &pdf::PDFProgress::progressFinished, this, &MainWindow::onProgressFinished);
m_diff.setProgress(m_progress); m_diff.setProgress(m_progress);
m_diff.setOption(pdf::PDFDiff::Asynchronous, true); m_diff.setOption(pdf::PDFDiff::Asynchronous, true);
connect(&m_diff, &pdf::PDFDiff::comparationFinished, this, &MainWindow::onComparationFinished); connect(&m_diff, &pdf::PDFDiff::comparationFinished, this, &MainWindow::onComparationFinished);
m_diff.setLeftDocument(&m_leftDocument); m_diff.setLeftDocument(&m_leftDocument);
m_diff.setRightDocument(&m_rightDocument); m_diff.setRightDocument(&m_rightDocument);
loadSettings(); loadSettings();
updateActions(); updateActions();
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
saveSettings(); saveSettings();
delete ui; delete ui;
} }
void MainWindow::showEvent(QShowEvent* event) void MainWindow::showEvent(QShowEvent* event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
m_taskbarButton->setWindow(windowHandle()); m_taskbarButton->setWindow(windowHandle());
} }
void MainWindow::closeEvent(QCloseEvent* event) void MainWindow::closeEvent(QCloseEvent* event)
{ {
BaseClass::closeEvent(event); BaseClass::closeEvent(event);
m_diff.stop(); m_diff.stop();
} }
void MainWindow::onMappedActionTriggered(int actionId) void MainWindow::onMappedActionTriggered(int actionId)
{ {
performOperation(static_cast<Operation>(actionId)); performOperation(static_cast<Operation>(actionId));
} }
void MainWindow::onComparationFinished() void MainWindow::onComparationFinished()
{ {
auto result = m_diff.getResult().getResult(); auto result = m_diff.getResult().getResult();
if (!result && !m_dontDisplayErrorMessage) if (!result && !m_dontDisplayErrorMessage)
{ {
QMessageBox::critical(this, tr("Error"), result.getErrorMessage()); QMessageBox::critical(this, tr("Error"), result.getErrorMessage());
} }
} }
void MainWindow::updateActions() void MainWindow::updateActions()
{ {
QList<QAction*> actions = findChildren<QAction*>(); QList<QAction*> actions = findChildren<QAction*>();
for (QAction* action : actions) for (QAction* action : actions)
{ {
QVariant actionData = action->data(); QVariant actionData = action->data();
if (actionData.isValid()) if (actionData.isValid())
{ {
action->setEnabled(canPerformOperation(static_cast<Operation>(actionData.toInt()))); action->setEnabled(canPerformOperation(static_cast<Operation>(actionData.toInt())));
} }
} }
} }
void MainWindow::loadSettings() void MainWindow::loadSettings()
{ {
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName()); QSettings settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName());
settings.beginGroup("MainWindow"); settings.beginGroup("MainWindow");
QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray(); QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
if (geometry.isEmpty()) if (geometry.isEmpty())
{ {
QRect availableGeometry = QApplication::desktop()->availableGeometry(this); QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
QRect windowRect(0, 0, availableGeometry.width() / 2, availableGeometry.height() / 2); QRect windowRect(0, 0, availableGeometry.width() / 2, availableGeometry.height() / 2);
windowRect = windowRect.translated(availableGeometry.center() - windowRect.center()); windowRect = windowRect.translated(availableGeometry.center() - windowRect.center());
setGeometry(windowRect); setGeometry(windowRect);
} }
else else
{ {
restoreGeometry(geometry); restoreGeometry(geometry);
} }
QByteArray state = settings.value("windowState", QByteArray()).toByteArray(); QByteArray state = settings.value("windowState", QByteArray()).toByteArray();
if (!state.isEmpty()) if (!state.isEmpty())
{ {
restoreState(state); restoreState(state);
} }
settings.endGroup(); settings.endGroup();
settings.beginGroup("Settings"); settings.beginGroup("Settings");
m_settings.directory = settings.value("directory").toString(); m_settings.directory = settings.value("directory").toString();
settings.endGroup(); settings.endGroup();
} }
void MainWindow::saveSettings() void MainWindow::saveSettings()
{ {
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName()); QSettings settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName());
settings.beginGroup("MainWindow"); settings.beginGroup("MainWindow");
settings.setValue("geometry", saveGeometry()); settings.setValue("geometry", saveGeometry());
settings.setValue("windowState", saveState()); settings.setValue("windowState", saveState());
settings.endGroup(); settings.endGroup();
settings.beginGroup("Settings"); settings.beginGroup("Settings");
settings.setValue("directory", m_settings.directory); settings.setValue("directory", m_settings.directory);
settings.endGroup(); settings.endGroup();
} }
bool MainWindow::canPerformOperation(Operation operation) const bool MainWindow::canPerformOperation(Operation operation) const
{ {
switch (operation) switch (operation)
{ {
case Operation::OpenLeft: case Operation::OpenLeft:
case Operation::OpenRight: case Operation::OpenRight:
case Operation::Compare: case Operation::Compare:
case Operation::Close: case Operation::Close:
case Operation::GetSource: case Operation::GetSource:
case Operation::About: case Operation::About:
return true; return true;
default: default:
Q_ASSERT(false); Q_ASSERT(false);
break; break;
} }
return false; return false;
} }
void MainWindow::performOperation(Operation operation) void MainWindow::performOperation(Operation operation)
{ {
switch (operation) switch (operation)
{ {
case Operation::OpenLeft: case Operation::OpenLeft:
{ {
pdf::PDFTemporaryValueChange guard(&m_dontDisplayErrorMessage, true); pdf::PDFTemporaryValueChange guard(&m_dontDisplayErrorMessage, true);
m_diff.stop(); m_diff.stop();
std::optional<pdf::PDFDocument> document = openDocument(); std::optional<pdf::PDFDocument> document = openDocument();
if (document) if (document)
{ {
m_leftDocument = std::move(*document); m_leftDocument = std::move(*document);
const size_t pageCount = m_leftDocument.getCatalog()->getPageCount(); const size_t pageCount = m_leftDocument.getCatalog()->getPageCount();
if (pageCount > 1) if (pageCount > 1)
{ {
ui->leftPageSelectionEdit->setText(QString("1-%2").arg(pageCount)); ui->leftPageSelectionEdit->setText(QString("1-%2").arg(pageCount));
} }
else if (pageCount == 1) else if (pageCount == 1)
{ {
ui->leftPageSelectionEdit->setText("1"); ui->leftPageSelectionEdit->setText("1");
} }
else else
{ {
ui->leftPageSelectionEdit->clear(); ui->leftPageSelectionEdit->clear();
} }
} }
break; break;
} }
case Operation::OpenRight: case Operation::OpenRight:
{ {
pdf::PDFTemporaryValueChange guard(&m_dontDisplayErrorMessage, true); pdf::PDFTemporaryValueChange guard(&m_dontDisplayErrorMessage, true);
m_diff.stop(); m_diff.stop();
std::optional<pdf::PDFDocument> document = openDocument(); std::optional<pdf::PDFDocument> document = openDocument();
if (document) if (document)
{ {
m_rightDocument = std::move(*document); m_rightDocument = std::move(*document);
const size_t pageCount = m_rightDocument.getCatalog()->getPageCount(); const size_t pageCount = m_rightDocument.getCatalog()->getPageCount();
if (pageCount > 1) if (pageCount > 1)
{ {
ui->rightPageSelectionEdit->setText(QString("1-%2").arg(pageCount)); ui->rightPageSelectionEdit->setText(QString("1-%2").arg(pageCount));
} }
else if (pageCount == 1) else if (pageCount == 1)
{ {
ui->rightPageSelectionEdit->setText("1"); ui->rightPageSelectionEdit->setText("1");
} }
else else
{ {
ui->rightPageSelectionEdit->clear(); ui->rightPageSelectionEdit->clear();
} }
} }
break; break;
} }
case Operation::Compare: case Operation::Compare:
{ {
pdf::PDFTemporaryValueChange guard(&m_dontDisplayErrorMessage, true); pdf::PDFTemporaryValueChange guard(&m_dontDisplayErrorMessage, true);
m_diff.stop(); m_diff.stop();
QString errorMessage; QString errorMessage;
pdf::PDFClosedIntervalSet rightPageIndices; pdf::PDFClosedIntervalSet rightPageIndices;
pdf::PDFClosedIntervalSet leftPageIndices = pdf::PDFClosedIntervalSet::parse(1, qMax<pdf::PDFInteger>(1, m_leftDocument.getCatalog()->getPageCount()), ui->leftPageSelectionEdit->text(), &errorMessage); pdf::PDFClosedIntervalSet leftPageIndices = pdf::PDFClosedIntervalSet::parse(1, qMax<pdf::PDFInteger>(1, m_leftDocument.getCatalog()->getPageCount()), ui->leftPageSelectionEdit->text(), &errorMessage);
if (errorMessage.isEmpty()) if (errorMessage.isEmpty())
{ {
rightPageIndices = pdf::PDFClosedIntervalSet::parse(1, qMax<pdf::PDFInteger>(1, m_rightDocument.getCatalog()->getPageCount()), ui->rightPageSelectionEdit->text(), &errorMessage); rightPageIndices = pdf::PDFClosedIntervalSet::parse(1, qMax<pdf::PDFInteger>(1, m_rightDocument.getCatalog()->getPageCount()), ui->rightPageSelectionEdit->text(), &errorMessage);
} }
// Check if pages are succesfully parsed // Check if pages are succesfully parsed
if (!errorMessage.isEmpty()) if (!errorMessage.isEmpty())
{ {
QMessageBox::critical(this, tr("Error"), errorMessage); QMessageBox::critical(this, tr("Error"), errorMessage);
break; break;
} }
leftPageIndices.translate(-1); leftPageIndices.translate(-1);
rightPageIndices.translate(-1); rightPageIndices.translate(-1);
m_diff.setPagesForLeftDocument(std::move(leftPageIndices)); m_diff.setPagesForLeftDocument(std::move(leftPageIndices));
m_diff.setPagesForRightDocument(std::move(rightPageIndices)); m_diff.setPagesForRightDocument(std::move(rightPageIndices));
m_diff.start(); m_diff.start();
break; break;
} }
case Operation::Close: case Operation::Close:
{ {
close(); close();
break; break;
} }
case Operation::GetSource: case Operation::GetSource:
{ {
QDesktopServices::openUrl(QUrl("https://github.com/JakubMelka/PDF4QT")); QDesktopServices::openUrl(QUrl("https://github.com/JakubMelka/PDF4QT"));
break; break;
} }
case Operation::About: case Operation::About:
{ {
PDFAboutDialog aboutDialog(this); PDFAboutDialog aboutDialog(this);
aboutDialog.exec(); aboutDialog.exec();
break; break;
} }
default: default:
{ {
Q_ASSERT(false); Q_ASSERT(false);
break; break;
} }
} }
updateActions(); updateActions();
} }
std::optional<pdf::PDFDocument> MainWindow::openDocument() std::optional<pdf::PDFDocument> MainWindow::openDocument()
{ {
QString fileName = QFileDialog::getOpenFileName(this, tr("Select PDF document"), m_settings.directory, tr("PDF document (*.pdf)")); QString fileName = QFileDialog::getOpenFileName(this, tr("Select PDF document"), m_settings.directory, tr("PDF document (*.pdf)"));
if (fileName.isEmpty()) if (fileName.isEmpty())
{ {
return std::nullopt; return std::nullopt;
} }
auto queryPassword = [this](bool* ok) auto queryPassword = [this](bool* ok)
{ {
*ok = false; *ok = false;
return QInputDialog::getText(this, tr("Encrypted document"), tr("Enter password to access document content"), QLineEdit::Password, QString(), ok); return QInputDialog::getText(this, tr("Encrypted document"), tr("Enter password to access document content"), QLineEdit::Password, QString(), ok);
}; };
// Mark current directory as this // Mark current directory as this
QFileInfo fileInfo(fileName); QFileInfo fileInfo(fileName);
m_settings.directory = fileInfo.dir().absolutePath(); m_settings.directory = fileInfo.dir().absolutePath();
// Try to open a new document // Try to open a new document
pdf::PDFDocumentReader reader(nullptr, qMove(queryPassword), true, false); pdf::PDFDocumentReader reader(nullptr, qMove(queryPassword), true, false);
pdf::PDFDocument document = reader.readFromFile(fileName); pdf::PDFDocument document = reader.readFromFile(fileName);
QString errorMessage = reader.getErrorMessage(); QString errorMessage = reader.getErrorMessage();
pdf::PDFDocumentReader::Result result = reader.getReadingResult(); pdf::PDFDocumentReader::Result result = reader.getReadingResult();
if (result == pdf::PDFDocumentReader::Result::OK) if (result == pdf::PDFDocumentReader::Result::OK)
{ {
return document; return document;
} }
else if (result == pdf::PDFDocumentReader::Result::Failed) else if (result == pdf::PDFDocumentReader::Result::Failed)
{ {
QMessageBox::critical(this, tr("Error"), errorMessage); QMessageBox::critical(this, tr("Error"), errorMessage);
} }
return pdf::PDFDocument(); return pdf::PDFDocument();
} }
void MainWindow::onProgressStarted(pdf::ProgressStartupInfo info) void MainWindow::onProgressStarted(pdf::ProgressStartupInfo info)
{ {
m_progressTaskbarIndicator->setRange(0, 100); m_progressTaskbarIndicator->setRange(0, 100);
m_progressTaskbarIndicator->reset(); m_progressTaskbarIndicator->reset();
m_progressTaskbarIndicator->show(); m_progressTaskbarIndicator->show();
} }
void MainWindow::onProgressStep(int percentage) void MainWindow::onProgressStep(int percentage)
{ {
if (m_isChangingProgressStep) if (m_isChangingProgressStep)
{ {
return; return;
} }
pdf::PDFTemporaryValueChange guard(&m_isChangingProgressStep, true); pdf::PDFTemporaryValueChange guard(&m_isChangingProgressStep, true);
m_progressTaskbarIndicator->setValue(percentage); m_progressTaskbarIndicator->setValue(percentage);
} }
void MainWindow::onProgressFinished() void MainWindow::onProgressFinished()
{ {
m_progressTaskbarIndicator->hide(); m_progressTaskbarIndicator->hide();
} }
} // namespace pdfdocdiff } // namespace pdfdocdiff

View File

@ -1,103 +1,103 @@
// Copyright (C) 2021 Jakub Melka // Copyright (C) 2021 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
// PDF4QT is free software: you can redistribute it and/or modify // PDF4QT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // 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 // the Free Software Foundation, either version 3 of the License, or
// with the written consent of the copyright owner, any later version. // with the written consent of the copyright owner, any later version.
// //
// PDF4QT is distributed in the hope that it will be useful, // PDF4QT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. // along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
#ifndef PDFDOCDIFF_MAINWINDOW_H #ifndef PDFDOCDIFF_MAINWINDOW_H
#define PDFDOCDIFF_MAINWINDOW_H #define PDFDOCDIFF_MAINWINDOW_H
#include "pdfdocument.h" #include "pdfdocument.h"
#include "pdfdiff.h" #include "pdfdiff.h"
#include <QMainWindow> #include <QMainWindow>
#include <QSignalMapper> #include <QSignalMapper>
#include <QWinTaskbarButton> #include <QWinTaskbarButton>
#include <QWinTaskbarProgress> #include <QWinTaskbarProgress>
namespace Ui namespace Ui
{ {
class MainWindow; class MainWindow;
} }
namespace pdfdocdiff namespace pdfdocdiff
{ {
class MainWindow : public QMainWindow class MainWindow : public QMainWindow
{ {
Q_OBJECT Q_OBJECT
private: private:
using BaseClass = QMainWindow; using BaseClass = QMainWindow;
public: public:
explicit MainWindow(QWidget* parent); explicit MainWindow(QWidget* parent);
virtual ~MainWindow() override; virtual ~MainWindow() override;
enum class Operation enum class Operation
{ {
OpenLeft, OpenLeft,
OpenRight, OpenRight,
Compare, Compare,
Close, Close,
GetSource, GetSource,
About About
}; };
virtual void showEvent(QShowEvent* event) override; virtual void showEvent(QShowEvent* event) override;
virtual void closeEvent(QCloseEvent* event) override; virtual void closeEvent(QCloseEvent* event) override;
private slots: private slots:
void updateActions(); void updateActions();
private: private:
void onMappedActionTriggered(int actionId); void onMappedActionTriggered(int actionId);
void onComparationFinished(); void onComparationFinished();
void onProgressStarted(pdf::ProgressStartupInfo info); void onProgressStarted(pdf::ProgressStartupInfo info);
void onProgressStep(int percentage); void onProgressStep(int percentage);
void onProgressFinished(); void onProgressFinished();
void loadSettings(); void loadSettings();
void saveSettings(); void saveSettings();
bool canPerformOperation(Operation operation) const; bool canPerformOperation(Operation operation) const;
void performOperation(Operation operation); void performOperation(Operation operation);
std::optional<pdf::PDFDocument> openDocument(); std::optional<pdf::PDFDocument> openDocument();
struct Settings struct Settings
{ {
QString directory; QString directory;
}; };
Ui::MainWindow* ui; Ui::MainWindow* ui;
pdf::PDFProgress* m_progress; pdf::PDFProgress* m_progress;
QWinTaskbarButton* m_taskbarButton; QWinTaskbarButton* m_taskbarButton;
QWinTaskbarProgress* m_progressTaskbarIndicator; QWinTaskbarProgress* m_progressTaskbarIndicator;
Settings m_settings; Settings m_settings;
QSignalMapper m_mapper; QSignalMapper m_mapper;
pdf::PDFDiff m_diff; pdf::PDFDiff m_diff;
bool m_isChangingProgressStep; bool m_isChangingProgressStep;
bool m_dontDisplayErrorMessage; bool m_dontDisplayErrorMessage;
pdf::PDFDocument m_leftDocument; pdf::PDFDocument m_leftDocument;
pdf::PDFDocument m_rightDocument; pdf::PDFDocument m_rightDocument;
}; };
} // namespace pdfdocdiff } // namespace pdfdocdiff
#endif // PDFDOCDIFF_MAINWINDOW_H #endif // PDFDOCDIFF_MAINWINDOW_H

View File

@ -1,180 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>MainWindow</class> <class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow"> <widget class="QMainWindow" name="MainWindow">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>864</width> <width>864</width>
<height>638</height> <height>638</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Workspace</string> <string>Workspace</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,1"> <layout class="QGridLayout" name="gridLayout" rowstretch="0,1">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="leftDocumentSettingsGroupBox"> <widget class="QGroupBox" name="leftDocumentSettingsGroupBox">
<property name="title"> <property name="title">
<string>Left</string> <string>Left</string>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="leftPageSelectionLabel"> <widget class="QLabel" name="leftPageSelectionLabel">
<property name="text"> <property name="text">
<string>Page Selection:</string> <string>Page Selection:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="leftPageSelectionEdit"/> <widget class="QLineEdit" name="leftPageSelectionEdit"/>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QGroupBox" name="rightDocumentSettingsGroupBox"> <widget class="QGroupBox" name="rightDocumentSettingsGroupBox">
<property name="title"> <property name="title">
<string>Right</string> <string>Right</string>
</property> </property>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="rightPageSelectionLabel"> <widget class="QLabel" name="rightPageSelectionLabel">
<property name="text"> <property name="text">
<string>Page Selection:</string> <string>Page Selection:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="rightPageSelectionEdit"/> <widget class="QLineEdit" name="rightPageSelectionEdit"/>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="2"> <item row="1" column="0" colspan="2">
<widget class="QFrame" name="frame"> <widget class="QFrame" name="frame">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::Box</enum> <enum>QFrame::Box</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<property name="midLineWidth"> <property name="midLineWidth">
<number>3</number> <number>3</number>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menubar"> <widget class="QMenuBar" name="menubar">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>864</width> <width>864</width>
<height>21</height> <height>21</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
<property name="title"> <property name="title">
<string>File</string> <string>File</string>
</property> </property>
<addaction name="actionOpen_Left"/> <addaction name="actionOpen_Left"/>
<addaction name="actionOpen_Right"/> <addaction name="actionOpen_Right"/>
<addaction name="actionClose"/> <addaction name="actionClose"/>
</widget> </widget>
<widget class="QMenu" name="menuHelp"> <widget class="QMenu" name="menuHelp">
<property name="title"> <property name="title">
<string>Help</string> <string>Help</string>
</property> </property>
<addaction name="actionGet_Source"/> <addaction name="actionGet_Source"/>
<addaction name="actionAbout"/> <addaction name="actionAbout"/>
</widget> </widget>
<widget class="QMenu" name="menuToolbars"> <widget class="QMenu" name="menuToolbars">
<property name="title"> <property name="title">
<string>Toolbars</string> <string>Toolbars</string>
</property> </property>
</widget> </widget>
<widget class="QMenu" name="menuCompare"> <widget class="QMenu" name="menuCompare">
<property name="title"> <property name="title">
<string>Compare</string> <string>Compare</string>
</property> </property>
<addaction name="actionCompare"/> <addaction name="actionCompare"/>
</widget> </widget>
<addaction name="menuFile"/> <addaction name="menuFile"/>
<addaction name="menuCompare"/> <addaction name="menuCompare"/>
<addaction name="menuToolbars"/> <addaction name="menuToolbars"/>
<addaction name="menuHelp"/> <addaction name="menuHelp"/>
</widget> </widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>
<action name="actionGet_Source"> <action name="actionGet_Source">
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/pdfdocdiff/resources/get-source.svg</normaloff>:/pdfdocdiff/resources/get-source.svg</iconset> <normaloff>:/pdfdocdiff/resources/get-source.svg</normaloff>:/pdfdocdiff/resources/get-source.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Get Source</string> <string>Get Source</string>
</property> </property>
</action> </action>
<action name="actionAbout"> <action name="actionAbout">
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/pdfdocdiff/resources/about.svg</normaloff>:/pdfdocdiff/resources/about.svg</iconset> <normaloff>:/pdfdocdiff/resources/about.svg</normaloff>:/pdfdocdiff/resources/about.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>About</string> <string>About</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>F1</string> <string>F1</string>
</property> </property>
</action> </action>
<action name="actionOpen_Left"> <action name="actionOpen_Left">
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/pdfdocdiff/resources/open-left.svg</normaloff>:/pdfdocdiff/resources/open-left.svg</iconset> <normaloff>:/pdfdocdiff/resources/open-left.svg</normaloff>:/pdfdocdiff/resources/open-left.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Open Left</string> <string>Open Left</string>
</property> </property>
</action> </action>
<action name="actionOpen_Right"> <action name="actionOpen_Right">
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/pdfdocdiff/resources/open-right.svg</normaloff>:/pdfdocdiff/resources/open-right.svg</iconset> <normaloff>:/pdfdocdiff/resources/open-right.svg</normaloff>:/pdfdocdiff/resources/open-right.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Open Right</string> <string>Open Right</string>
</property> </property>
</action> </action>
<action name="actionCompare"> <action name="actionCompare">
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/pdfdocdiff/resources/compare.svg</normaloff>:/pdfdocdiff/resources/compare.svg</iconset> <normaloff>:/pdfdocdiff/resources/compare.svg</normaloff>:/pdfdocdiff/resources/compare.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Compare</string> <string>Compare</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>F5</string> <string>F5</string>
</property> </property>
</action> </action>
<action name="actionClose"> <action name="actionClose">
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/pdfdocdiff/resources/close.svg</normaloff>:/pdfdocdiff/resources/close.svg</iconset> <normaloff>:/pdfdocdiff/resources/close.svg</normaloff>:/pdfdocdiff/resources/close.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Close</string> <string>Close</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+F4</string> <string>Ctrl+F4</string>
</property> </property>
</action> </action>
</widget> </widget>
<resources> <resources>
<include location="resources.qrc"/> <include location="resources.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -1,10 +1,10 @@
<RCC> <RCC>
<qresource prefix="/pdfdocdiff"> <qresource prefix="/pdfdocdiff">
<file>resources/about.svg</file> <file>resources/about.svg</file>
<file>resources/close.svg</file> <file>resources/close.svg</file>
<file>resources/compare.svg</file> <file>resources/compare.svg</file>
<file>resources/get-source.svg</file> <file>resources/get-source.svg</file>
<file>resources/open-left.svg</file> <file>resources/open-left.svg</file>
<file>resources/open-right.svg</file> <file>resources/open-right.svg</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -1,177 +1,177 @@
// Copyright (C) 2021 Jakub Melka // Copyright (C) 2021 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
// PDF4QT is free software: you can redistribute it and/or modify // PDF4QT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // 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 // the Free Software Foundation, either version 3 of the License, or
// with the written consent of the copyright owner, any later version. // with the written consent of the copyright owner, any later version.
// //
// PDF4QT is distributed in the hope that it will be useful, // PDF4QT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. // along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
#include "pdfalgorithmlcs.h" #include "pdfalgorithmlcs.h"
namespace pdf namespace pdf
{ {
void PDFAlgorithmLongestCommonSubsequenceBase::markSequence(Sequence& sequence, void PDFAlgorithmLongestCommonSubsequenceBase::markSequence(Sequence& sequence,
const std::vector<size_t>& movedItemsLeft, const std::vector<size_t>& movedItemsLeft,
const std::vector<size_t>& movedItemsRight) const std::vector<size_t>& movedItemsRight)
{ {
Sequence updatedSequence; Sequence updatedSequence;
Q_ASSERT(std::is_sorted(movedItemsLeft.cbegin(), movedItemsLeft.cend())); Q_ASSERT(std::is_sorted(movedItemsLeft.cbegin(), movedItemsLeft.cend()));
Q_ASSERT(std::is_sorted(movedItemsRight.cbegin(), movedItemsRight.cend())); Q_ASSERT(std::is_sorted(movedItemsRight.cbegin(), movedItemsRight.cend()));
for (auto it = sequence.cbegin(); it != sequence.cend();) for (auto it = sequence.cbegin(); it != sequence.cend();)
{ {
if (it->isMatch()) if (it->isMatch())
{ {
updatedSequence.push_back(*it); updatedSequence.push_back(*it);
++it; ++it;
continue; continue;
} }
Sequence leftItems; Sequence leftItems;
Sequence rightItems; Sequence rightItems;
for (; it != sequence.cend() && !it->isMatch(); ++it) for (; it != sequence.cend() && !it->isMatch(); ++it)
{ {
const SequenceItem& currentItem = *it; const SequenceItem& currentItem = *it;
Q_ASSERT(currentItem.isLeft() || currentItem.isRight()); Q_ASSERT(currentItem.isLeft() || currentItem.isRight());
if (currentItem.isLeft()) if (currentItem.isLeft())
{ {
if (std::binary_search(movedItemsLeft.cbegin(), movedItemsLeft.cend(), currentItem.index1)) if (std::binary_search(movedItemsLeft.cbegin(), movedItemsLeft.cend(), currentItem.index1))
{ {
SequenceItem item = *it; SequenceItem item = *it;
item.markMovedLeft(); item.markMovedLeft();
updatedSequence.push_back(item); updatedSequence.push_back(item);
} }
else else
{ {
leftItems.push_back(currentItem); leftItems.push_back(currentItem);
} }
} }
if (currentItem.isRight()) if (currentItem.isRight())
{ {
if (std::binary_search(movedItemsRight.cbegin(), movedItemsRight.cend(), currentItem.index2)) if (std::binary_search(movedItemsRight.cbegin(), movedItemsRight.cend(), currentItem.index2))
{ {
SequenceItem item = *it; SequenceItem item = *it;
item.markMovedRight(); item.markMovedRight();
updatedSequence.push_back(item); updatedSequence.push_back(item);
} }
else else
{ {
rightItems.push_back(currentItem); rightItems.push_back(currentItem);
} }
} }
} }
std::reverse(leftItems.begin(), leftItems.end()); std::reverse(leftItems.begin(), leftItems.end());
std::reverse(rightItems.begin(), rightItems.end()); std::reverse(rightItems.begin(), rightItems.end());
bool isReplaced = !leftItems.empty() && !rightItems.empty(); bool isReplaced = !leftItems.empty() && !rightItems.empty();
while (!leftItems.empty() && !rightItems.empty()) while (!leftItems.empty() && !rightItems.empty())
{ {
SequenceItem item; SequenceItem item;
item.index1 = leftItems.back().index1; item.index1 = leftItems.back().index1;
item.index2 = rightItems.back().index2; item.index2 = rightItems.back().index2;
item.markReplaced(); item.markReplaced();
updatedSequence.push_back(item); updatedSequence.push_back(item);
leftItems.pop_back(); leftItems.pop_back();
rightItems.pop_back(); rightItems.pop_back();
} }
while (!leftItems.empty()) while (!leftItems.empty())
{ {
SequenceItem item = leftItems.back(); SequenceItem item = leftItems.back();
item.markRemoved(); item.markRemoved();
if (isReplaced) if (isReplaced)
{ {
item.markReplaced(); item.markReplaced();
} }
updatedSequence.push_back(item); updatedSequence.push_back(item);
leftItems.pop_back(); leftItems.pop_back();
} }
while (!rightItems.empty()) while (!rightItems.empty())
{ {
SequenceItem item = rightItems.back(); SequenceItem item = rightItems.back();
item.markAdded(); item.markAdded();
if (isReplaced) if (isReplaced)
{ {
item.markReplaced(); item.markReplaced();
} }
updatedSequence.push_back(item); updatedSequence.push_back(item);
rightItems.pop_back(); rightItems.pop_back();
} }
} }
for (SequenceItem& item : updatedSequence) for (SequenceItem& item : updatedSequence)
{ {
if (item.isMatch() && !item.isRemoved() && !item.isReplaced() && !item.isAdded() && item.index1 != item.index2) if (item.isMatch() && !item.isRemoved() && !item.isReplaced() && !item.isAdded() && item.index1 != item.index2)
{ {
item.markMoved(); item.markMoved();
} }
} }
sequence = qMove(updatedSequence); sequence = qMove(updatedSequence);
} }
PDFAlgorithmLongestCommonSubsequenceBase::SequenceItemRanges PDFAlgorithmLongestCommonSubsequenceBase::getModifiedRanges(Sequence& sequence) PDFAlgorithmLongestCommonSubsequenceBase::SequenceItemRanges PDFAlgorithmLongestCommonSubsequenceBase::getModifiedRanges(Sequence& sequence)
{ {
SequenceItemRanges result; SequenceItemRanges result;
for (auto it = sequence.begin(); it != sequence.end();) for (auto it = sequence.begin(); it != sequence.end();)
{ {
const SequenceItem& item = *it; const SequenceItem& item = *it;
if (!item.isModified()) if (!item.isModified())
{ {
++it; ++it;
continue; continue;
} }
// Jakub Melka: now, we have iterator pointing on item, // Jakub Melka: now, we have iterator pointing on item,
// which has been modified. We will search for modification // which has been modified. We will search for modification
// range. // range.
auto itEnd = it; auto itEnd = it;
while (itEnd != sequence.end() && itEnd->isModified()) while (itEnd != sequence.end() && itEnd->isModified())
{ {
++itEnd; ++itEnd;
} }
result.emplace_back(it, itEnd); result.emplace_back(it, itEnd);
it = itEnd; it = itEnd;
} }
return result; return result;
} }
PDFAlgorithmLongestCommonSubsequenceBase::SequenceItemFlags PDFAlgorithmLongestCommonSubsequenceBase::collectFlags(const SequenceItemRange& range) PDFAlgorithmLongestCommonSubsequenceBase::SequenceItemFlags PDFAlgorithmLongestCommonSubsequenceBase::collectFlags(const SequenceItemRange& range)
{ {
SequenceItemFlags flags = 0; SequenceItemFlags flags = 0;
for (auto it = range.first; it != range.second; ++it) for (auto it = range.first; it != range.second; ++it)
{ {
flags |= it->flags; flags |= it->flags;
} }
return flags; return flags;
} }
} // namespace pdf } // namespace pdf

View File

@ -1,260 +1,260 @@
// Copyright (C) 2021 Jakub Melka // Copyright (C) 2021 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
// PDF4QT is free software: you can redistribute it and/or modify // PDF4QT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // 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 // the Free Software Foundation, either version 3 of the License, or
// with the written consent of the copyright owner, any later version. // with the written consent of the copyright owner, any later version.
// //
// PDF4QT is distributed in the hope that it will be useful, // PDF4QT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. // along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
#ifndef PDFALGORITHMLCS_H #ifndef PDFALGORITHMLCS_H
#define PDFALGORITHMLCS_H #define PDFALGORITHMLCS_H
#include "pdfglobal.h" #include "pdfglobal.h"
namespace pdf namespace pdf
{ {
class PDFAlgorithmLongestCommonSubsequenceBase class PDFAlgorithmLongestCommonSubsequenceBase
{ {
public: public:
enum SequenceItemFlag enum SequenceItemFlag
{ {
None = 0x0000, None = 0x0000,
MovedLeft = 0x0001, ///< Item has been moved from this position (is present in a sequence no. 1) MovedLeft = 0x0001, ///< Item has been moved from this position (is present in a sequence no. 1)
MovedRight = 0x0002, ///< Item has been moved to this position (is present in a sequence no. 2) MovedRight = 0x0002, ///< Item has been moved to this position (is present in a sequence no. 2)
Moved = 0x0004, ///< Index of item has been changed Moved = 0x0004, ///< Index of item has been changed
Added = 0x0008, ///< Item has been added to a sequence no. 2 Added = 0x0008, ///< Item has been added to a sequence no. 2
Removed = 0x0010, ///< Item has been removed from a sequence no. 1 Removed = 0x0010, ///< Item has been removed from a sequence no. 1
Replaced = 0x0020, ///< Item has been replaced (or sequence of items has been replaced) Replaced = 0x0020, ///< Item has been replaced (or sequence of items has been replaced)
}; };
Q_DECLARE_FLAGS(SequenceItemFlags, SequenceItemFlag) Q_DECLARE_FLAGS(SequenceItemFlags, SequenceItemFlag)
struct SequenceItem struct SequenceItem
{ {
size_t index1 = std::numeric_limits<size_t>::max(); size_t index1 = std::numeric_limits<size_t>::max();
size_t index2 = std::numeric_limits<size_t>::max(); size_t index2 = std::numeric_limits<size_t>::max();
SequenceItemFlags flags = None; SequenceItemFlags flags = None;
bool isLeftValid() const { return index1 != std::numeric_limits<size_t>::max(); } bool isLeftValid() const { return index1 != std::numeric_limits<size_t>::max(); }
bool isRightValid() const { return index2 != std::numeric_limits<size_t>::max(); } bool isRightValid() const { return index2 != std::numeric_limits<size_t>::max(); }
bool isLeft() const { return isLeftValid() && !isRightValid(); } bool isLeft() const { return isLeftValid() && !isRightValid(); }
bool isRight() const { return isRightValid() && !isLeftValid(); } bool isRight() const { return isRightValid() && !isLeftValid(); }
bool isMatch() const { return isLeftValid() && isRightValid(); } bool isMatch() const { return isLeftValid() && isRightValid(); }
bool isMovedLeft() const { return flags.testFlag(MovedLeft); } bool isMovedLeft() const { return flags.testFlag(MovedLeft); }
bool isMovedRight() const { return flags.testFlag(MovedRight); } bool isMovedRight() const { return flags.testFlag(MovedRight); }
bool isMoved() const { return flags.testFlag(Moved); } bool isMoved() const { return flags.testFlag(Moved); }
bool isAdded() const { return flags.testFlag(Added); } bool isAdded() const { return flags.testFlag(Added); }
bool isRemoved() const { return flags.testFlag(Removed); } bool isRemoved() const { return flags.testFlag(Removed); }
bool isReplaced() const { return flags.testFlag(Replaced); } bool isReplaced() const { return flags.testFlag(Replaced); }
bool isModified() const { return isAdded() || isRemoved() || isReplaced(); } bool isModified() const { return isAdded() || isRemoved() || isReplaced(); }
void markMovedLeft() { flags.setFlag(MovedLeft); } void markMovedLeft() { flags.setFlag(MovedLeft); }
void markMovedRight() { flags.setFlag(MovedRight); } void markMovedRight() { flags.setFlag(MovedRight); }
void markMoved() { flags.setFlag(Moved); } void markMoved() { flags.setFlag(Moved); }
void markAdded() { flags.setFlag(Added); } void markAdded() { flags.setFlag(Added); }
void markRemoved() { flags.setFlag(Removed); } void markRemoved() { flags.setFlag(Removed); }
void markReplaced() { flags.setFlag(Replaced); } void markReplaced() { flags.setFlag(Replaced); }
}; };
using Sequence = typename std::vector<SequenceItem>; using Sequence = typename std::vector<SequenceItem>;
using SequenceIterator = typename Sequence::iterator; using SequenceIterator = typename Sequence::iterator;
using SequenceItemRange = typename std::pair<SequenceIterator, SequenceIterator>; using SequenceItemRange = typename std::pair<SequenceIterator, SequenceIterator>;
using SequenceItemRanges = typename std::vector<SequenceItemRange>; using SequenceItemRanges = typename std::vector<SequenceItemRange>;
/// Marks a sequence with set of flags representing added/removed/replaced/moved /// Marks a sequence with set of flags representing added/removed/replaced/moved
/// items. Moved items sequences must be sorted. /// items. Moved items sequences must be sorted.
/// \param sequence Sequence to be marked /// \param sequence Sequence to be marked
/// \param movedItemsLeft Sorted sequence of left indices, which have been moved /// \param movedItemsLeft Sorted sequence of left indices, which have been moved
/// \param movedItemsRight sorted sequence of right indices, which have been moved /// \param movedItemsRight sorted sequence of right indices, which have been moved
static void markSequence(Sequence& sequence, static void markSequence(Sequence& sequence,
const std::vector<size_t>& movedItemsLeft, const std::vector<size_t>& movedItemsLeft,
const std::vector<size_t>& movedItemsRight); const std::vector<size_t>& movedItemsRight);
/// Returns item ranges, which should be checked - for example, /// Returns item ranges, which should be checked - for example,
/// for text modification. /// for text modification.
/// \param sequence Sequence /// \param sequence Sequence
static SequenceItemRanges getModifiedRanges(Sequence& sequence); static SequenceItemRanges getModifiedRanges(Sequence& sequence);
/// Collect flags from given item range /// Collect flags from given item range
/// \param range Range /// \param range Range
static SequenceItemFlags collectFlags(const SequenceItemRange& range); static SequenceItemFlags collectFlags(const SequenceItemRange& range);
}; };
/// Algorithm for computing longest common subsequence, on two sequences /// Algorithm for computing longest common subsequence, on two sequences
/// of objects, which are implementing operator "==" (equal operator). /// of objects, which are implementing operator "==" (equal operator).
/// Constructor takes bidirectional iterators to the sequence. So, iterators /// Constructor takes bidirectional iterators to the sequence. So, iterators
/// are requred to be bidirectional. /// are requred to be bidirectional.
template<typename Iterator, typename Comparator> template<typename Iterator, typename Comparator>
class PDFAlgorithmLongestCommonSubsequence : public PDFAlgorithmLongestCommonSubsequenceBase class PDFAlgorithmLongestCommonSubsequence : public PDFAlgorithmLongestCommonSubsequenceBase
{ {
public: public:
PDFAlgorithmLongestCommonSubsequence(Iterator it1, PDFAlgorithmLongestCommonSubsequence(Iterator it1,
Iterator it1End, Iterator it1End,
Iterator it2, Iterator it2,
Iterator it2End, Iterator it2End,
Comparator comparator); Comparator comparator);
void perform(); void perform();
const Sequence& getSequence() const { return m_sequence; } const Sequence& getSequence() const { return m_sequence; }
private: private:
Iterator m_it1; Iterator m_it1;
Iterator m_it1End; Iterator m_it1End;
Iterator m_it2; Iterator m_it2;
Iterator m_it2End; Iterator m_it2End;
size_t m_size1; size_t m_size1;
size_t m_size2; size_t m_size2;
size_t m_matrixSize; size_t m_matrixSize;
Comparator m_comparator; Comparator m_comparator;
std::vector<bool> m_backtrackData; std::vector<bool> m_backtrackData;
Sequence m_sequence; Sequence m_sequence;
}; };
template<typename Iterator, typename Comparator> template<typename Iterator, typename Comparator>
PDFAlgorithmLongestCommonSubsequence<Iterator, Comparator>::PDFAlgorithmLongestCommonSubsequence(Iterator it1, PDFAlgorithmLongestCommonSubsequence<Iterator, Comparator>::PDFAlgorithmLongestCommonSubsequence(Iterator it1,
Iterator it1End, Iterator it1End,
Iterator it2, Iterator it2,
Iterator it2End, Iterator it2End,
Comparator comparator) : Comparator comparator) :
m_it1(std::move(it1)), m_it1(std::move(it1)),
m_it1End(std::move(it1End)), m_it1End(std::move(it1End)),
m_it2(std::move(it2)), m_it2(std::move(it2)),
m_it2End(std::move(it2End)), m_it2End(std::move(it2End)),
m_size1(0), m_size1(0),
m_size2(0), m_size2(0),
m_matrixSize(0), m_matrixSize(0),
m_comparator(std::move(comparator)) m_comparator(std::move(comparator))
{ {
m_size1 = std::distance(m_it1, m_it1End) + 1; m_size1 = std::distance(m_it1, m_it1End) + 1;
m_size2 = std::distance(m_it2, m_it2End) + 1; m_size2 = std::distance(m_it2, m_it2End) + 1;
m_matrixSize = m_size1 * m_size2; m_matrixSize = m_size1 * m_size2;
} }
template<typename Iterator, typename Comparator> template<typename Iterator, typename Comparator>
void PDFAlgorithmLongestCommonSubsequence<Iterator, Comparator>::perform() void PDFAlgorithmLongestCommonSubsequence<Iterator, Comparator>::perform()
{ {
m_backtrackData.resize(m_matrixSize); m_backtrackData.resize(m_matrixSize);
m_sequence.clear(); m_sequence.clear();
std::vector<size_t> rowTop(m_size1, size_t()); std::vector<size_t> rowTop(m_size1, size_t());
std::vector<size_t> rowBottom(m_size1, size_t()); std::vector<size_t> rowBottom(m_size1, size_t());
// Jakub Melka: we will have columns consisting of it1...it1End // Jakub Melka: we will have columns consisting of it1...it1End
// and rows consisting of it2...it2End. We iterate trough rows, // and rows consisting of it2...it2End. We iterate trough rows,
// and for each row, we update longest common subsequence data. // and for each row, we update longest common subsequence data.
auto it2 = m_it2; auto it2 = m_it2;
for (size_t i2 = 1; i2 < m_size2; ++i2, ++it2) for (size_t i2 = 1; i2 < m_size2; ++i2, ++it2)
{ {
auto it1 = m_it1; auto it1 = m_it1;
for (size_t i1 = 1; i1 < m_size1; ++i1, ++it1) for (size_t i1 = 1; i1 < m_size1; ++i1, ++it1)
{ {
if (m_comparator(*it1, *it2)) if (m_comparator(*it1, *it2))
{ {
// We have match // We have match
rowBottom[i1] = rowTop[i1 - 1] + 1; rowBottom[i1] = rowTop[i1 - 1] + 1;
} }
else else
{ {
const size_t leftCellValue = rowBottom[i1 - 1]; const size_t leftCellValue = rowBottom[i1 - 1];
const size_t upperCellValue = rowTop[i1]; const size_t upperCellValue = rowTop[i1];
bool isLeftBigger = leftCellValue > upperCellValue; bool isLeftBigger = leftCellValue > upperCellValue;
if (isLeftBigger) if (isLeftBigger)
{ {
rowBottom[i1] = leftCellValue; rowBottom[i1] = leftCellValue;
m_backtrackData[i2 * m_size1 + i1] = true; m_backtrackData[i2 * m_size1 + i1] = true;
} }
else else
{ {
rowBottom[i1] = upperCellValue; rowBottom[i1] = upperCellValue;
m_backtrackData[i2 * m_size1 + i1] = false; m_backtrackData[i2 * m_size1 + i1] = false;
} }
} }
} }
// Bottom row will become top row // Bottom row will become top row
std::swap(rowTop, rowBottom); std::swap(rowTop, rowBottom);
} }
size_t i1 = m_size1 - 1; size_t i1 = m_size1 - 1;
size_t i2 = m_size2 - 1; size_t i2 = m_size2 - 1;
while (i1 > 0 && i2 > 0) while (i1 > 0 && i2 > 0)
{ {
SequenceItem item; SequenceItem item;
const size_t index1 = i1 - 1; const size_t index1 = i1 - 1;
const size_t index2 = i2 - 1; const size_t index2 = i2 - 1;
auto it1 = std::next(m_it1, index1); auto it1 = std::next(m_it1, index1);
auto it2 = std::next(m_it2, index2); auto it2 = std::next(m_it2, index2);
if (m_comparator(*it1, *it2)) if (m_comparator(*it1, *it2))
{ {
item.index1 = index1; item.index1 = index1;
item.index2 = index2; item.index2 = index2;
--i1; --i1;
--i2; --i2;
} }
else else
{ {
if (m_backtrackData[i2 * m_size1 + i1]) if (m_backtrackData[i2 * m_size1 + i1])
{ {
item.index1 = index1; item.index1 = index1;
--i1; --i1;
} }
else else
{ {
item.index2 = index2; item.index2 = index2;
--i2; --i2;
} }
} }
m_sequence.push_back(item); m_sequence.push_back(item);
} }
while (i1 > 0) while (i1 > 0)
{ {
SequenceItem item; SequenceItem item;
const size_t index1 = i1 - 1; const size_t index1 = i1 - 1;
item.index1 = index1; item.index1 = index1;
--i1; --i1;
m_sequence.push_back(item); m_sequence.push_back(item);
} }
while (i2 > 0) while (i2 > 0)
{ {
SequenceItem item; SequenceItem item;
const size_t index2 = i2 - 1; const size_t index2 = i2 - 1;
item.index2 = index2; item.index2 = index2;
--i2; --i2;
m_sequence.push_back(item); m_sequence.push_back(item);
} }
std::reverse(m_sequence.begin(), m_sequence.end()); std::reverse(m_sequence.begin(), m_sequence.end());
} }
} // namespace pdf } // namespace pdf
#endif // PDFALGORITHMLCS_H #endif // PDFALGORITHMLCS_H

File diff suppressed because it is too large Load Diff

View File

@ -1,223 +1,223 @@
// Copyright (C) 2021 Jakub Melka // Copyright (C) 2021 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
// PDF4QT is free software: you can redistribute it and/or modify // PDF4QT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // 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 // the Free Software Foundation, either version 3 of the License, or
// with the written consent of the copyright owner, any later version. // with the written consent of the copyright owner, any later version.
// //
// PDF4QT is distributed in the hope that it will be useful, // PDF4QT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. // along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
#ifndef PDFDIFF_H #ifndef PDFDIFF_H
#define PDFDIFF_H #define PDFDIFF_H
#include "pdfdocument.h" #include "pdfdocument.h"
#include "pdfprogress.h" #include "pdfprogress.h"
#include "pdfutils.h" #include "pdfutils.h"
#include "pdfalgorithmlcs.h" #include "pdfalgorithmlcs.h"
#include "pdfdocumenttextflow.h" #include "pdfdocumenttextflow.h"
#include <QObject> #include <QObject>
#include <QFuture> #include <QFuture>
#include <QFutureWatcher> #include <QFutureWatcher>
#include <atomic> #include <atomic>
namespace pdf namespace pdf
{ {
struct PDFDiffPageContext; struct PDFDiffPageContext;
class PDFDiffResult class PDFDiffResult
{ {
public: public:
explicit PDFDiffResult(); explicit PDFDiffResult();
enum class Type enum class Type
{ {
Invalid, Invalid,
PageMoved, PageMoved,
PageAdded, PageAdded,
PageRemoved, PageRemoved,
RemovedTextCharContent, RemovedTextCharContent,
RemovedVectorGraphicContent, RemovedVectorGraphicContent,
RemovedImageContent, RemovedImageContent,
RemovedShadingContent, RemovedShadingContent,
AddedTextCharContent, AddedTextCharContent,
AddedVectorGraphicContent, AddedVectorGraphicContent,
AddedImageContent, AddedImageContent,
AddedShadingContent, AddedShadingContent,
}; };
struct Difference struct Difference
{ {
Type type = Type::Invalid; Type type = Type::Invalid;
PDFInteger pageIndex1 = -1; PDFInteger pageIndex1 = -1;
PDFInteger pageIndex2 = -1; PDFInteger pageIndex2 = -1;
size_t leftRectIndex = 0; size_t leftRectIndex = 0;
size_t leftRectCount = 0; size_t leftRectCount = 0;
size_t rightRectIndex = 0; size_t rightRectIndex = 0;
size_t rightRectCount = 0; size_t rightRectCount = 0;
}; };
using Differences = std::vector<Difference>; using Differences = std::vector<Difference>;
void setResult(PDFOperationResult result) { m_result = std::move(result); } void setResult(PDFOperationResult result) { m_result = std::move(result); }
const PDFOperationResult& getResult() const { return m_result; } const PDFOperationResult& getResult() const { return m_result; }
void addPageMoved(PDFInteger pageIndex1, PDFInteger pageIndex2); void addPageMoved(PDFInteger pageIndex1, PDFInteger pageIndex2);
void addPageAdded(PDFInteger pageIndex); void addPageAdded(PDFInteger pageIndex);
void addPageRemoved(PDFInteger pageIndex); void addPageRemoved(PDFInteger pageIndex);
void addRemovedTextCharContent(PDFInteger pageIndex, QRectF rect); void addRemovedTextCharContent(PDFInteger pageIndex, QRectF rect);
void addRemovedVectorGraphicContent(PDFInteger pageIndex, QRectF rect); void addRemovedVectorGraphicContent(PDFInteger pageIndex, QRectF rect);
void addRemovedImageContent(PDFInteger pageIndex, QRectF rect); void addRemovedImageContent(PDFInteger pageIndex, QRectF rect);
void addRemovedShadingContent(PDFInteger pageIndex, QRectF rect); void addRemovedShadingContent(PDFInteger pageIndex, QRectF rect);
void addAddedTextCharContent(PDFInteger pageIndex, QRectF rect); void addAddedTextCharContent(PDFInteger pageIndex, QRectF rect);
void addAddedVectorGraphicContent(PDFInteger pageIndex, QRectF rect); void addAddedVectorGraphicContent(PDFInteger pageIndex, QRectF rect);
void addAddedImageContent(PDFInteger pageIndex, QRectF rect); void addAddedImageContent(PDFInteger pageIndex, QRectF rect);
void addAddedShadingContent(PDFInteger pageIndex, QRectF rect); void addAddedShadingContent(PDFInteger pageIndex, QRectF rect);
QString getMessage(size_t index) const; QString getMessage(size_t index) const;
private: private:
void addLeftItem(Type type, PDFInteger pageIndex, QRectF rect); void addLeftItem(Type type, PDFInteger pageIndex, QRectF rect);
void addRightItem(Type type, PDFInteger pageIndex, QRectF rect); void addRightItem(Type type, PDFInteger pageIndex, QRectF rect);
void addRectLeft(Difference& difference, QRectF rect); void addRectLeft(Difference& difference, QRectF rect);
void addRectRight(Difference& difference, QRectF rect); void addRectRight(Difference& difference, QRectF rect);
Differences m_differences; Differences m_differences;
std::vector<QRectF> m_rects; std::vector<QRectF> m_rects;
PDFOperationResult m_result; PDFOperationResult m_result;
}; };
/// Diff engine for comparing two pdf documents. /// Diff engine for comparing two pdf documents.
class PDF4QTLIBSHARED_EXPORT PDFDiff : public QObject class PDF4QTLIBSHARED_EXPORT PDFDiff : public QObject
{ {
Q_OBJECT Q_OBJECT
private: private:
using BaseClass = QObject; using BaseClass = QObject;
public: public:
explicit PDFDiff(QObject* parent); explicit PDFDiff(QObject* parent);
virtual ~PDFDiff() override; virtual ~PDFDiff() override;
enum Option enum Option
{ {
None = 0x0000, None = 0x0000,
Asynchronous = 0x0001, ///< Compare document asynchronously Asynchronous = 0x0001, ///< Compare document asynchronously
PC_Text = 0x0002, ///< Use text to compare pages (determine, which pages correspond to each other) PC_Text = 0x0002, ///< Use text to compare pages (determine, which pages correspond to each other)
PC_VectorGraphics = 0x0004, ///< Use vector graphics to compare pages (determine, which pages correspond to each other) PC_VectorGraphics = 0x0004, ///< Use vector graphics to compare pages (determine, which pages correspond to each other)
PC_Images = 0x0008, ///< Use images to compare pages (determine, which pages correspond to each other) PC_Images = 0x0008, ///< Use images to compare pages (determine, which pages correspond to each other)
PC_Mesh = 0x0010, ///< Use mesh to compare pages (determine, which pages correspond to each other) PC_Mesh = 0x0010, ///< Use mesh to compare pages (determine, which pages correspond to each other)
CompareTextsAsVector = 0x0020, ///< Compare texts as vector graphics CompareTextsAsVector = 0x0020, ///< Compare texts as vector graphics
CompareWords = 0x0040, ///< Compare words, not just characters CompareWords = 0x0040, ///< Compare words, not just characters
}; };
Q_DECLARE_FLAGS(Options, Option) Q_DECLARE_FLAGS(Options, Option)
/// Source document (left) /// Source document (left)
/// \param leftDocument Document /// \param leftDocument Document
void setLeftDocument(const PDFDocument* leftDocument); void setLeftDocument(const PDFDocument* leftDocument);
/// Source document (right)( /// Source document (right)(
/// \param rightDocument Document /// \param rightDocument Document
void setRightDocument(const PDFDocument* rightDocument); void setRightDocument(const PDFDocument* rightDocument);
/// Source pages to be compared (left document) /// Source pages to be compared (left document)
/// \param pagesForLeftDocument Page indices /// \param pagesForLeftDocument Page indices
void setPagesForLeftDocument(PDFClosedIntervalSet pagesForLeftDocument); void setPagesForLeftDocument(PDFClosedIntervalSet pagesForLeftDocument);
/// Source pages to be compared (right document) /// Source pages to be compared (right document)
/// \param pagesForRightDocument Page indices /// \param pagesForRightDocument Page indices
void setPagesForRightDocument(PDFClosedIntervalSet pagesForRightDocument); void setPagesForRightDocument(PDFClosedIntervalSet pagesForRightDocument);
/// Sets progress object /// Sets progress object
/// \param progress Progress object /// \param progress Progress object
void setProgress(PDFProgress* progress) { m_progress = progress; } void setProgress(PDFProgress* progress) { m_progress = progress; }
/// Enables or disables comparator engine option /// Enables or disables comparator engine option
/// \param option Option /// \param option Option
/// \param enable Enable or disable option? /// \param enable Enable or disable option?
void setOption(Option option, bool enable) { m_options.setFlag(option, enable); } void setOption(Option option, bool enable) { m_options.setFlag(option, enable); }
/// Starts comparator engine. If asynchronous engine option /// Starts comparator engine. If asynchronous engine option
/// is enabled, then separate thread is started, in which two /// is enabled, then separate thread is started, in which two
/// document is compared, and then signal \p comparationFinished, /// document is compared, and then signal \p comparationFinished,
/// otherwise this function is blocking until comparation process /// otherwise this function is blocking until comparation process
/// is finished. /// is finished.
void start(); void start();
/// Stops comparator engine. Result data are cleared. /// Stops comparator engine. Result data are cleared.
void stop(); void stop();
/// Returns result of a comparation process /// Returns result of a comparation process
const PDFDiffResult& getResult() const { return m_result; } const PDFDiffResult& getResult() const { return m_result; }
PDFDocumentTextFlowFactory::Algorithm getTextAnalysisAlgorithm() const; PDFDocumentTextFlowFactory::Algorithm getTextAnalysisAlgorithm() const;
void setTextAnalysisAlgorithm(PDFDocumentTextFlowFactory::Algorithm textAnalysisAlgorithm); void setTextAnalysisAlgorithm(PDFDocumentTextFlowFactory::Algorithm textAnalysisAlgorithm);
signals: signals:
void comparationFinished(); void comparationFinished();
private: private:
enum Steps enum Steps
{ {
StepExtractContentLeftDocument, StepExtractContentLeftDocument,
StepExtractContentRightDocument, StepExtractContentRightDocument,
StepMatchPages, StepMatchPages,
StepExtractTextLeftDocument, StepExtractTextLeftDocument,
StepExtractTextRightDocument, StepExtractTextRightDocument,
StepCompare, StepCompare,
StepLast StepLast
}; };
PDFDiffResult perform(); PDFDiffResult perform();
void stepProgress(); void stepProgress();
void performSteps(const std::vector<PDFInteger>& leftPages, void performSteps(const std::vector<PDFInteger>& leftPages,
const std::vector<PDFInteger>& rightPages); const std::vector<PDFInteger>& rightPages);
void performPageMatching(const std::vector<PDFDiffPageContext>& leftPreparedPages, void performPageMatching(const std::vector<PDFDiffPageContext>& leftPreparedPages,
const std::vector<PDFDiffPageContext>& rightPreparedPages, const std::vector<PDFDiffPageContext>& rightPreparedPages,
PDFAlgorithmLongestCommonSubsequenceBase::Sequence& pageSequence, PDFAlgorithmLongestCommonSubsequenceBase::Sequence& pageSequence,
std::map<size_t, size_t>& pageMatches); std::map<size_t, size_t>& pageMatches);
void performCompare(const std::vector<PDFDiffPageContext>& leftPreparedPages, void performCompare(const std::vector<PDFDiffPageContext>& leftPreparedPages,
const std::vector<PDFDiffPageContext>& rightPreparedPages, const std::vector<PDFDiffPageContext>& rightPreparedPages,
PDFAlgorithmLongestCommonSubsequenceBase::Sequence& pageSequence, PDFAlgorithmLongestCommonSubsequenceBase::Sequence& pageSequence,
const std::map<size_t, size_t>& pageMatches); const std::map<size_t, size_t>& pageMatches);
void finalizeGraphicsPieces(PDFDiffPageContext& context); void finalizeGraphicsPieces(PDFDiffPageContext& context);
void onComparationPerformed(); void onComparationPerformed();
/// Calculates real epsilon for a page. Epsilon is used in page /// Calculates real epsilon for a page. Epsilon is used in page
/// comparation process, where points closer that epsilon /// comparation process, where points closer that epsilon
/// are recognized as equal. /// are recognized as equal.
/// \param page Page /// \param page Page
PDFReal calculateEpsilonForPage(const PDFPage* page) const; PDFReal calculateEpsilonForPage(const PDFPage* page) const;
PDFProgress* m_progress; PDFProgress* m_progress;
const PDFDocument* m_leftDocument; const PDFDocument* m_leftDocument;
const PDFDocument* m_rightDocument; const PDFDocument* m_rightDocument;
PDFClosedIntervalSet m_pagesForLeftDocument; PDFClosedIntervalSet m_pagesForLeftDocument;
PDFClosedIntervalSet m_pagesForRightDocument; PDFClosedIntervalSet m_pagesForRightDocument;
Options m_options; Options m_options;
PDFReal m_epsilon; PDFReal m_epsilon;
std::atomic_bool m_cancelled; std::atomic_bool m_cancelled;
PDFDiffResult m_result; PDFDiffResult m_result;
PDFDocumentTextFlowFactory::Algorithm m_textAnalysisAlgorithm; PDFDocumentTextFlowFactory::Algorithm m_textAnalysisAlgorithm;
QFuture<PDFDiffResult> m_future; QFuture<PDFDiffResult> m_future;
std::optional<QFutureWatcher<PDFDiffResult>> m_futureWatcher; std::optional<QFutureWatcher<PDFDiffResult>> m_futureWatcher;
}; };
} // namespace pdf } // namespace pdf
#endif // PDFDIFF_H #endif // PDFDIFF_H