[Qt-interest] Correct way to manage the main event loop without QApplication::exec()

Thiago Macieira thiago at kde.org
Fri Mar 19 13:14:04 CET 2010


Em Sexta-feira 19 Março 2010, às 12:33:35, Nikos Chantziaras escreveu:
> I am using a library in my Qt program that has its own exec()-like
> function.  In other words, its own event loop.  That function never
> returns, but it calls callbacks I provide.  Those callbacks are the only
> way to keep Qt's event loop rolling and to implement the GUI.  Note that
> the library in question is not a GUI library and does not process any
> system events; it does not perform any kind of system calls.
> 
> Question is, how is this done correctly?  What problems can be expected
> if I never call app->exec()?

The proper way of doing this is to write your own QAbstractEventDispatcher and 
handle all Qt requests to register timers and socket notifiers in your 3rd-
party library's exec-like function.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100319/bf19adb1/attachment.bin 


More information about the Qt-interest-old mailing list