summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-02-14 19:45:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2022-03-08 15:23:54 +0100
commite6e705a3dab368842fbfe15a9b545e0e8727b6b2 (patch)
tree3909393d82885565695bda580bfe2372354f5432 /examples
parentd82347ee8b77c72b8d76ee4ea3554e41847d1553 (diff)
QtQuick.Pdf: automatically close the error dialog if the error disappears
When the user has not yet entered a password, document.status == Error; but we pop up the password prompt dialog on top of the error dialog. After the user has entered it, either it's correct and the error goes away, or we need to tell the user that it's incorrect, so the dialog should stay open. Change-Id: Ib3332f543b23fdf50ccd0df0c7e79cdc95f2e8da Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/pdf/multipage/viewer.qml2
-rw-r--r--examples/pdf/pdfviewer/viewer.qml2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml
index 51b648378..527ed9eb4 100644
--- a/examples/pdf/multipage/viewer.qml
+++ b/examples/pdf/multipage/viewer.qml
@@ -218,6 +218,7 @@ ApplicationWindow {
closePolicy: Popup.CloseOnEscape
anchors.centerIn: parent
width: 300
+ visible: document.status === PdfDocument.Error
contentItem: Label {
id: errorField
@@ -229,7 +230,6 @@ ApplicationWindow {
id: document
source: Qt.resolvedUrl(root.source)
onStatusChanged: {
- if (status === PdfDocument.Error) errorDialog.open()
view.document = (status === PdfDocument.Ready ? document : null)
}
onPasswordRequired: function() { passwordDialog.open() }
diff --git a/examples/pdf/pdfviewer/viewer.qml b/examples/pdf/pdfviewer/viewer.qml
index 0454d533f..1a9a4fbe4 100644
--- a/examples/pdf/pdfviewer/viewer.qml
+++ b/examples/pdf/pdfviewer/viewer.qml
@@ -220,6 +220,7 @@ ApplicationWindow {
closePolicy: Popup.CloseOnEscape
anchors.centerIn: parent
width: 300
+ visible: document.status === PdfDocument.Error
contentItem: Label {
id: errorField
@@ -234,7 +235,6 @@ ApplicationWindow {
document: PdfDocument {
id: document
source: Qt.resolvedUrl(root.source)
- onStatusChanged: if (status === PdfDocument.Error) errorDialog.open()
onPasswordRequired: passwordDialog.open()
}
searchString: searchField.text