Sailfish Webview
API DocumentationPopupProvider QML Type
A component which provides custom popup implementations for use by the web view More...
Import Statement: | import Sailfish.WebView.Popups 1.0 |
Properties
- alertPopup : var
- authPopup : var
- blockedTabPopup : var
- confirmPopup : var
- contextMenu : var
- locationPermissionPopup : var
- passwordManagerPopup : var
- promptPopup : var
- selectorPopup : var
- webrtcPermissionPopup : var
Detailed Description
The PopupProvider
QML type is exposed through the Sailfish.WebView.Popups
QML import namespace.
If a client wishes to customize the look and feel of popups which are displayed by the web view in response to certain conditions (e.g. JavaScript alert popups, etc), they must instantiate a PopupProvider
and bind the popupProvider
property of the WebView to that instance.
The PopupProvider
defines a set of properties which each specify a custom popup component. The web view will inspect the appropriate property of the PopupProvider
and then construct an instance of the component and show it, when required.
Each property value must be one of the following:
- a component URL string, e.g.
"qrc:/CustomAlertPopup.qml"
- a component instance, e.g.
Qt.createComponent("qrc:/CustomAlertPopup.qml")
- a popup component descriptor dictionary, to allow specifying dialog-derived popups
A popup component descriptor dictionary has the following fields:
"component"
whose value is a component instance object or URL"type"
whose value is either"dialog"
or"item"
(the default)
For example, if a client wishes to provide custom implementations for the JavaScript alert()
and JavaScript geolocation permission
popups, they might set the WebView's popupProvider
property as follows:
popupProvider: PopupProvider { alertPopup: "qrc:/CustomAlertPopup.qml" locationPermissionPopup": {"type": "dialog", "component": "qrc:/CustomLocationDialog.qml"} }
See also custompopups.
Property Documentation
The alert popup component descriptor
The component specified must implement the alert popup interface.
The authorization/login popup component descriptor
The component specified must implement the authorization/login popup interface.
The blocked tab popup component descriptor
The component specified must implement the blocked tab popup interface.
The confirm popup component descriptor
The component specified must implement the confirm popup interface.
The context menu component descriptor
The component specified must implement the context menu popup interface.
The geolocation permission popup component descriptor
The component specified must implement the geolocation permission popup interface.
The password manager popup component descriptor
The component specified must implement the password manager popup interface.
The input prompt popup component descriptor
The component specified must implement the input prompt popup interface.
The selector popup component descriptor
The component specified must implement the selector popup interface.
The webrtc popup component descriptor
The component specified must implement the alert popup interface.