trouble with events

"Russell Clarke" <[email protected]> Thu, 19 Sep 2002 11:56:09 +0100
Newsgroups gmane.comp.handhelds.zaurus.devel
Message-ID <[email protected]>
hi all,

I'm having a problem with QEvents.  My app is multi-threaded, and all the
GUI thread really does is notify the app of mouse and key events (it's a
full-screen, graphical app), and display a few dialogs.

When the main app thread wants to display a modal dialog, it can't do this
directly, as that kind of stuff has to be done from the GUI thread, so it
posts a QCustomEvent and then waits for a semaphore to be signalled.  The
GUI thread catches the event, puts up the dialog, and signals the app thread
to wake up after the dialog has closed.

The problem is that when I call QApplication::postEvent from the app thread,
the GUI thread does not wake up.  It only wakes up when the user does
something, e.g. tap the screen.  While I was working with QVFB I didn't
notice this, because MouseMove events were occurring all the time, but on
the zaurus, when the user does something that should trigger a dialog to be
displayed, the app hangs until you tap the screen or press a button - after
this, my custom event is delivered and the dialog pops up.

Help me!  Am I going about this completely the wrong way?  What is the best
way to signal the GUI thread from another thread?

thanks in advance,

--
Russell Clarke
Picsel Technologies Ltd



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf