Results 1 to 14 of 14

Thread: installFilterEvent for all widgets

Hybrid View

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

    Default Re: installFilterEvent for all widgets

    The tooltip solution should work out of the box for all children that don't have their own tooltips. If you prefer the event filter solution, you have to enable mouse tracking for all widgets.

  2. #2
    Join Date
    May 2007
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default Re: installFilterEvent for all widgets

    If you prefer the event filter solution, you have to enable mouse tracking for all widgets.
    How i can do it?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: installFilterEvent for all widgets


  4. #4
    Join Date
    May 2007
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default Re: installFilterEvent for all widgets

    I know, but how i can set it for all widgets?
    may be will be easy to set installEventFilter for all widgets?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: installFilterEvent for all widgets

    Quote Originally Posted by pakulo View Post
    I know, but how i can set it for all widgets?
    The same way you installed event filters to all widgets.
    may be will be easy to set installEventFilter for all widgets?
    I wouldn't advise that really I wouldnt' advise doing what you are doing at all. I'd probably reimplement QCoreApplication::event() and do some smart event manipulations there to achieve the effect you want in a simmilar manner to the tool tip system already present in the event loop.

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

    pakulo (14th May 2007)

  7. #6
    Join Date
    May 2007
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default Re: installFilterEvent for all widgets

    Thank you... i decided to use
    Qt Code:
    1. QList<QWidget*> widgets = qFindChildren<QWidget*>(this);
    2. foreach(QWidget *widget, widgets)
    3. widget->installEventFilter(this);
    To copy to clipboard, switch view to plain text mode 

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: installFilterEvent for all widgets

    As you wish. Just be aware that some widgets' functionality (especially ones that are not implemented correctly) might get broken because of the use of mouse tracking.

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

    pakulo (15th May 2007)

Similar Threads

  1. QLogText & QLogTable : 2 widgets to display text log
    By fcoiffie in forum Qt-based Software
    Replies: 7
    Last Post: 28th April 2019, 07:52
  2. New widgets after application begins
    By petty in forum Newbie
    Replies: 5
    Last Post: 8th May 2007, 12:10
  3. Performance in hiding/showing widgets
    By Paalrammer in forum Newbie
    Replies: 12
    Last Post: 14th February 2007, 18:57
  4. Replies: 11
    Last Post: 7th July 2006, 13:09
  5. Creating Widgets
    By hylke in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2006, 08:37

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.