QT Repaint/Redraw/Update/Do Something

前端 未结 4 1728
清酒与你
清酒与你 2020-12-10 00:59

I\'m New to QT. I understand that you can force a display refresh, but I\'ve pulled all my hair out trying to figure out how. Here is what I\'m specifically trying to do.

4条回答
  •  天命终不由人
    2020-12-10 01:43

    If i understood correctly, you have a slot and in this slot, you update the image shown in a QLabel. But you want this change to be displayed before the slot finishes.

    If that is the case, issue an update() event, and call qApp->processEvents(). This method processes events that are waiting in the event queue and then returns, therefore this may be what you are after.

    PS: an update() may not be necessary at all, i am not sure.

提交回复
热议问题