Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor mkhpad's Avatar
    Join Date
    Nov 2011
    Posts
    104
    Hi all,
    I am working on an application where i am in need of help:

    I am having a button in the main page.qml(main window) and when i click on it,it must go to the next page(.qml) where i have a webview as such:

    ABC.qml:

    import QtWebKit 1.0

    WebView {
    url: "http://www.google.co.in"
    preferredWidth: 490
    preferredHeight: 400
    scale: 0.5
    smooth: false
    }

    and in the click event i am having:

    main.qml:

    onJobsClicked: {
    if (currentPage != "jobs")
    MCWHandler.pushPage("jobs")

    currentPage = "jobs"
    header.headerText = "Jobs"
    busyVisible = true
    Qt.resolvedUrl ("ABC.qml")
    stateIndexProperty = 2
    tab.visible = false
    showStandardListView()
    }

    From my code i was not able to move on to next page.
    Can anyone help me with this ??

    Regards,
    Harish.M

  2. #2
    Nokia Developer Champion gaba88's Avatar
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,692
    Hello Harish,

    the best way to do that is to QQC PageStack Component please try that.

  3. #3
    Regular Contributor mkhpad's Avatar
    Join Date
    Nov 2011
    Posts
    104
    Thanks for your reply gaba...

    I don't want to use Page Stack Component as because i am in need to open a web browser inside my application and not externally....

    If i use Page Stack Component:I need to design a Page with all the requirements that was in my application already so now i had changed my code as such:

    main.qml:

    onGoogleClicked: {
    if (currentPage != "google")
    MCWHandler.pushPage("google")

    currentPage = "google"
    header.headerText = "Google"
    busyVisible = true
    ABC.google()
    stateIndexProperty = 2
    tab.visible = false
    showStandardListView()
    }

    and in ABC.cpp:

    bool ABC::google()
    {
    QWebView *view = new QWebView();
    view->load(QUrl("http://www.google.co.in"));
    view->show();

    }

    This is the code i am currently using and in this also the URL opens externally and not inside my application....

    I need to open the web browser inside my application so that all the qml part remain as such when this URL loads...
    So can you or anyone else help me with this and provide me a solution?

  4. #4
    Nokia Developer Champion kkrish's Avatar
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,029
    try webview element. You will find lots of example on wiki and qt sdk.

  5. #5
    Regular Contributor mkhpad's Avatar
    Join Date
    Nov 2011
    Posts
    104
    Hi Kkrish these are the two ways i have tried:

    main.qml:

    onJobsClicked: {
    if (currentPage != "jobs")
    ABC.pushPage("jobs")

    currentPage = "jobs"
    header.headerText = "Jobs"
    busyVisible = true
    jobsPage.visible = true
    stateIndexProperty = 2
    showStandardListView()
    }



    function showStandardListView()
    {
    turnVisibleOff()
    standardListView.visible = true
    }

    JobsPage {
    id: jobsPage
    visible: false
    anchors.top: header.bottom
    width: screenWidth
    anchors.bottom: parent.bottom
    }

    JobsPage.qml:

    import QtQuick 1.0
    import com.nokia.symbian 1.1
    import QtWebKit 1.0

    Page {
    id: ab

    x: 0
    y: 0
    width: 360
    height: 640


    WebView {
    x: 0
    y: 0
    url: "http://www.naukri.com"
    width: 360
    height: 640
    anchors.rightMargin: 0
    anchors.topMargin: 166
    opacity: 1
    smooth: false

    }


    }

    From this code i was able to open the browser with the URL i had given but when i click on the back button it does not works..


    Second try is the one i had explained in the #3

    Anyone come with the solution ?

Similar Threads

  1. Switching between views( Going from home page to login page)
    By samuelpaulc in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-04-14, 12:03
  2. Replies: 11
    Last Post: 2008-03-08, 18:07
  3. Replies: 0
    Last Post: 2005-02-17, 06:15
  4. PHP & WML: How can a PHP-Page send a WML-Page to the phone?
    By TheLetti in forum Mobile Web Site Development
    Replies: 2
    Last Post: 2003-05-15, 17:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved