Results 1 to 4 of 4

Thread: Cannot update mouse Pointer position

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Cannot update mouse Pointer position

    Hi,

    I have modified scribble example (found at following link) code to capture leaveEvent and keyPressEvent.

    http://doc.trolltech.com/4.5/widgets-scribble.html

    And whenever this event occurs, within this event handler i am doing QCursor::setPos(x, y) to reposition my mouse pointer to within mainwindow boundary area. And inside keyPressEvent handler i am moving the cursor by 1 pixel when ever the direction keys are pressed. Whenever the leaveEvent occurs because of the keypresses made to move out of the boundary, I am unable to set mouse Pointer position in the same event iteration. However i have to press one extra key to update the mouse pointer.

    Also though i have configured setMouseTracking(true) in my constructor, I am unable to get MouseMove Events.

    Am i missing something trivial here ?
    Last edited by srinirao; 2nd November 2009 at 10:05.

Similar Threads

  1. Word at mouse click position in QGraphicsTextItem
    By pherthyl in forum Qt Programming
    Replies: 2
    Last Post: 3rd November 2008, 05:56
  2. free mouse pointer
    By raflegan in forum Qt Programming
    Replies: 1
    Last Post: 1st October 2008, 15:11
  3. Mouse position on screen
    By Nippler in forum Qt Programming
    Replies: 3
    Last Post: 7th August 2008, 15:22
  4. Qt4.1 Mouse Position & Scaling
    By Paul Drummond in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2006, 20:02

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.