Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [QTBUG-26330]QML WebView resizing and redraw bug?
Forum Update on Monday, May 27th 2025

[QTBUG-26330]QML WebView resizing and redraw bug?

Scheduled Pinned Locked Moved QML and Qt Quick
15 Posts 3 Posters 7.1k Views
  • 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.
  • P Offline
    P Offline
    Peppy
    wrote on last edited by
    #1

    Hi folks, I have found really annoying isssue that I can't stand (because I don't know where the problem is)... is it the bug
    "QTWEBKIT-352":https://bugreports.qt-project.org/browse/QTWEBKIT-352 ?

    I have found quite big solution via C++ (creating new WebView object and do stuff there)...
    Please help me, because this drives me mad. I have already dumped sizes (height/width) of all objects. Sizes of objects are correct, nothing to do with it.

    Some description: After resizing from set up width and height that web view resizes too, but does NOT redraw webpage. As you may see, Google shows normally, as it was on normal screen - content moves from left to right as it was normal resizing. But after some width/height it shows white place (I don't know what is it) and after that transparent...

    Platform: Windows 7 Professional x32, Qt 4.8.0 (QtSDK 1.2.1), MSVC 2010

    Thanks, folks.
    Peppy.

    !http://i47.tinypic.com/2nu0e52.png(QML Qt WebKit bug?)!

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Peppy
      wrote on last edited by
      #2

      Well, problem found - it's problem with preferredWidth and preferredHeight. After that - I have set up to "full size" of window. But, how to make it redraw??

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Peppy
        wrote on last edited by
        #3

        No clue from anyone here? :D...

        Gosh, I am gonna do everything myself.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Peppy
          wrote on last edited by
          #4

          report it as a bug?

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bibek
            wrote on last edited by
            #5

            I think you might wanna resize via the preferredHeight and preferredWidth property.
            I've seen this bug, but it dint create an issue for me as I dint do the resizing via webView height and width.

            Even if problem persists, you might wanna insert a javascript to resize the page on change of dimensions? Too complex route though

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Peppy
              wrote on last edited by
              #6

              Well, that's it! This is the problem... I am using preferredWidth and preferredHeight - you see what it does. There are few others problems that I have discovered:
              I wanted to create a new type of QGraphicsWebView as mentioned me somebody here, but I have discovered bug:
              "QDeclarativeView bug ... [QTBUG 25999]":http://qt-project.org/forums/viewreply/87502

              Well, I was tryin' how to force repaint the app, but it looks like you can't in QML do that...
              "Forcing Repaint ":http://lists.qt.nokia.com/pipermail/qt-qml/2010-August/000961.html

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bibek
                wrote on last edited by
                #7

                So bug persists even on using preferredWidth and preferredHeight?

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Peppy
                  wrote on last edited by
                  #8

                  Yes, persists. I will push it as a bug, I think...

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    bibek
                    wrote on last edited by
                    #9

                    That's weird since I'm doing this thing in my app without problem. It resizes for me. I'm using it on the google oAuth login page

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      Peppy
                      wrote on last edited by
                      #10

                      Well, I will try it again - well, now it's in Flickable element, so I will try not to use that parent element... I will say results after I will try that.

                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        bibek
                        wrote on last edited by
                        #11

                        I think the google classic page won't work. Try some dynamic page like the mobile login page.
                        I think google.com doesn't resize for me either

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          Peppy
                          wrote on last edited by
                          #12

                          Hmm... so the solution is to make some additional JavaScript... I want to make google useable for everyone...and it would be disaster if it wouldn't work...

                          /EDIT:
                          but wait, I have mentioned it don't work on any website... I am confused...

                          1 Reply Last reply
                          0
                          • B Offline
                            B Offline
                            bibek
                            wrote on last edited by
                            #13

                            I'm confused too :P

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              Peppy
                              wrote on last edited by
                              #14

                              Well, here I am and voi lá...I have found the black sheep of QtQuick - Flickable element - WebView as child of Flickable after resizing DOES NOT redraw it's own content...

                              // EDIT:
                              No, the problem resists in WebView. Pushing bug.

                              https://bugreports.qt-project.org/browse/QTBUG-26330

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                Mevos
                                wrote on last edited by
                                #15

                                If anyone is interested in at least having a quick fix, you can disable the WebView's rendering during the resize by using a timer.

                                My fix looked a bit like this:

                                @Item {
                                id: root

                                onWidthChanged: renderingTimer.restart();
                                onHeightChanged: renderingTimer.restart();

                                Timer {
                                id: renderingTimer;
                                onRunningChanged: webView.renderingEnabled = !running;
                                interval: 100;
                                }

                                WebView {
                                id: webView
                                preferredWidth: root.width
                                preferredHeight: root.height
                                }
                                }@

                                With the item object placed inside a Flickable.

                                If you have a better fix, don't hesitate to correct me.

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved