Results 1 to 6 of 6

Thread: custom events

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: custom events

    Quote Originally Posted by momesana View Post
    Apart from not being a custom event it exactly resembles what I want to do with my custom event. I want to have a ThemeChangeEvent upon which QWidgets can reload associated icons, background-images etc.
    That's fine. I only wanted to mark, that you shouldn't post LanguageChange yourself.

    The Qt documentation had already hinted me towards reimplementing QObject::event() but I had hoped that this would not be really necessary. Do I really have to reimplement this member in all classes that are supposed to be able to handle the event?
    You can instead apply an event filter on every object and handle the event through that event filter, but this will be tedious. I think it will be simplest to either subclass QApplication and do the retheming directly there without propagating the event to widgets or to apply an event filter on the application object and to practically the same, just withouth subclassing.

  2. The following user says thank you to wysota for this useful post:

    momesana (30th January 2008)

  3. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: custom events

    Quote Originally Posted by wysota View Post
    I think it will be simplest to either subclass QApplication and do the retheming directly there without propagating the event to widgets or to apply an event filter on the application object and to practically the same, just withouth subclassing.
    Thank you very much. I'll try that.

Similar Threads

  1. Capture events in a custom delegate
    By vfernandez in forum Qt Programming
    Replies: 9
    Last Post: 19th March 2008, 05:33
  2. Custom proxy model issue
    By Khal Drogo in forum Qt Programming
    Replies: 13
    Last Post: 30th November 2007, 12:41
  3. Posting custom events to a subclass of QThread
    By jpn in forum Qt Programming
    Replies: 3
    Last Post: 4th July 2006, 15:49
  4. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.