Results 1 to 4 of 4

Thread: catch global mouse press event

  1. #1
    Join Date
    Jun 2011
    Posts
    25
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default catch global mouse press event

    Hi all,

    (sorry for my english)
    I am developing an application in qt 4.7.2 under linux. This application is used on a touch screen (mouse cursor may not be present) and it's composed of many classes.

    Since this application works on very slow processors, I'm going to give to user an instant feedback of press action through the appearance of a small red circle for a few tenths of a second in that point.

    I know that i can capture and override mouse press event and get the position (and also global position) of cursor, but this only works in this widget's area.

    What I want to avoid is having to overwrite all mousePressEvent of all widgets with some kind of manager (or widget?) that works on top of all the widgets included in the window.

    There is a way to do this? Or, alternatively, another way to do this?

    thanks all,

    Nicola

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: catch global mouse press event

    You can install event filter on QApplication object, this way you can avoid "having to overwrite all mousePressEvent of all widgets".

  3. #3
    Join Date
    Jun 2011
    Posts
    25
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: catch global mouse press event

    thanks I try

  4. #4
    Join Date
    Jun 2011
    Posts
    25
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: catch global mouse press event

    works! thanks again

Similar Threads

  1. How to emit mouse press event in QPushButton
    By dpatel in forum Qt Programming
    Replies: 1
    Last Post: 30th December 2010, 14:00
  2. QGraphicsview and mouse press event
    By eva2002 in forum Qt Programming
    Replies: 6
    Last Post: 26th January 2010, 06:04
  3. Mouse press event in a QGraphicsScene
    By Lykurg in forum Qt Programming
    Replies: 3
    Last Post: 19th June 2009, 11:28
  4. Mouse press event detection
    By A.H.M. Mahfuzur Rahman in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2009, 14:08
  5. Checking for key press on mouse event
    By Cruz in forum Newbie
    Replies: 1
    Last Post: 24th January 2009, 19:18

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.