[Qt-jambi-interest] [Qt-jamib-interest] QtJambi in WebApplication
Eskil Abrahamsen Blomfeldt
eblomfel at trolltech.com
Fri Apr 25 11:34:25 CEST 2008
Hi, Michael.
Michael Muth wrote:
>
> is it possible to use all features of qtjambi (slot/signals & qparent)
> in a tomcat webapplication (jsf, struts …)?
>
> Or is the fact that every tomcat-session can have more than one
> threads (per request) a problem?
>
I don't have any experience with Tomcat, but threads are in general not
a problem in Qt Jambi. The only thing to keep in mind is that all GUI
operations have to be done on the main thread of the process (same as in
other GUI frameworks) and that a feature of all classes that inherit
QObject is that they have enforced thread affinity, meaning that they
can only be used from a single thread at a time and you will get an
exception if you break this rule. You can move objects from thread to
thread, but need to do so explicitly.
The signals and slots mechanism is thread safe when used with QObject
subclasses, however, and when the connections are made across thread
boundaries, the event system is used to ensure that the slot is called
in the receiving object's thread. Indeed, the signals and slots
mechanism can be used to safely communicate between objects in different
threads.
-- Eskil
More information about the Qt-jambi-interest
mailing list