QWebView does not display the block elements side by side but internet explorer does the job correctly



  • Hi All,

    I was trying to load a html file located on a server from my application running the client.

    The problem is that QWebView loads the page but the two block elements are displayed one below the other.
    The same html file when loaded via explorer displays the two block elements side by side.

    Can smebdy tell me the reason or possible explanation for this behavior? How do I correct it? I want the two block elements to be displayed side by side.

    <html> <body> <div id="header"

    <h1 >System Health Report at 2014-01-21 13:31:54 </h1> </div>
    <div id="menu"

    <h3> First Server Status </h3>
    <table border=1 >
    <tr><td>Server Name</td> <td>DimDim Server</td> </tr>
    <tr><td> Last Upgrade Date</td> <td>2014-01-20 17:36:06</td> </tr>
    <tr><td> IP Address</td> <td>172.22.68.96</td> </tr>
    <tr><td> Average CPU Utilisation</td> <td>4 %</td> </tr>
    <tr><td> Average Free Memory Available</td> <td>45.363633 %</td></tr>
    <tr><td> Average Sent Data Rate</td> <td>8697 Bytes/second</td> </tr>
    <tr><td> Average Received Data Rate</td> <td>324846 Bytes/second</td></tr>
    </table>
    <h3> Camera Status </h3>
    <table border=1 >
    <tr><td>No. of Cameras Configured</td><td>3</td></tr>
    <tr><td>No. of Cameras Online</td><td>3</td></tr>
    </table>
    <h3> Event Status </h3>
    <table border=1 >
    <tr> <td> <b>Events Received today</b> </td> <td> <b>Total Count</b> </td> <td><b> Open Count</b></td> </tr>
    <tr> <td> All Events </td> <td> 0</td> <td>0</td> </tr>
    <tr> <td> VideoLoss Event </td> <td> 0</td> <td>0</td> </tr>
    <tr> <td> SceneChange Event </td> <td> 0</td> <td>0</td> </tr>
    <tr> <td> Occlusion Event </td> <td> 0</td> <td>0</td> </tr>
    <tr> <td> UnexpMotion Event </td> <td> 0</td> <td>0</td> </tr>
    <tr> <td> Server Events </td> <td> 0</td> <td>0</td> </tr>
    <tr> <td> Other Events </td> <td> 0</td> <td>0</td> </tr>
    </table>
    </div>
    <div id="content"

    <h3> Second Server Status </h3>
    <table border=1 >
    <tr><td> Server Name</td> <td>boogie</td> </tr>
    <tr><td> Status</td> <td>Online</td> </tr>
    <tr><td> Online since</td> <td>2014-01-16 17:52:18</td> </tr>
    <tr><td> Private IP Address</td> <td>172.22.68.96</td> </tr>
    <tr><td> Public IP Address</td> <td>NotApplicable</td> </tr>
    <tr><td> Average CPU Utilisation</td> <td>4 %</td> </tr>
    <tr><td> Average Free Memory Available</td> <td>45.363633 %</td></tr>
    <tr><td> Average Sent Data Rate</td> <td>8697 Bytes/second</td> </tr>
    <tr><td> Average Received Data Rate</td> <td>324846 Bytes/second</td></tr>
    <tr> </tr><tr><td> Server Name</td> <td>woogie</td> </tr>
    <tr><td> Status</td> <td>Online</td> </tr>
    <tr><td> Online since</td> <td>2014-01-16 17:57:26</td> </tr>
    <tr><td> Private IP Address</td> <td>172.22.66.142</td> </tr>
    <tr><td> Public IP Address</td> <td>NotApplicable</td> </tr>
    <tr><td> Average CPU Utilisation</td> <td>0 %</td> </tr>
    <tr><td> Average Free Memory Available</td> <td>0.000000 %</td></tr>
    <tr><td> Average Sent Data Rate</td> <td>8697 Bytes/second</td> </tr>
    <tr><td> Average Received Data Rate</td> <td>324846 Bytes/second</td></tr>
    <tr> </tr></table>
    <h3> Storage Status </h3>
    <table border=1 >
    <tr><td><b>File System</b></td><td><b>Total Disk Space(GB)</b></td> <td><b>Free Disk Space(GB)</b></td> <td><b>Status</b></td></tr>
    <tr><td>D:/Videos</td> <td>72.51</td> <td>72.33</td> <td>Online</td></tr>
    </table></div><div id="footer"

    </div>
    </body> </html>

    Basically I want my "first server status" and "second server status" to be displayed side by side when opened by QWebView.

    code to show the html page using QWebView

    @
    QString html_url ="http://" + this->usr->my_server_address+":"+VMS_HTTP_PORT + "/http-docs" + "/" + sample_file.html;
    QUrl url = html_url;
    this->ui->htmlView->load(url);
    this->ui->htmlView->show();
    @



  • For some reason the dev tags in the html file aren't displayed fully. They are getting chopped off when updated.

    I'm not sure if anybdy can understand the html content now :-(



  • Hi All,

    The issue is resolved. The issue was with the "div" tag of Second Server Status.

    The div tag had an attribute width="55%&" apart from float = "left"

    The problem was found to be with ampersand( & ). If width is specified as "55%" then QWebView displays the page with table contents shown side by side. If width = "55%&" then the tables are displayed one below the other.

    Cheers,
    Jeevan


Log in to reply
 

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