Results 1 to 3 of 3

Thread: unsetCursor( )

  1. #1
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question unsetCursor( )

    I am having problems getting unsetCursor( ) to work properly. Inside my QGLWidget, my cursor changes because of various reasons. But when I leave the widget I want to set the cursor back to normal. I have 2 QGLWidgets separated by a QSplitter so one widget is above the other. My code looks like this simple thing:

    Qt Code:
    1. /**
    2.   @param event The pointer to the QEvent
    3.  
    4.   @return void
    5.  
    6.   @brief Checks to see if mouse cursor has left the widget
    7.  
    8.   Checks to see if mouse cursor has left the widget so it
    9.   can reset the cursor to normal.
    10. */
    11. void Plot::leaveEvent( QEvent* event )
    12. {
    13. unsetCursor( );
    14. }
    To copy to clipboard, switch view to plain text mode 

    This is all I want to do in my leaveEvent for now. Plot is a QGLWidget. But if I move from the bottom of the top widget to the splitter with a unique cursor, the mouse changes to the split cursor for the QSplitter and then when I enter the other Plot object, the cursor goes back to the unique cursor although I never tell it to in the bottom object. Why does the cursor seem not to reset when I leave the top object even though my leaveEvent tells it to? Thanks again!

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: unsetCursor( )

    Are you sure the declaration of the handler is correct?
    Make sure it is protected in you class.

  3. #3
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face Re: unsetCursor( )

    Yeah I have it under the "protected" section in my .h file. I know it gets entered into because I have put fprintf statements into it, and they print out.

    One weird thing that occurred was if I set a break point in the code, and then continued after hitting the break point, the cursor would reset most the time. It didn't always reset but it would reset at least 9/10 times. But without the breakpoint, it would never reset. That to me is very strange.

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.