Results 1 to 3 of 3

Thread: knowing mouse location

  1. #1
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default knowing mouse location

    how to know that mouse cursor is above one of the item (like pushbutton / lineedit) ?

  2. #2
    Join Date
    Jun 2012
    Location
    Iran , Tehran
    Posts
    93
    Thanks
    5
    Platforms
    Unix/X11 Windows Android

    Default Re: knowing mouse location

    by QCursor::pos() , you can locate cursor position in global screen.
    Life is about making the right decisions and moving on.

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

    Default Re: knowing mouse location

    Quote Originally Posted by riarioriu3 View Post
    how to know that mouse cursor is above one of the item (like pushbutton / lineedit) ?
    It depends what you need this information for. The most general way is to handle enter and leave events for the widget (see QWidget::enterEvent()). Using QCursor::pos() is definitely not a good approach.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 4
    Last Post: 17th October 2011, 13:58
  2. Replies: 2
    Last Post: 23rd April 2011, 13:36
  3. qprogressbar without knowing the time
    By jaca in forum Qt Programming
    Replies: 3
    Last Post: 25th September 2009, 22:45
  4. Knowing if application is running
    By mourad in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2008, 10:47
  5. QFtp way of knowing drive names
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 21st April 2008, 21:51

Tags for this Thread

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.