×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    31

    QML WebView Problem.

    Hi,
    I am using QML Webview in my application.
    Clicking any of the links in webview redirect me to the particular Url,but does not clear the contents of previous page.As a result,both page contents overlap.
    Please provide the solution for this.

    Thanks

  2. #2
    Registered User
    Join Date
    Feb 2011
    Posts
    12

    Re: QML WebView Problem.

    This happens due to WebView not having set any background you need to set it via C++ e.g. QWebSettings::globalSettings()->setUserStyleSheetUrl(QUrl::fromLocalFile("<relative path to css containing background css attribute")). or you can call Javascript onLoadCompleted and set it using document object. first option would be more preferred as second option can show overlap for some time till page loads

  3. #3
    Registered User
    Join Date
    Sep 2010
    Posts
    31

    Re: QML WebView Problem.

    Thanks yogeshwarp,

    can you provide a example for this..

    Thanks

  4. #4
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: QML WebView Problem.

    Quote Originally Posted by Siddharth5 View Post
    Thanks yogeshwarp,

    can you provide a example for this..

    Thanks
    The link contains QML webview examples : http://doc.qt.nokia.com/latest/decla...s-webview.html

    regards,
    rahul

  5. #5
    Registered User
    Join Date
    Sep 2010
    Posts
    31

    Re: QML WebView Problem.

    Thanks rahulvala,

    Clicking any of the links in webview redirect me to the particular Url,but does not clear the contents of previous page.As a result,both page contents overlap.
    How to get rid of this problem?

    Thanks

  6. #6
    Registered User
    Join Date
    Jan 2011
    Posts
    40

    Re: QML WebView Problem.

    I have got the same problem, is there any solution working?
    thx paul

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: QML WebView Problem.

    Quote Originally Posted by yogeshwarp View Post
    This happens due to WebView not having set any background you need to set it via C++ e.g. QWebSettings::globalSettings()->setUserStyleSheetUrl(QUrl::fromLocalFile("<relative path to css containing background css attribute")). or you can call Javascript onLoadCompleted and set it using document object. first option would be more preferred as second option can show overlap for some time till page loads
    Hello yogeshwarp,

    I guess the hack you are telling about can not be implemented to the QML webview as i dont think there is a c++ interface for the same is available.

    I guess we might need to make our own webview plugin in QML using QWebView C++ class, but i dont know how much this is justified.

    Regards,

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: QML WebView Problem.

    I never seen this problem on my device (Harmattan).
    BTW did you try to set settings.printElementBackgrounds = true ?
    That's a WebView property.

  9. #9
    Registered User
    Join Date
    Feb 2011
    Posts
    12

    Re: QML WebView Problem.

    gaba88, its not complicated fix at all just putting the line in main.cpp would do the trick. the fix I put here I am actually using in my application and working fine

  10. #10
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: QML WebView Problem.

    Quote Originally Posted by gnuton View Post
    I never seen this problem on my device (Harmattan).
    BTW did you try to set settings.printElementBackgrounds = true ?
    That's a WebView property.
    Hello gnuton

    The problem as fas as i have observer is with symbian only on my N9 it works great without any problem. I guess the problem is somewhere at the Symbian port of QML Webview.

  11. #11
    Registered User
    Join Date
    Dec 2004
    Posts
    370

    Re: QML WebView Problem.

    Quote Originally Posted by yogeshwarp View Post
    gaba88, its not complicated fix at all just putting the line in main.cpp would do the trick. the fix I put here I am actually using in my application and working fine
    Yogeshwarp what is the css file you are using, i mean what values do you have in it? can you copy paste it for here?

Similar Threads

  1. QML With webview
    By waelfarouk in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-07-25, 05:25
  2. Problem with Google Map in WebView
    By stevensei in forum [Archived] Qt Quick
    Replies: 7
    Last Post: 2011-06-27, 13:40
  3. QML webview
    By ENEX in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2011-05-06, 06:35
  4. WebView Problem
    By m1kad0 in forum [Archived] Beginning Qt
    Replies: 3
    Last Post: 2011-04-08, 06:51

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •