diff options
Diffstat (limited to 'examples/pdf/multipage/pdfapplication.cpp')
-rw-r--r-- | examples/pdf/multipage/pdfapplication.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/pdf/multipage/pdfapplication.cpp b/examples/pdf/multipage/pdfapplication.cpp new file mode 100644 index 000000000..d8e7c6486 --- /dev/null +++ b/examples/pdf/multipage/pdfapplication.cpp @@ -0,0 +1,16 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "pdfapplication.h" +#include <QFileOpenEvent> + +PdfApplication::PdfApplication(int &argc, char **argv) + : QGuiApplication(argc, argv) { } + +bool PdfApplication::event(QEvent *e) { + if (e->type() == QEvent::FileOpen) { + QFileOpenEvent *foEvent = static_cast<QFileOpenEvent *>(e); + m_fileOpener->setProperty("source", foEvent->url()); + } + return QGuiApplication::event(e); +} |