diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-02-08 17:31:44 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-03-15 16:52:27 +0000 |
commit | 243a2fef90dc3ac846a36738bfe97efba3050dc9 (patch) | |
tree | 9a68163527c2795f4c3ef0b11db10cc1a19f6915 /examples | |
parent | 6b35497375c07c49cca7317a4452acc6adc7a1cd (diff) |
Adaptations to form validation
Form validations messages has moved entirely to being done by Blink.
Change-Id: I6742c111fc59f0baba75b8b37f5d0ec9ae2fb920
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/webengine/customdialogs/WebView.qml | 24 | ||||
-rw-r--r-- | examples/webengine/customdialogs/doc/images/customdialogs-validation1.png | bin | 12523 -> 0 bytes | |||
-rw-r--r-- | examples/webengine/customdialogs/doc/images/customdialogs-validation2.png | bin | 12171 -> 0 bytes | |||
-rw-r--r-- | examples/webengine/customdialogs/doc/src/customdialogs.qdoc | 54 | ||||
-rw-r--r-- | examples/webengine/customdialogs/index.html | 8 |
5 files changed, 9 insertions, 77 deletions
diff --git a/examples/webengine/customdialogs/WebView.qml b/examples/webengine/customdialogs/WebView.qml index 0d3fdfacc..0715bc709 100644 --- a/examples/webengine/customdialogs/WebView.qml +++ b/examples/webengine/customdialogs/WebView.qml @@ -108,28 +108,4 @@ WebEngineView { properties: {"request": request}}); } - - onFormValidationMessageRequested: function(request) { - switch (request.type) { - case FormValidationMessageRequest.Show: - if (useDefaultDialogs) - return; - - request.accepted = true; - validationMessage.text = request.text; - validationMessage.y = request.anchor.y + request.anchor.height + 10; - validationMessage.visible = true; - break; - case FormValidationMessageRequest.Move: - break; - case FormValidationMessageRequest.Hide: - validationMessage.visible = false; - break; - } - } - - MessageRectangle { - id: validationMessage - z: 1 - } } diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-validation1.png b/examples/webengine/customdialogs/doc/images/customdialogs-validation1.png Binary files differdeleted file mode 100644 index 38fa86235..000000000 --- a/examples/webengine/customdialogs/doc/images/customdialogs-validation1.png +++ /dev/null diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-validation2.png b/examples/webengine/customdialogs/doc/images/customdialogs-validation2.png Binary files differdeleted file mode 100644 index 247d2711b..000000000 --- a/examples/webengine/customdialogs/doc/images/customdialogs-validation2.png +++ /dev/null diff --git a/examples/webengine/customdialogs/doc/src/customdialogs.qdoc b/examples/webengine/customdialogs/doc/src/customdialogs.qdoc index df955ee61..ecbe36c78 100644 --- a/examples/webengine/customdialogs/doc/src/customdialogs.qdoc +++ b/examples/webengine/customdialogs/doc/src/customdialogs.qdoc @@ -53,7 +53,6 @@ \li JavaScript Alert, Confirm, and Prompt Dialogs \li Color Picker Dialog \li File Picker Dialog - \li Form Validation Message \endlist \section1 Triggering Dialogs @@ -103,7 +102,6 @@ \li JavaScriptDialogRequest \li ColorDialogRequest \li FileDialogRequest - \li FormValidationMessageRequest \endlist \section2 Context Menu Requests @@ -122,9 +120,8 @@ \printuntil } \printuntil } \dots 4 - \skipuntil onFormValidationMessageRequested - \skipuntil } - \skipuntil } + \skipuntil onFileDialogRequested + \skipuntil }}); \skipuntil } \skipto } \printline } @@ -158,9 +155,8 @@ \printuntil } \printuntil } \dots 4 - \skipuntil onFormValidationMessageRequested - \skipuntil } - \skipuntil } + \skipuntil onFileDialogRequested + \skipuntil }}); \skipuntil } \skipto } \printline } @@ -200,9 +196,8 @@ \printuntil } \printuntil } \dots 4 - \skipuntil onFormValidationMessageRequested - \skipuntil } - \skipuntil } + \skipuntil onFileDialogRequested + \skipuntil }}); \skipuntil } \skipto } \printline } @@ -240,9 +235,8 @@ \printuntil } \printuntil } \dots 4 - \skipuntil onFormValidationMessageRequested - \skipuntil } - \skipuntil } + \skipuntil onFileDialogRequested + \skipuntil }}); \skipuntil } \skipto } \printline } @@ -281,13 +275,7 @@ \skipto onFileDialogRequested \printuntil } \printuntil } - \dots 4 - \skipuntil onFormValidationMessageRequested - \skipuntil } - \skipuntil } - \skipuntil } - \skipto } - \printline } + \printuntil } We use the \c onFileDialogRequested signal handler to check whether we should use the default color picker dialog. If not, we accept the request @@ -311,28 +299,4 @@ file and clicks \c OK, we pass the selected file to the \c dialogAccept method. - \section2 Form Validation Message Requests - - \image customdialogs-validation1.png - - \l [QML]{FormValidationMessageRequest} is a request object that is passed as a - parameter of the WebEngineView::formValidationMessageRequested signal: - - \quotefromfile webengine/customdialogs/WebView.qml - \skipto WebEngineView - \printuntil url - \dots 4 - \skipto onFormValidationMessageRequested - \printuntil } - \printuntil } - \printuntil } - \skipto } - \printline } - - We use the \c onFormValidationMessageRequested signal handler to check - whether we should use the default message bubble. If not, we accept the - request and customize \c validationMessage. Depending on the type of the - request, we show, move, or hide the message. - - \image customdialogs-validation2.png */ diff --git a/examples/webengine/customdialogs/index.html b/examples/webengine/customdialogs/index.html index 43a2dbb67..490dd79fd 100644 --- a/examples/webengine/customdialogs/index.html +++ b/examples/webengine/customdialogs/index.html @@ -38,14 +38,6 @@ <td><button class="button" onclick="document.getElementById('filepicker').click()"> Open File Dialog</button></td> </tr> - <tr> - <td> - <form><table> - <tr><td><button class="button" type="submit">Open Message Bubble</button></td></tr> - <tr><td><input class="input" placeholder="For this field we open message bubble..." required/></td></tr> - </table></form> - </td> - </tr> </table> <input type="color" id="colorpicker" value="#ff0000" style="visibility:hidden"/> <input type="file" id="filepicker" accept=".cpp, .html, .h, .png, .qdoc, .qml" style="visibility:hidden"/> |