[Qt-interest] Create a new GUI Thread
Luis Roberto P. Paula
luisrpp at gmail.com
Wed Feb 11 14:33:06 CET 2009
Hi Andreas,
>> So you want two event loops that run in parallel, not one loop that
blocks
the other (which can be done with QDialog::exec())? May I ask why?
I'm using VTK (www.vtk.org) with QT and for some reson, the callbacks of vtk
are only captured if the observers are set before the command qApp->exec()
in the main function.
It works fine for the main window, but I also have vtkwidgets in a Dialog
that is loaded after the click of a button in the main window. In the
Dialog, the callbacks are not working. The Dialog callbacks only works if it
is loaded before the qApp->exec() in the main function.
Luis
On Wed, Feb 11, 2009 at 4:37 AM, Andreas Pakulat <apaku at gmx.de> wrote:
> On 11.02.09 02:04:52, Luis Roberto P. Paula wrote:
> > My application has two windows. The first is the main window and the
> second
> > is started after the click of a button.
> >
> > When the button is clicked, a new thread is started. The problem is that
> I
> > can't start/show a QDialog in this new thread.
>
> You can't do any GUI operation outside of the thread that created
> QApplication and runs QApplication::exec().
>
> > I'm doing this because I need to have a different event loop for the
> QDialog
> > window.
>
> So you want two event loops that run in parallel, not one loop that blocks
> the other (which can be done with QDialog::exec())? May I ask why?
>
> As to how to do that: The only way is putting the code that needs to run in
> the second event loop into a separate application and then use IPC (like
> QDBus) to communicate between the two processes.
>
> Andreas
>
> --
> You will have long and healthy life.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090211/062bf275/attachment.html
More information about the Qt-interest-old
mailing list