Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-39686

Widget contents (WA_StaticContents) cleared on resize

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.3.0
    • GUI: Painting
    • None
    • Linux x86_64 w/ Qt5.3.0

      In Qt4 one could create a widget with attributes WA_StaticContents and disable the autofillbackground so that:

      • widget contents would never be cleared on update/resize
      • paint events after a resize would refer to the new regions of the widget (if it grew)

      In Qt5 however I am unable to get this to work. I've attached an example that fills the widget red on the first resize event.

      Expected behaviour: In Qt4 the original red fill is always visible, resizing the widget to a larger size, displays excess margins in a different color, and the paintEvent region matches those margins.

      However: In Qt5 the red fill disappears as soon as you resize the widget again. The paintEvent region following the resize is the entire widget.

        1. main.cpp
          0.6 kB
          Rui Abreu Ferreira
        2. render.pro
          0.3 kB
          Rui Abreu Ferreira
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            raf Rui Abreu Ferreira
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes