123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- import QtQuick 1.1
- import com.nokia.symbian 1.1
- import QtWebKit 1.0
- import WhereAmI 1.0
- Page {
- id: mainPage
-
- Rectangle {
- id: splashScreenContent
- anchors.fill: parent
- color: "white"
- z: 10
- Behavior on opacity {
- SequentialAnimation {
- PauseAnimation { duration: 1000 }
- NumberAnimation { duration: 500 }
- }
- }
- Image {
- id: splashScreenImage
- anchors.fill: parent
- fillMode: Image.PreserveAspectFit
- smooth: true
- source: "qrc:/splash-screen-image.png"
- }
- }
- Flickable {
- id: flickable
- anchors.fill: parent
- contentWidth: webView.width
- contentHeight: webView.height
-
- WebView {
- id: webView
- preferredWidth: mainPage.width
- preferredHeight: mainPage.height
- smooth: false
- url: "qrc:/index.html"
- settings.javascriptEnabled: true
- settings.localContentCanAccessRemoteUrls: true
- onLoadFinished: {
- console.debug("Loaded URL: " + url);
- if (splashScreenContent.opacity > 0) {
-
-
- splashScreenContent.opacity = 0;
- toolBar.tools = mainToolBarLayout;
- }
- }
- onAlert: console.log("Alert: " + message);
-
- javaScriptWindowObjects: QtObject {
- WebView.windowObjectName: "qml"
- function qmlMethodWithParam(param) {
- console.log("WebView.qml: qmlMethodWithParam(): " + param);
- }
- function qmlMethod() {
- console.log("WebView.qml: qmlMethod()");
- }
- }
- }
- }
- ScrollDecorator {
- flickableItem: flickable
- }
-
- BusyIndicator {
- width: 100
- height: 100
- anchors {
- bottom: parent.bottom
- horizontalCenter: parent.horizontalCenter
- margins: 100
- }
- z: 10
- opacity: (webView.progress - 1) * -1
- running: webView.progress < 1
- }
-
- GeoPermissionHandler {
- view: webView
- }
-
- ToolBarLayout {
- id: mainToolBarLayout
- ToolButton {
- iconSource: "toolbar-back"
- onClicked: Qt.quit();
- }
- ToolButton {
- iconSource: "toolbar-refresh"
- onClicked: {
-
- webView.evaluateJavaScript("update()");
- }
- }
- ToolButton {
- iconSource: "qrc:/info-icon.png"
- onClicked: {
-
-
- webView.evaluateJavaScript("showInfo()");
- toolBar.tools = infoPageToolBarLayout;
- }
- }
- }
-
- ToolBarLayout {
- id: infoPageToolBarLayout
- ToolButton {
- iconSource: "toolbar-back"
- onClicked: {
-
-
- webView.evaluateJavaScript("closeInfo()");
- webView.url = "qrc:/index.html"
- toolBar.tools = mainToolBarLayout;
- }
- }
- }
-
- ToolBarLayout {
- id: splashScreenToolBarLayout
- ToolButton {
- iconSource: "toolbar-back"
- onClicked: Qt.quit();
- }
- }
-
- Component.onCompleted: mainPage.tools = splashScreenToolBarLayout;
- }
|