QScrollArea items do not redraw

I'm looking for a way to fix a problem that some widgets disappear when I zoom in.

Structure of my program: Window with QscrollArea as a child. QscrollArea has a class that inherits from QWidget as a child, and this class has a drawclass vector that inherits from qwidget. I resize the class in scrollArea to increase or decrease and get scroll bars when updating coordinates in drawclass.

The problem is that when I zoom in and then drop out, some instances of drawclass do not redraw (I get the background instead of the square that I should have) and does not respond to enterevent. Scrolling in the direction of the square fixes the problem, so I think I'm not updating qScrollArea correctly with nativeParentWidget()->update(); when the zoom slot is called.

The output should be: normal http://img26.imageshack.us/img26/492/38361041.jpg

after scaling and disouting I get: problem http://img214.imageshack.us/img214/2642/78940605.jpg

Thanks for your help.

+4
source share
1 answer

Not sure, but try updating QAbstractScrollArea :: viewport ().

+1
source

Source: https://habr.com/ru/post/1402496/


All Articles