Results 1 to 3 of 3

Thread: Is it possible to change the cursor on a QGraphicsView?

  1. #1
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Is it possible to change the cursor on a QGraphicsView?

    I have a QGraphicsView which contains a QGraphicsScene, and I would like to change the cursor when it is over the QGraphicsView. I've tried using setCursor, but when I do this, the cursor doesn't change when it is over the client area of the view, but does when it is over the window frame or scroll bars of the view.

    The funny thing is, I've noticed that the cursor will usually change properly over the QGraphicsView client area the first time, but subsequent calls to setCursor result in the cursor changing only when over the frame, as described above.

    Is is necessary to unset the cursor before setting it again? Are there hidden behaviors to be aware of when changing the cursor over a QGraphicsView? Is this even possible?

    Any help would be greatly appreciated.

    draftpunk

  2. #2
    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: Is it possible to change the cursor on a QGraphicsView?

    Set the cursor for the view's viewport().

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

    draftpunk (25th October 2008)

  4. #3
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is it possible to change the cursor on a QGraphicsView?

    Quote Originally Posted by wysota View Post
    Set the cursor for the view's viewport().
    That was it! Thanks!

    draftpunk

Similar Threads

  1. QGraphicsView : change selected rectangle style
    By kghose in forum Qt Programming
    Replies: 2
    Last Post: 28th July 2008, 18:12
  2. Speed, transparency, and drop issues with QGraphicsView
    By jefferai in forum Qt Programming
    Replies: 16
    Last Post: 30th June 2007, 16:14

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.