API Documentation

Documentation for developing SailfishOS applications

SilicaWebView QML Type

A Sailfish-styled flickable and pinchable view for displaying web pages More...

Import Statement: import Sailfish.Silica 1.0

Properties

Methods

Detailed Description

The SilicaWebView type provides a web view type with Sailfish-specific behaviors and additional properties.

Below is a simple Sailfish-style web view:

 import QtQuick 2.2
 import Sailfish.Silica 1.0

 Page {
     SilicaWebView {
         id: webView

         anchors {
             top: parent.top
             left: parent.left
             right: parent.right
             bottom: urlField.top
         }
         url: "http://sailfishos.org"
     }

     TextField {
         id: urlField
         anchors {
             left: parent.left
             right: parent.right
             bottom: parent.bottom
         }
         inputMethodHints: Qt.ImhUrlCharactersOnly
         text: "http://sailfishos.org"
         label: webView.title
         EnterKey.onClicked: {
             webView.url = text
             parent.focus = true
         }
     }
 }

SilicaWebView inherits the QtWebKit WebView type, so any properties, signals and methods of WebView (such as the url and title properties in the example above) are also available to SilicaWebView objects. See the WebView documentation for its full list of available properties, signals and methods.

Note that SilicaWebView should be declared inside a Page. When SilicaWebView is instantiated inside a Page, SilicaWebView creates new bindings for Page::backNavigation and Page::forwardNavigation. Hence, you should not create new bindings for Page::backNavigation, Page::forwardNavigation, or do assignments to these properties. See QML property binding for more details.

Property Documentation

header : Component

This property holds the component to use as the header.

A header component instance is positioned at the beginning of the view, before any items.


pullDownMenu : Item

The PullDownMenu item assigned to this view, or null if no pull-down menu has been assigned.


[read-only] pulleyMenuActive : bool

True if either the pullDownMenu or pushUpMenu is currently active (open), otherwise false.


pushUpMenu : Item

The PushUpMenu item assigned to this view, or null if no push-up menu has been assigned.


quickScroll : bool

Controls whether a vertical quick scroll area is enabled for the view. If enabled, it is shown when the view's contentHeight is at least three times that of its height. It allows the user to quickly jump to the beginning or the end of the flickable.

By default the quick scroll area is enabled if the view can be scrolled vertically.


quickScrollAnimating : bool

This property is true when the quick scroll functionality has been triggered and the view is quickly animating to the beginning or end of its content area.


Method Documentation

scrollToBottom()

Starts an animation which quickly scrolls the view to the bottom.

This does nothing if the view cannot be scrolled vertically.


scrollToTop()

Starts an animation which quickly scrolls the view to the top.

This does nothing if the view cannot be scrolled vertically.


We use cookies to improve your user experience and to help us to develop our services. By continuing to browse the site, you approve of our use of cookies.