Results 1 to 8 of 8

Thread: Trivial re-implementation of QCoreApplication::notify entails infinite loop

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Sep 2006
    Location
    Seeheim/Germany
    Posts
    12
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Trivial re-implementation of QCoreApplication::notify entails infinite loop

    The trivial re-implementation of QCoreApplication::notify reads:

    Qt Code:
    1. class MyApp : public QApplication {
    2. ...
    3. bool notify (QObject *receiver,QEvent *evt );
    4. ...
    5. }
    6.  
    7. bool MyApp ::notify (QObject *receiver,QEvent *evt ) {
    8. return QCoreApplication::notify(reveiver,evt);
    9. }
    To copy to clipboard, switch view to plain text mode 

    This entails a never-ending flood of timer events.

    ===============================================

    Now I have found out that QWorkspace uses qFindChildren to get a (huge) list of *all* (recursively) nested child widgets of a QWorkspaceChild and establishes an event filter for *each* of these. In this way every click on any tiny input widget is recognized and activates the QWorkspaceChild.

    This appears as a very inelegant solution of the problem, and the newer QMdiArea widget seems to use a different method, but which?

    ===============================================

    Of what avail is it to install an event filter for the application object? Will I recognize in this way when a mouse click is performed anywhere in one of my QSplitter children? I'll have to try this out!

    Many thanks for the time being!
    Last edited by jpn; 6th March 2008 at 10:08. Reason: missing [code] tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.