Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Problem with rendering backgrounds on an included webpage

    Qt WebKit
    2
    16
    6407
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 1
      1blah111111 last edited by

      I have a program i'm working on, and have run into another problem, in order to get certain pages to be usable, i have to embed them in a webpage that i include in the program, now, normally when viewed in firefox, you get this:

      !http://i255.photobucket.com/albums/hh131/1blah111111/Screenshot-1.png()!

      however when it when it's embedded, i get this:

      !http://i255.photobucket.com/albums/hh131/1blah111111/Screenshot.png()!

      now, as you can see the background isn't rendering correctly, and you might notice that the flash isn't there in the embedded version, this though is a problem already known, and only effects linux versions that use network access manager (meaning arora is affected, but rekonq isn't) that is caused by how the flash is refered to in the webpage, the background rendering though, if the page was a url, and not an embedded qrc resource, it works just fine, now to submit for evaulation, the html of the included webpage, :

      @<html>
      <head>
      <meta http-equiv="content-type"
      content="text/html; charset=ISO-8859-1">
      <title>MDC</title>
      <style type="text/css">
      <!--
      .page
      {
      background-image:url('http://magicduel.com/img/skin/default/bgpag.jpg');
      background-color:tan;
      background-repeat:round;
      }

      body
      {
      background: tan url('http://magicduel.com/img/skin/default/bg_lemn.jpg');
      background-repeat:round;
      }

      .main, .main TD, .main TH
      {
      background-image:url('http://magicduel.com/img/skin/default/bgpag.jpg');
      background-color:tan;
      background-repeat:round;
      width: 491px;
      }

      .leftbg, .leftbg TD, .leftbg TH
      {
      background: tan url('http://magicduel.com/img/skin/default/leftbg.jpg');
      background-repeat:repeat-y;
      vertical-align: top;
      width: 114px;
      }

      .rightbg, .rightbg TD, .rightbg TH
      {
      background: url('http://magicduel.com/img/skin/default/rightbg.jpg');
      background-repeat:repeat-y;
      vertical-align: top;
      width: 145px
      }

      .bottombg, .bottombg TD, .bottombg TH
      {
      background: tan url('http://magicduel.com/img/skin/default/bgpag.jpg');
      vertical-align: bottom;
      background-repeat:round;
      height: 69px;
      width: 491px;
      }

      .topbg, .topbg TD, .topbg TH
      {
      background: tan url('http://magicduel.com/img/skin/default/bgpag.jpg');
      vertical-align: top;
      text-align: center;
      horizontal-align: center;
      height: 69px;
      width: 491px;
      }

      .toprightbg, .toprightbg TD, .toprightbg TH
      {
      background: tan url('http://magicduel.com/img/skin/default/bigmenu.jpg');
      vertical-align: top;
      width: 145px;
      height: 502px;
      }

      .topleftbg, .topleftbg TD, .topleftbg TH
      {
      background: tan url('http://magicduel.com/img/skin/default/leftfix.jpg');
      vertical-align: top;
      width: 114px;
      height: 502px;
      }

      -->
      </style>
      </head>
      <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
      <table style="text-align: left; margin-left: auto; margin-right: auto;"
      class="page" border="0" cellpadding="0" cellspacing="0">
      <tbody>
      <tr>
      <td class="topleftbg"> <br>
      </td>
      <td rowspan="2" class="topbg"><img
      style="width: 491px; height: 69px;" alt=""
      src="http://magicduel.com/img/skin/default/topr.jpg"> <br>
      <iframe marginwidth="0" marginheight="0"
      src="http://magicduel.com/ifrm/ifrm.weapons.php" frameborder="0"
      height="900" scrolling="no" width="487"></iframe> </td>
      <td class="toprightbg"><br>
      </td>
      </tr>
      <tr>
      <td class="leftbg"><br>
      </td>
      <td class="rightbg"><br>
      </td>
      </tr>
      <tr>
      <td style="vertical-align: bottom;" colspan="3" class="bottombg"><img
      style="width: 100%; height: 127px;" alt=""
      src="http://magicduel.com/img/skin/default/bottom.jpg"> </td>
      </tr>
      </tbody>
      </table>
      </body>
      </html>
      @
      (i'll put the other source in the next post, the post would be to long otherwise)

      1 Reply Last reply Reply Quote 0
      • 1
        1blah111111 last edited by

        and here is the code of the widget.cpp that is the program:

        @#include <QtWebKit>
        #include <QtNetwork>
        #include <QNetworkCookieJar>
        #include <QWebFrame>
        #include "qwebview.h"
        #include "qwebframe.h"
        #include "qwebelement.h"
        #include "widget.h"
        #include "ui_widget.h"

        Widget::Widget(QWidget *parent) :
        QWidget(parent),
        ui(new Ui::Widget)
        {
        ui->setupUi(this);
        QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
        ui->Advnt_Main->stop();
        ui->Ally_Main->stop();
        ui->Equipt_Main->stop();
        ui->Log_Main->stop();
        ui->Magic_Main->stop();
        ui->Msgs_Main->stop();
        ui->Nav_Main->stop();
        ui->News_Main->stop();
        ui->Prgrs_Main->stop();
        ui->Profile_Main->stop();
        ui->Quest_Main->stop();
        ui->Story_Main->stop();
        ui->map_main->stop();
        QNetworkAccessManager *const networkAccessManager = new
        QNetworkAccessManager(this);
        ui->Login_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Advnt_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Ally_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Equipt_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Log_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Magic_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Msgs_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Nav_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->News_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Prgrs_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Profile_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Quest_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Story_Main->page()->setNetworkAccessManager( networkAccessManager );
        ui->map_main->page()->setNetworkAccessManager( networkAccessManager );
        ui->Login_Main->load( QUrl("http://magicduel.com/layout.php") );
        }
        Widget::~Widget()
        {
        delete ui;
        }

        void Widget::on_actionLoggedin_triggered()
        {
        ui->Advnt_Main->load( QUrl("http://magicduel.com/dlg/dlg.adventurelog.php") );
        ui->Ally_Main->load( QUrl("http://magicduel.com/ifrm/ifrm.alliance.php") );
        ui->Equipt_Main->load( QUrl("qrc:/Equiptment.html") );
        ui->Log_Main->load( QUrl("http://magicduel.com/dlg/dlg.battlelog.php") );
        ui->Magic_Main->load( QUrl("http://magicduel.com/ifrm/ifrm.magicpage.php") );
        ui->Msgs_Main->load( QUrl("http://magicduel.com/dlg/dlg.messagelist.php?categ=") );
        ui->Nav_Main->load( QUrl("http://magicduel.com/layout.php") );
        ui->News_Main->load( QUrl("http://magicduel.com/dlg/dlg.changelog.php") );
        ui->Prgrs_Main->load( QUrl("http://magicduel.com/dlg/dlg.todaysprofile.php") );
        ui->Profile_Main->load( QUrl("http://magicduel.com/ifrm/ifrm.profile.php") );
        ui->Quest_Main->load( QUrl("http://magicduel.com/pages/info.rpcquestlist.php") );
        ui->Story_Main->load( QUrl("http://magicduel.com/ifrm/ifrm.quest.php") );
        ui->map_main->load( QUrl("http://magicduel.com/dlg/dlg.realmmap.php") );
        }

        void QNetworkCookieJar ( QObject *)
        {

        }

        QNetworkCookieJar::~QNetworkCookieJar ()
        {

        }

        @

        the extra includes at the top are leftover from me working on getting the main login page to load quicker (the code there currently doesn't compile, so i took it out for the moment)

        1 Reply Last reply Reply Quote 0
        • 1
          1blah111111 last edited by

          btw the image tags are normal in the source of the webpage, the forum is changing them to []'s

          1 Reply Last reply Reply Quote 0
          • B
            benjamin.poulain last edited by

            I just don't understand what is your problem.

            Are you saying some resources of a page are not fetched correctly? If yes, could you give us the url of the page and tell us which resources are failing?

            1 Reply Last reply Reply Quote 0
            • 1
              1blah111111 last edited by

              i included the page with the html above inside a qrc file, and refered to it with the qrc reference, the background should be tiling all the way across the page, not just the 2 times it's currently doing.

              1 Reply Last reply Reply Quote 0
              • ?
                Guest last edited by

                [quote author="1blah111111" date="1285537538"]btw the image tags are normal in the source of the webpage, the forum is changing them to []'s[/quote]

                can you edit the img tag and use html tags for the < and > symbols, i.e. & #60; & # 62; (without spacing of course)

                @<html>@

                1 Reply Last reply Reply Quote 0
                • 1
                  1blah111111 last edited by

                  ok, solution found, apparently qt doesn't like background-repeat:round; or background-repeat:repeat-x,repeat-y; however background-repeat:repeat; does achieve the desired effect. I suspect there is something wrong in the repeat-x coding since it renders the repeat-y correctly in the background-repeat:repeat-x,repeat-y; but it doesn't render repeat-x correctly.

                  btw the flash bug is now fixed. just update via the ubuntu repository, and you may need to restart, but it does now work.

                  1 Reply Last reply Reply Quote 0
                  • B
                    benjamin.poulain last edited by

                    bq. ok, solution found, apparently qt doesn’t like background-repeat:round; or background-repeat:repeat-x,repeat-y; however background-repeat:repeat;

                    Which version of Qt/WebKit?
                    Could you made a reduction so we can check if there is a bug in 4.7?

                    1 Reply Last reply Reply Quote 0
                    • 1
                      1blah111111 last edited by

                      i build using Qt v4.7, and whatever the latest webkit for qt is (i built it from git)

                      1 Reply Last reply Reply Quote 0
                      • B
                        benjamin.poulain last edited by

                        [quote author="1blah111111" date="1285967187"]i build using Qt v4.7, and whatever the latest webkit for qt is (i built it from git)[/quote]

                        Strange. I am not aware of any pending issue regarding background-repeat.

                        1 Reply Last reply Reply Quote 0
                        • 1
                          1blah111111 last edited by

                          the bug in flash is only fixed if you update webkit.

                          1 Reply Last reply Reply Quote 0
                          • 1
                            1blah111111 last edited by

                            it's a problem with the included webkit, as well as the webkit i built.

                            1 Reply Last reply Reply Quote 0
                            • 1
                              1blah111111 last edited by

                              also, any idea why my qt creator seems to have decided it wants to use the kde style (i'm using gnome, but i have the kde desktop installed) and doesn't want to even detect the gnome style? My application's tabs only fit in the space if your using gnome.

                              1 Reply Last reply Reply Quote 0
                              • ?
                                Guest last edited by

                                [quote author="1blah111111" date="1285975001"]also, any idea why my qt creator seems to have decided it wants to use the kde style (i'm using gnome, but i have the kde desktop installed) and doesn't want to even detect the gnome style? My application's tabs only fit in the space if your using gnome.[/quote]

                                better to post this in its own separate thread

                                1 Reply Last reply Reply Quote 0
                                • 1
                                  1blah111111 last edited by

                                  k, as soon as webkit finished building and i can restart to check to see if something just decided that kde gets to be my default desktop manager (i don't like kde! the style's great, but i don't get the right layout with my system bars at the top and bottom, and if i don't have that, i can't use my 8 virtual desktops easily, and i need them, because i usually have about 20 windows open!(as well as about the same number of tabs in firefox :P ) ) (i have to restart because it doesn't seem to be wanting to connect to the internet even though i have it physically wired to the router, which is in turn, physically routed to the modem.... and everything else on the network isn't having any trouble connecting.... admittedly a bit slow, but their still connecting.... I also need to restart because i updated the linux kernel..... i need to stop doing that.... because it causes problems if you try to do things like install packages when it's in a limbo state like that.....)

                                  1 Reply Last reply Reply Quote 0
                                  • 1
                                    1blah111111 last edited by

                                    and i've now restarted, and figured something else out, but that's going in a new topic. and here is the new topic: "here":http://developer.qt.nokia.com/forums/viewthread/1124/

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post