summaryrefslogtreecommitdiffstats
path: root/examples/pdf
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-02-14 16:22:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2022-02-22 06:07:34 +0100
commit170fc1c2cb43318817552f1a1bed42b5cdc6eb36 (patch)
tree4f27fabfb78e09b743647cca738b3c0b33ac6b41 /examples/pdf
parent9583c5a05c615d0d3c32b2388f93b2cc6103055c (diff)
QtPdf: fix qml issues
- required properties - unused imports - nullish coalescing - issues found by qmllint (despite all the noise) Reverts 99db09404787901647213abceda74befc7efa8f1 Task-number: QTBUG-82873 Change-Id: I0042d2eaeacba58adcf280c37b9668f8d76d0f93 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/pdf')
-rw-r--r--examples/pdf/multipage/viewer.qml15
-rw-r--r--examples/pdf/pdfviewer/viewer.qml6
2 files changed, 10 insertions, 11 deletions
diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml
index a4f3234dd..f0eb4a432 100644
--- a/examples/pdf/multipage/viewer.qml
+++ b/examples/pdf/multipage/viewer.qml
@@ -47,14 +47,11 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQml // workaround for QTBUG-82873
import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Layouts
import QtQuick.Pdf
-import QtQuick.Shapes
-import QtQuick.Window
ApplicationWindow {
id: root
@@ -128,7 +125,7 @@ ApplicationWindow {
ToolButton {
action: Action {
icon.source: "qrc:/pdfviewer/resources/go-previous-view-page.svg"
- enabled: view.backEnbled
+ enabled: view.backEnabled
onTriggered: view.back()
}
ToolTip.visible: enabled && hovered
@@ -232,7 +229,7 @@ ApplicationWindow {
source: Qt.resolvedUrl(root.source)
onStatusChanged: {
if (status === PdfDocument.Error) errorDialog.open()
- view.document = (status === PdfDocument.Ready ? document : undefined)
+ view.document = (status === PdfDocument.Ready ? document : null)
}
onPasswordRequired: {
passwordDialog.open()
@@ -244,7 +241,7 @@ ApplicationWindow {
id: view
anchors.fill: parent
anchors.leftMargin: searchDrawer.position * searchDrawer.width
- document: root.document
+ document: document
searchString: searchField.text
onCurrentPageChanged: currentPageSB.value = view.currentPage + 1
}
@@ -265,6 +262,12 @@ ApplicationWindow {
model: view.searchModel
ScrollBar.vertical: ScrollBar { }
delegate: ItemDelegate {
+ required property int index
+ required property int page
+ required property int indexOnPage
+ required property point location
+ required property string contextBefore
+ required property string contextAfter
width: parent ? parent.width : 0
RowLayout {
anchors.fill: parent
diff --git a/examples/pdf/pdfviewer/viewer.qml b/examples/pdf/pdfviewer/viewer.qml
index ef52b0b99..c174a79ed 100644
--- a/examples/pdf/pdfviewer/viewer.qml
+++ b/examples/pdf/pdfviewer/viewer.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -47,15 +47,11 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQml // workaround for QTBUG-82873
import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Layouts
import QtQuick.Pdf
-import QtQuick.Shapes
-import QtQuick.Window
-import Qt.labs.animation
ApplicationWindow {
id: root