[PATCH] thread-safe queued KDialogs

Sebastian Trüg trueg at kde.org
Tue Nov 25 09:46:11 GMT 2008


On Tuesday 25 November 2008 09:27:59 Aurélien Gâteau wrote:
> Sebastian Trüg wrote:
> >  > How about using QMetaObject::invokeMethod instead of a timer with 0
> >  > time out? Just seems cleaner to me.
> >
> > I did not know about that. Thanks. This indeed seems cleaner. New patch
> > attached.
>
> -  QTimer::singleShot( 0, _this, SLOT( slotShowQueuedDialog() ) );
> +  // We use a queued connection to be able to use queued dialogs
> +  // from threads other than the GUI thread (example: KMessageBox)
> +  QMetaObject::invokeMethod( _this, SLOT(slotShowQueuedDialog()),
> Qt::QueuedConnection );
>
> Does this work? If I am not mistaken, the second parameter should not be
> SLOT(slotShowQueuedDialog()), but "slotShowQueuedDialog", with quotes,
> without SLOT and without parenthesis.

you are right.

-- 
Sebastian Trueg
Sponsored by Mandriva to work on Nepomuk-KDE.

http://nepomuk.kde.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081125/132466f1/attachment.htm>


More information about the kde-core-devel mailing list