mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #25: Windows build without plugins
This commit is contained in:
@@ -16,10 +16,20 @@
|
||||
# along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
add_executable(Pdf4QtDocDiff
|
||||
aboutdialog.cpp
|
||||
differencesdockwidget.cpp
|
||||
main.cpp
|
||||
mainwindow.cpp
|
||||
settingsdockwidget.cpp
|
||||
utils.cpp
|
||||
aboutdialog.ui
|
||||
differencesdockwidget.ui
|
||||
mainwindow.ui
|
||||
settingsdockwidget.ui
|
||||
resources.qrc
|
||||
)
|
||||
|
||||
target_link_libraries(Pdf4QtDocDiff PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets)
|
||||
target_link_libraries(Pdf4QtDocDiff PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets)
|
||||
|
||||
set_target_properties(Pdf4QtDocDiff PROPERTIES
|
||||
WIN32_EXECUTABLE ON
|
||||
|
@@ -30,12 +30,13 @@
|
||||
#include "pdfdocumentwriter.h"
|
||||
|
||||
#include <QToolBar>
|
||||
#include <QDesktopWidget>
|
||||
#include <QDesktopServices>
|
||||
#include <QMessageBox>
|
||||
#include <QInputDialog>
|
||||
#include <QFileDialog>
|
||||
#include <QVBoxLayout>
|
||||
#include <QActionGroup>
|
||||
#include <QScreen>
|
||||
|
||||
namespace pdfdocdiff
|
||||
{
|
||||
@@ -44,7 +45,7 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow),
|
||||
m_progress(new pdf::PDFProgress(this)),
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef WIN_TASKBAR_BUTTON
|
||||
m_taskbarButton(new QWinTaskbarButton(this)),
|
||||
m_progressTaskbarIndicator(nullptr),
|
||||
#endif
|
||||
@@ -64,7 +65,7 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||
setMinimumSize(pdf::PDFWidgetUtils::scaleDPI(this, QSize(800, 600)));
|
||||
|
||||
// Initialize task bar progress
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef WIN_TASKBAR_BUTTON
|
||||
m_progressTaskbarIndicator = m_taskbarButton->progress();
|
||||
#endif
|
||||
|
||||
@@ -190,7 +191,7 @@ MainWindow::~MainWindow()
|
||||
void MainWindow::showEvent(QShowEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef WIN_TASKBAR_BUTTON
|
||||
m_taskbarButton->setWindow(windowHandle());
|
||||
#endif
|
||||
}
|
||||
@@ -311,7 +312,7 @@ void MainWindow::loadSettings()
|
||||
QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
|
||||
if (geometry.isEmpty())
|
||||
{
|
||||
QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
|
||||
QRect availableGeometry = QApplication::primaryScreen()->availableGeometry();
|
||||
QRect windowRect(0, 0, availableGeometry.width() / 2, availableGeometry.height() / 2);
|
||||
windowRect = windowRect.translated(availableGeometry.center() - windowRect.center());
|
||||
setGeometry(windowRect);
|
||||
@@ -845,7 +846,7 @@ std::optional<pdf::PDFDocument> MainWindow::openDocument()
|
||||
|
||||
void MainWindow::onProgressStarted(pdf::ProgressStartupInfo info)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef WIN_TASKBAR_BUTTON
|
||||
m_progressTaskbarIndicator->setRange(0, 100);
|
||||
m_progressTaskbarIndicator->reset();
|
||||
m_progressTaskbarIndicator->show();
|
||||
@@ -862,7 +863,7 @@ void MainWindow::onProgressStep(int percentage)
|
||||
}
|
||||
|
||||
pdf::PDFTemporaryValueChange guard(&m_isChangingProgressStep, true);
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef WIN_TASKBAR_BUTTON
|
||||
m_progressTaskbarIndicator->setValue(percentage);
|
||||
#else
|
||||
Q_UNUSED(percentage);
|
||||
@@ -871,7 +872,7 @@ void MainWindow::onProgressStep(int percentage)
|
||||
|
||||
void MainWindow::onProgressFinished()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef WIN_TASKBAR_BUTTON
|
||||
m_progressTaskbarIndicator->hide();
|
||||
#endif
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSignalMapper>
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef WIN_TASKBAR_BUTTON
|
||||
#include <QWinTaskbarButton>
|
||||
#include <QWinTaskbarProgress>
|
||||
#endif
|
||||
@@ -123,7 +123,7 @@ private:
|
||||
Ui::MainWindow* ui;
|
||||
|
||||
pdf::PDFProgress* m_progress;
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef WIN_TASKBAR_BUTTON
|
||||
QWinTaskbarButton* m_taskbarButton;
|
||||
QWinTaskbarProgress* m_progressTaskbarIndicator;
|
||||
#endif
|
||||
|
@@ -301,7 +301,7 @@ void DifferencesDrawInterface::drawPage(QPainter* painter,
|
||||
pdf::PDFInteger pageIndex,
|
||||
const pdf::PDFPrecompiledPage* compiledPage,
|
||||
pdf::PDFTextLayoutGetter& layoutGetter,
|
||||
const QMatrix& pagePointToDevicePointMatrix,
|
||||
const QTransform& pagePointToDevicePointMatrix,
|
||||
QList<pdf::PDFRenderError>& errors) const
|
||||
{
|
||||
Q_UNUSED(compiledPage);
|
||||
@@ -490,7 +490,7 @@ void DifferencesDrawInterface::drawAnnotations(const pdf::PDFDocument* document,
|
||||
}
|
||||
|
||||
void DifferencesDrawInterface::drawRectangle(QPainter* painter,
|
||||
const QMatrix& pagePointToDevicePointMatrix,
|
||||
const QTransform& pagePointToDevicePointMatrix,
|
||||
const QRectF& rect,
|
||||
QColor color) const
|
||||
{
|
||||
@@ -501,7 +501,7 @@ void DifferencesDrawInterface::drawRectangle(QPainter* painter,
|
||||
}
|
||||
|
||||
void DifferencesDrawInterface::drawMarker(QPainter* painter,
|
||||
const QMatrix& pagePointToDevicePointMatrix,
|
||||
const QTransform& pagePointToDevicePointMatrix,
|
||||
const QRectF& rect,
|
||||
QColor color,
|
||||
bool isLeft) const
|
||||
|
@@ -94,7 +94,7 @@ public:
|
||||
virtual void drawPage(QPainter* painter, pdf::PDFInteger pageIndex,
|
||||
const pdf::PDFPrecompiledPage* compiledPage,
|
||||
pdf::PDFTextLayoutGetter& layoutGetter,
|
||||
const QMatrix& pagePointToDevicePointMatrix,
|
||||
const QTransform& pagePointToDevicePointMatrix,
|
||||
QList<pdf::PDFRenderError>& errors) const override;
|
||||
|
||||
virtual void drawPostRendering(QPainter* painter, QRect rect) const override;
|
||||
@@ -106,12 +106,12 @@ public:
|
||||
|
||||
private:
|
||||
void drawRectangle(QPainter* painter,
|
||||
const QMatrix& pagePointToDevicePointMatrix,
|
||||
const QTransform& pagePointToDevicePointMatrix,
|
||||
const QRectF& rect,
|
||||
QColor color) const;
|
||||
|
||||
void drawMarker(QPainter* painter,
|
||||
const QMatrix& pagePointToDevicePointMatrix,
|
||||
const QTransform& pagePointToDevicePointMatrix,
|
||||
const QRectF& rect,
|
||||
QColor color,
|
||||
bool isLeft) const;
|
||||
|
Reference in New Issue
Block a user