Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, September 2007
Re: How to use widget rendering in QThread?


Message 1 in thread

>   2) in a separate thread, render a scene into a QImage, and when the 
> thread is done, post the QImage to the widget to use

Brad,

Let you know that the problem got solved by following your 2nd suggestion.

In the processing of a second thread, a signal is emitted, which is 
connected to a slot in the GUI thread by Qt::BlockingQueuedConnection. 
This type of connection is new, which was introduced in Qt 4.3.0.
Here is the application using communication between threads:
http://hopf.chem.brandeis.edu/yanglingfa/Qt/OOXML/directImg/#thread

Thank you very much,
Lingfa


--
 [ signature omitted ] 

Message 2 in thread

> My approach has been to do one of two things:
>
>   1) throttle updates by using a timer or timestamp so that updates 
> only happen as fast as a certain FPS threshold
>   2) in a separate thread, render a scene into a QImage, and when the 
> thread is done, post the QImage to the widget to use
>
Brad,

Let you know that the problem got solved by following your 2nd suggestion.

In the processing of a second thread, a signal is emitted, which is 
connected to a slot in the GUI thread by Qt::BlockingQueuedConnection. 
This type of connection is new, which was introduced in Qt 4.3.0.


Thank you very much,
Lingfa


--
 [ signature omitted ]