hovered widget selection



  • I want to get the position of a hovered widget instead of clicked widget I was using this fucntion

               layout->indexOf(clicked_widget);
    

    to get the index of the widget but I would like to do it in a infinite while loop with the mousse move event so instead of the clicked widget what should I use ? Is there a hovered widget function because I could not find it.

    THANK YOU



  • @geor

    you can do this with an event handler with the QEvent::HoverMove /Enter/Leave

    http://doc.qt.io/qt-4.8/qhoverevent.html#details



  • @Ni.Sumi my prolem is that I am using qmouse event to display coordinates on a widget but I want it only when the cursor is on a specific widget . even thought my connect signals is on that widget the function that shows the coordinates is still active outside that widget and it show random usles stuff