Results 1 to 3 of 3

Thread: Cursor Position in scene

  1. #1
    Join Date
    Mar 2009
    Location
    Nashville Tn.
    Posts
    53
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Cursor Position in scene

    I am trying set the postion of cursor in a scene, to place the cursor at the boundingrect.right() of a qgraphicsitem in the scene. I think I have to use the MaptoGlobal or some thing like that but qgraphicsitem does not have that map to method. in searching this fourm it seems ii have to use MaptoGlobal.... How do i get the reletive position of a point on an item in a scene in a view ?

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Cursor Position in scene

    mapToGlobal seems ok. If not, you can catch that position( if your only concern is the mouse position) from mouseMoveEvent.

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

    rogerholmes (12th March 2010)

  4. #3
    Join Date
    Mar 2009
    Location
    Nashville Tn.
    Posts
    53
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Cursor Position in scene

    zgulser,

    perfect !! i would not have thought to try the moveEvent to get it.

    thank you.....

Similar Threads

  1. QTextEdit restore cursor position
    By artur231 in forum Qt Programming
    Replies: 3
    Last Post: 15th May 2014, 22:02
  2. Replies: 0
    Last Post: 16th July 2009, 12:44
  3. Display cursor position in QGraphicsView
    By dbrmik in forum Qt Programming
    Replies: 1
    Last Post: 2nd April 2009, 15:06
  4. Replies: 6
    Last Post: 30th May 2007, 09:25
  5. Cursor scene position
    By xgoan in forum Qt Programming
    Replies: 1
    Last Post: 26th December 2006, 13:51

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.