Important: Please read the Qt Code of Conduct -

QGraphicsWebView : Resize viewport without scaling up/down content

  • Hello,

    I'm searching for clues !

    I have two Qt apps (1 => qt 4.8 and 2 => qt 5.5) really close to each other. They both permit to attach HTML widgets to a scene. With the same HTML widget, I have two different behaviors on resizing, and I can't figure out if it comes from changes between apps codes or in QGraphicsWebView differences between the two versions.

    With Qt 4.8 (the behavior I want)


    With Qt 5.5 (the behavior I don't want)



    As you can see, In the first case the viewport is resized and the scroll bars disappear.
    In the second one, the scroll bars are scaled up like if it was an image...

    If you have any clue which could explain this difference, it would be very helpful.

    These are the main classes involved in the instanciation of the HTML widgets in the respectively qt4.8 and qt5.5 apps

    I tried to figure out if it was a matter of size policy, itemChange() differences, min/max sizes, but I don't find anything that could explain this.

    Thanks in advance for your help !

  • Lifetime Qt Champion


    While this clearly looks like a regression, Qt 5.5 is way outdated. Please test against a more recent version. Qt 5.12.4 is the current LTS but you can also try Qt 5.13.0 which is the current release.

Log in to reply