How can we know when mouse cursor enter a widget from other different widget class?
-
Have a look at "this thread":http://developer.qt.nokia.com/forums/viewthread/1376 for a similar question with solution.
-
I am not talking about any specific button or slider. I want to know in general if we have two widget or two logical area and both are under same parent. How can we know inside one widget class function when mouse enter the other widget area or logical area.
-
You want to do something with slider, when mouse is over button. Right ?
If it is so, you could try overriding the following in QPushButton.
@void QWidget::enterEvent ( QEvent * event )@EDIT : you can make sure, that the widget is under the mouse cursor using : "QWidget::underMouse ()":http://doc.qt.nokia.com/stable/qwidget.html#underMouse
-
my problem is while implementing enter event the enter event will be called only for that widget which class we are implementing ex - customclass::enterEvent(QEvent *e); here the enter event will be called only when mouse enter custom class area but i want to detect the enterEvent of other widget from custom class.
-
You can try to use an "eventFilter":http://doc.qt.nokia.com/4.7/qobject.html#eventFilter