mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Linux port
This commit is contained in:
committed by
Jakub Melka
parent
68704cd8e5
commit
cbeb91fe18
11
Pdf4QtDocDiff/Pdf4QtDocDiff.qbs
Normal file
11
Pdf4QtDocDiff/Pdf4QtDocDiff.qbs
Normal file
@@ -0,0 +1,11 @@
|
||||
Pdf4QtApp {
|
||||
name: "Pdf4QtDocDiff"
|
||||
files: [
|
||||
"*.cpp",
|
||||
"*.h",
|
||||
"*.ui",
|
||||
"resources.qrc",
|
||||
]
|
||||
cpp.includePaths: ["."]
|
||||
Depends { name: "Qt"; submodules: ["widgets"] }
|
||||
}
|
@@ -248,7 +248,7 @@ void DifferencesDockWidget::update()
|
||||
QTreeWidgetItem* parent = topItems.back();
|
||||
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem(parent, QStringList() << m_diffResult->getMessage(i));
|
||||
item->setData(0, Qt::UserRole, i);
|
||||
item->setData(0, Qt::UserRole, QVariant(static_cast<qint64>(i)));
|
||||
|
||||
QColor color = getColorForIndex(i);
|
||||
|
||||
|
@@ -44,8 +44,10 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow),
|
||||
m_progress(new pdf::PDFProgress(this)),
|
||||
#ifdef Q_OS_WIN
|
||||
m_taskbarButton(new QWinTaskbarButton(this)),
|
||||
m_progressTaskbarIndicator(nullptr),
|
||||
#endif
|
||||
m_cmsManager(nullptr),
|
||||
m_pdfWidget(nullptr),
|
||||
m_settingsDockWidget(nullptr),
|
||||
@@ -62,7 +64,9 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||
setMinimumSize(pdf::PDFWidgetUtils::scaleDPI(this, QSize(800, 600)));
|
||||
|
||||
// Initialize task bar progress
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator = m_taskbarButton->progress();
|
||||
#endif
|
||||
|
||||
m_settingsDockWidget = new SettingsDockWidget(&m_settings, this);
|
||||
addDockWidget(Qt::LeftDockWidgetArea, m_settingsDockWidget);;
|
||||
@@ -186,7 +190,9 @@ MainWindow::~MainWindow()
|
||||
void MainWindow::showEvent(QShowEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
#ifdef Q_OS_WIN
|
||||
m_taskbarButton->setWindow(windowHandle());
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
@@ -839,9 +845,13 @@ std::optional<pdf::PDFDocument> MainWindow::openDocument()
|
||||
|
||||
void MainWindow::onProgressStarted(pdf::ProgressStartupInfo info)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator->setRange(0, 100);
|
||||
m_progressTaskbarIndicator->reset();
|
||||
m_progressTaskbarIndicator->show();
|
||||
#else
|
||||
Q_UNUSED(info);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::onProgressStep(int percentage)
|
||||
@@ -852,12 +862,18 @@ void MainWindow::onProgressStep(int percentage)
|
||||
}
|
||||
|
||||
pdf::PDFTemporaryValueChange guard(&m_isChangingProgressStep, true);
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator->setValue(percentage);
|
||||
#else
|
||||
Q_UNUSED(percentage);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::onProgressFinished()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator->hide();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace pdfdocdiff
|
||||
|
@@ -27,8 +27,10 @@
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSignalMapper>
|
||||
#ifdef Q_OS_WIN
|
||||
#include <QWinTaskbarButton>
|
||||
#include <QWinTaskbarProgress>
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@@ -121,8 +123,10 @@ private:
|
||||
Ui::MainWindow* ui;
|
||||
|
||||
pdf::PDFProgress* m_progress;
|
||||
#ifdef Q_OS_WIN
|
||||
QWinTaskbarButton* m_taskbarButton;
|
||||
QWinTaskbarProgress* m_progressTaskbarIndicator;
|
||||
#endif
|
||||
pdf::PDFCMSManager* m_cmsManager;
|
||||
pdf::PDFWidget* m_pdfWidget;
|
||||
SettingsDockWidget* m_settingsDockWidget;
|
||||
|
Reference in New Issue
Block a user