Results 1 to 3 of 3

Thread: Subclassed QLabel and enterEvent

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Subclassed QLabel and enterEvent

    Hi,

    I have subclassed a QLabel and want reimplemente QWidget::enterEvent ( QEvent * event ). So the Doku says:

    This event handler can be reimplemented in a subclass to receive widget enter events which are passed in the event parameter.
    An event is sent to the widget when the mouse cursor enters the widget.

    I ask me now, which other action, then a mouse-cursor-in, could appear in a subclassed QLabel, that starts an enterEvent()? Because, if there is only a mouse-cursor-in possible, I don't need to check this in my reimplemented function.

    Thanks,
    Lykurg

  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: Subclassed QLabel and enterEvent

    I don't quite understand... Check what? What triggered the event? Only a cursor entry can trigger it, if the docs say so (though of course it doesn't have to be a mouse cursor, it'll work with a touchscreen or any other input device able to move the pointer).

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Subclassed QLabel and enterEvent

    Ah, I read an "also" in doc (An event is sent to the widget also when the mouse cursor enters the widget.), and so I wonder which user-action can also trigger the event.
    I also wonder, if only a mouse entry can trigger it, why you need QEvent * event. But as I see now, you can get the position via "event", if someone needs.

    Thanks

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.