Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Can QWidget::update() be called in a sub thread other than the GUI thread?

$
0
0
As the title’s question, I wrote a program to render the complex graphics at a sub-thread (want not to occupy much cpu time for the GUI thread in order to speed up user interaction response) into a QImage, after that in this sub-thread render call stack, call update() directly to let QT deliver a queued connection (I guess it act as this) which lead to a QWidget::paintEvent in GUI thread to drawImage to the widget. This do works, but I found after running a while, occasionally, the GUI thread did not response to the update() call by the sub-thread (means i called update(), but no paintEvent received), but only response to the system level update/paintEvent cycle (for example, get/lose focus of the main window). I took a glance at the QT code, seems the system’s updatePending member var is true that causes the QT ignores my update call. But i am not sure. Can any friend tell me whether the update() is designed to be able to called in sub-thread other than GUI?

Viewing all articles
Browse latest Browse all 13965

Trending Articles