summaryrefslogtreecommitdiffstats
path: root/tests/manual/quick/pdf/withdoc.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/quick/pdf/withdoc.qml')
-rw-r--r--tests/manual/quick/pdf/withdoc.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/manual/quick/pdf/withdoc.qml b/tests/manual/quick/pdf/withdoc.qml
index 2d82a6abf..66b17994f 100644
--- a/tests/manual/quick/pdf/withdoc.qml
+++ b/tests/manual/quick/pdf/withdoc.qml
@@ -64,6 +64,7 @@ Window {
PdfDocument {
id: doc
source: "test.pdf"
+ onPasswordRequired: function() { passwordDialog.open() }
}
Platform.FileDialog {
@@ -73,6 +74,26 @@ Window {
onAccepted: doc.source = file
}
+ Dialog {
+ id: passwordDialog
+ title: "Password"
+ standardButtons: Dialog.Ok | Dialog.Cancel
+ modal: true
+ closePolicy: Popup.CloseOnEscape
+ anchors.centerIn: parent
+ width: 300
+
+ contentItem: TextField {
+ id: passwordField
+ placeholderText: qsTr("Please provide the password")
+ echoMode: TextInput.Password
+ width: parent.width
+ onAccepted: passwordDialog.accept()
+ }
+ onOpened: function() { passwordField.forceActiveFocus() }
+ onAccepted: doc.password = passwordField.text
+ }
+
PdfSelection {
id: selection
document: doc