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

Qt-interest Archive, July 2007
QSocketNotifier::activated not signaled


Message 1 in thread

Hi all,

I've been trying to debug a problem with Licq and the Qt4 GUI plugin
on Mac OS X, without any luck. The code works under Linux, but when
run under OS X it seems like QSocketNotifier::activated isn't signaled
when there is data to read.

When Licq is started it (the part called the 'daemon') loads the gui
plugin using dlopen() and executes the plugin's entry routine in a new
thread. The plugin does some setup and eventually registers with the
daemon. The daemon registers the plugin and returns the read end from
a pipe created with pipe() to the plugin. Using the returned file
descriptor, the plugin creates a new QSocketNotifier(fd, Read) and
connects the activated signal to a slot. So far all is good.

Then, when the user Quits, the plugin calls a shutdown function in the
daemon. This function, among other things, writes 'X' to the write end
of the pipe to tell the plugin to exit. Unfortunately, the slot
connected to QSocketNotifier::activated is never called. But if I do
select() on the fd after calling the shutdown function, it is set. And
if I read() the fd I get 'X'.

Does anyone have any idea on what could be wrong?

The plugin was originally written with Qt2, then ported to Qt3 and now
to Qt4 (still using Qt3Support). So maybe some stuff is not done in
the correct order (e.g. something needs to be set up before creating a
QSocketNotifier), and it just happens to work under Linux. Are there
any special requirements under OS X?

Grateful for all tips and pointers to where I should continue my debugging.

(I'm using the opensource Qt 4.3.0 dmg on Mac OS X 10.4.9)

Best regards,
Erik

If you wish to test for yourself:
# svn co http://svn.licq.org/svn/trunk/licq; cd licq; make -f
Makefile.cvs; ./configure; make
# cd plugins; svn co http://svn.licq.org/svn/branches/qt-gui_qt4; cd
qt-gui_qt4; cmake .; make
# cd ../../; src/licq -b basedir -d 31 -p
plugins/qt-gui_qt4/src/liblicq_qt4_gui.so
Try to quit.

-- 
 [ signature omitted ]