Results 1 to 4 of 4

Thread: Mouse events

  1. #1
    Join Date
    Jul 2010
    Posts
    72
    Thanks
    35
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Mouse events

    Hi,

    I have an aplication that consists in a window with several widgets, such as buttons and labels. I would like to get the mouse clicking events that occur in one of the labels. Do I have to create a custom label to get these mouse events?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Mouse events

    You can install an event filter and catch the events and handle them. See QObject::installEventFilter().

  3. The following user says thank you to Lykurg for this useful post:

    Maluko_Da_Tola (25th August 2010)

  4. #3
    Join Date
    Jul 2010
    Posts
    72
    Thanks
    35
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Mouse events

    Do you know of any good tutorial on event filters?

    Cheers

  5. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Mouse events

    I found the description in the doc right under QObject::installEventFilter() useful enough but you can also have a look at http://www.qtrac.eu/marksummerfield.html and download the free 1st edition of C++ GUI Programming with Qt 4 and read the chapter about event processing.

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

    Maluko_Da_Tola (25th August 2010)

Similar Threads

  1. Mouse Events
    By daviddoria in forum Qt Programming
    Replies: 6
    Last Post: 13th May 2008, 12:55
  2. mouse events
    By xyzt in forum Newbie
    Replies: 3
    Last Post: 23rd March 2008, 12:14
  3. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 07:13
  4. Mouse Events in a widget
    By Rayven in forum Qt Programming
    Replies: 2
    Last Post: 5th May 2006, 15:07
  5. QPushButton mouse events
    By Twey in forum Newbie
    Replies: 5
    Last Post: 15th January 2006, 17:41

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.