How to force painting of a widget?



  • I would like to apply a mask (a QWidget) on top of page (QLabels) that are visible within a QScrollArea.
    To do this I check whether they are visible after the mask is requested then send an Page.mask.update(). In some cases however eg. if two pages are visible simultaneously, only one page gets the event while the other is pending and appears only later when scrolling or so.

    The output of few string from my application shows the process:

    @page 8 is visible, hence repaint.
    page 9 is visible, hence repaint.

    Mask of page 9 received paint event
    region to paint is PyQt4.QtCore.QRect(0, 0, 100, 30)
    applying mask...

    scroll event

    Mask of page 8 received paint event
    region to paint is PyQt4.QtCore.QRect(0, 0, 531, 194)
    applying mask...
    @

    I tried to replace the update() method call by repaint(), but that doesn't help.

    What can I do to force this mask to be repainted?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.