Results 1 to 2 of 2

Thread: Reimplementing QApplication::notify( )

  1. #1
    Join Date
    Jan 2006
    Location
    Third rock from the sun
    Posts
    106
    Thanks
    17
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Reimplementing QApplication::notify( )

    How do I (sucessfully) reimplement QApplication::notify()? In my MainWindow I have
    Qt Code:
    1. bool notify( QObject *receiver, QEvent *e )
    To copy to clipboard, switch view to plain text mode 
    reimplemented but it never gets called by when the unhandled exception was throw from a signal. I have looked at the post from a year ago (Reimplementing QApplication::notify( )) but it still never gets called.

    Thanks!

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Reimplementing QApplication::notify( )

    You should subclass QApplication and reimplement the function in the QApplication subclass. It's not a reimplementation if you write the function to some other class, say any widget class.

    Qt Code:
    1. class MyApplication : public QApplication
    2. {
    3. [...]
    4. };
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. Reimplementing QApplication::notify()
    By Doug Broadwell in forum Qt Programming
    Replies: 5
    Last Post: 21st June 2007, 21:41
  2. Reimplementing QApplication::notify()
    By Doug Broadwell in forum Newbie
    Replies: 3
    Last Post: 13th June 2007, 07:53
  3. Problem reimplementing QSpinBox in a custom widget
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 30th March 2006, 08:12

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.