[Qt-interest] Can we use QTestLib for Asynchronous Event Testing?
Justin Noel
justin at ics.com
Wed Nov 11 16:08:24 CET 2009
Madepally Kiran wrote:
> Hi,
>
> I am trying to automatically test a scenario where events are
> generated and posted. This primarily uses the QApplication :: exec()
> to run the event loop.
>
> However, I noticed that using QTestLib, it is not possible to run the
> Event queue and test this functionality. Am I right about this? Is
> there any work around where I can make minimal changes in my code (a
> GUI application for Nokia S60 mobiles using Qt) to automatically test
> the events and all...?
I suggest calling qApp->processEvents() yourself inside your test. That
will cause any events currently in the queue to be dispatched. When it
returns your posted event should have been processed.
--Justin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: justin.vcf
Type: text/x-vcard
Size: 233 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091111/3cab6a91/attachment.vcf
More information about the Qt-interest-old
mailing list