[Qt-interest] QApplication on a pthread in Symbian
Felipe Gil-Castiñeira
xil at uvigo.es
Tue Jul 20 00:04:23 CEST 2010
Felipe Gil-Castiñeira <xil <at> uvigo.es> writes:
>
> Hi,
>
> I have a GLib-OpenC-Symbian application which was originally designed to
> be a "daemon" without GUI. Now I have decided to add an optional user
> interface in Qt 4.7 and QML (the user can select to display it or not in
> the config file), so I will have both GLib's and Qt's main loops.
>
> I am a Qt newbie, but It seemed a good idea to instantiate a
> QApplication in a new pthread. I have found a couple of messages from
> people succeeding with this approach, but I am getting a data abort
> exception so I am not sure if:
>
> * this is a bug in Qt for Symbian and I should file a bug report
> (unfortunately, I am using Qt Creator 1.3.83 and I can't do step
> debugging because of the bug QTCREATORBUG-1563).
> * this is not really a good idea and I should find another solution.
> In that case any suggestion will be appreciated.
>
> Thanks!
> Felipe.
>
Just in case someone has the same problem and finds this thread: finally it
worked following the opposite approach, instantiate a QApplication in the main
thread and execute my old GLib daemon code in a new pthread.
This works fine in Symbian, but in Maemo the invocation of g_main_loop_run in
the pthread also affects Qt's main loop in the main thread. In that case, the
solution is simpler: it is enough to remove the "g_main_loop_run" in the
secondary thread, and everything works with Qt's main loop (after invoking
QApplication::exec). I tried also this in Symbian, but it didn't work.
In conclusion: now I have the application working, but I need different
solutions for Symbian and Maemo.
Best,
Felipe.
More information about the Qt-interest-old
mailing list