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. Select widget via function... ?
Forum Updated to NodeBB v4.3 + New Features

Select widget via function... ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qwidget
3 Posts 3 Posters 505 Views 2 Watching
  • 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.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey

    I'd like to create a "action" that would behave like :

    1. I press the button.
    2. Now once I move, widgets highlight/frame outline once mouse hover
    3. Click would return that widget ptr...

    Any idea how to bite it ?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      One way could be to create a transparent widget on top of your UI, make it track the mouse moves and draw a QRubberBand on the widget that's under the mouse cursor. You enable that widget with your button.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • qwasder85Q Offline
        qwasder85Q Offline
        qwasder85
        wrote on last edited by
        #3

        Set a stylesheet for the widgets:

        QWidget:hover { border: 1px solid red; }
        

        And get the clicked widget's pointers by connecting to QApplication::focusChanged(QWidget *old, QWidget *now).

        1 Reply Last reply
        2

        • Login

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