• May 17, 2024, 03:56:16 pm

Author Topic: [HELP] Webview will not load local HTML document !  (Read 773 times)

0 Members and 1 Guest are viewing this topic.

Offline Allstar12345

  • Allstar Software Founder
  • Administrator
  • Forum Genius
  • ******
  • Posts: 5,235
  • Reputation: 812
    • Allstar Software
  • Current Phone: : OnePlus 8 Pro, Xperia 10, Nexus 6p, Jolla Phone, Nokia N8, Nokia 808 PureView, BlackBerry Z30
[HELP] Webview will not load local HTML document !
« on: November 02, 2012, 09:32:14 pm »
I don't see why it won't work,
Could i have put it in the wrong place ?


Code: [Select]
import QtQuick 1.1
import Qt 4.7
import QtWebKit 1.0
import com.nokia.symbian 1.0


Rectangle
{
    id:mainRect
    height: parent.height
    width: parent.width
    anchors.left: parent.left
    anchors.right: parent.right
    anchors.top:parent.top
    anchors.bottom: parent.bottom

    Item {
        id: textItem
        height: 82
        width: parent.width
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.top:parent.top

        TextField {
             id: myTextField;
             y:15
             width: parent.width -70
             text: "Enter your url here"
             errorHighlight: true
             anchors.left: parent.left
                  }

        Button {
                 id: button
                 y:15

                    anchors.right: parent.right
                    text: "Go"
                    onClicked: {
                     webViewRect.reset(myTextField.text);
                    }
                }
    }



    Item {


        id:webViewRect
        signal finished(string url)
        signal loadFailed()
        function reset(aUrl) {
                   webView.url =aUrl;

               }

        anchors.top:textItem.bottom


        width: 360
        height: 300
        anchors.bottom: parent.bottom
        anchors.left: parent.left
        anchors.right: parent.right



        Flickable {
            id:webViewFlickr
             anchors.fill: parent
            width: parent.width

            height: parent.height

            contentWidth: Math.max(parent.width,360)
            contentHeight: Math.max(parent.height,640)
            pressDelay: 200
           WebView {
                id: webView
                anchors.fill: parent

                preferredHeight: height
                preferredWidth: Math.max(parent.width,1000)
                url: "main.html";



            }
        }
    }


    }