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. Determing what protion of QSvgWidget is clicked
Qt 6.11 is out! See what's new in the release blog

Determing what protion of QSvgWidget is clicked

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 701 Views 1 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.
  • E Offline
    E Offline
    Encya
    wrote on last edited by
    #1

    Hi,

    I'm having trouble implementing the following behaviour: determing what portion of a QSvgWidget is clicked.

    The SVG image I created hase some areas I would not like to have user interaction. I have overloaded QSvgWidget and in the mousepressed event I would like to determine what part of the SVG image was clicked.

    One solution I thought of was by checking the color of the clicked pixel, the areas that should be clickable will Always have a different color than those not clickable. But even after research I have not yet been able to work this out.

    Does anyone have any suggestions on how the pixel or a different solution can be done?

    With kind regards,
    Bas

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

      Hi,

      One possible way is described here

      Hope it helps

      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
      0

      • Login

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