Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. hovered widget selection
Forum Update on Monday, May 27th 2025

hovered widget selection

Scheduled Pinned Locked Moved Unsolved General and Desktop
signals&slotsmouseevent
3 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    geor
    wrote on 15 Jun 2016, 15:57 last edited by
    #1

    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

    N 1 Reply Last reply 15 Jun 2016, 16:21
    0
    • G geor
      15 Jun 2016, 15:57

      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

      N Offline
      N Offline
      Ni.Sumi
      wrote on 15 Jun 2016, 16:21 last edited by
      #2

      @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

      G 1 Reply Last reply 15 Jun 2016, 18:03
      1
      • N Ni.Sumi
        15 Jun 2016, 16:21

        @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

        G Offline
        G Offline
        geor
        wrote on 15 Jun 2016, 18:03 last edited by
        #3

        @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

        1 Reply Last reply
        0

        1/3

        15 Jun 2016, 15:57

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved