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

Widgets can get painted before the geometry is set by the layout

XMLWordPrintable

    • 33f525e636ef8fa64a15d3e66c56adaea0075bda

      If you place an item in QGraphicsLayout, the item will be drawn ( paint() ) before the layout sets its position.

      The attached file contains two test cases. The first is slightly larger and useful for debugging. It prints out the various Qt events and waits for you to press "enter" before and after each paint event.
      The second is a single-file non-interactive version that simply prints out to stdout the current geometry when painting. This is useful for making a unit test from.

      The result of the second one is:

      Red widget geometry QRectF(0,0 50x50)
      Red widget geometry QRectF(9,9 382x382)

      The expected outcome is to not paint the widget at size 50x50. So we expect only:

      Red widget geometry QRectF(9,9 382x382)

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            smd Jan Arve
            johnflux John Tapsell
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes