WebView small html page turns blank



  • Hi all,

    I've a Qt 4.8.5 application running on ubuntu with a WebView in a QML Qt Quick 1.1 file loading a local html file.

    If there is not enough caracters in the html file the WebView shows a blank page !?

    This is the code of the html page i try to load :

    <body>

    <h1>Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello

    Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello

    Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello

    Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello

    Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello

    Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello

    Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello

    Hello Hello Hello Hello Hello Hel

    </h1>

    </body></html>

    If I delete one caracter or more the WebView shows a blank page.

    If I add a single caracter to the last word "Hel" the WebView render the page nicely.

    But if I add a single caracter in the middle of the 3rd line, for example, the WebView shows a blank page too ?

    What the hell is going on with this ??



  • Eventually I found a solution.

    When the webview load an html page with not much code inside the width and height are set to 0 I don't know why.

    So in the onLoadFinished event if I have the 0 value I set this properties to some right values.

    P.S : sorry I don't know how to put the "Solved" tag


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Glad you found out and thanks for sharing !

    You can mark your thread as solved using the "Topic Tools" button


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.