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. Highlight Items rect beneath mouse cursor of QGraphicsProxyWidget
QtWS25 Last Chance

Highlight Items rect beneath mouse cursor of QGraphicsProxyWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
graphics viewgraphicsitem
1 Posts 1 Posters 453 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.
  • Zee_07Z Offline
    Zee_07Z Offline
    Zee_07
    wrote on last edited by
    #1

    I have so many items inside QGraphicsProxyWidget and want to get the rect of item which is under mouse cursor.
    Did this:
    QPoint m_globalMousePos = e->globalPos(); //in mouseMove Event of some other class

    void handleGraphicsProxyWidget(QGraphicsProxyWidget proxyWidget){
    QWidget
    widget = proxyWidget->widget()->childAt(proxyWidget->widget()->mapFromGlobal(m_globalMousePos));
    }

    It gives me the correct item from QGraphicsProxyWidget as widget if scaling is not applied on view (QGraphicsView in which this proxyWidget lies), means item which is under mouse cursor.
    But if scaling happens on graphicsView then I am not getting the proper item.

    I inspect little and found that after scaling proxyWidget->widget() gives same rect as earlier without scaling, that's why mapping is not occurring correct.

    Please let me know how to get the item of QGraphicsProxyWidget when scaling is applied on view.

    Thanks and Kind Regards,
    Zee_07

    1 Reply Last reply
    0

    • Login

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