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. Mouse Click/Press event partially working on QGraphicsPixmaxItem.

Mouse Click/Press event partially working on QGraphicsPixmaxItem.

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 425 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.
  • IamSumitI Offline
    IamSumitI Offline
    IamSumit
    wrote on last edited by IamSumit
    #1

    Hello all,
    I have plotted a QGraphicsPixmaxItem on which i set a transparent pixmap of circle. I am capturing mouse events like mouse click/press on this item successfully.
    I observed the two things:
    When i click on perimeter of this circle then only i am getting click event, but when i click inside the circle then i am not getting any click event.
    My Question is How can in get click event inside the circle ?

    Be Cute

    raven-worxR 1 Reply Last reply
    0
    • Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      Hello.
      Is your circle solid or contains your item only the outline? What boundingRect are you using? Normally the MouseEvents are triggert, when you perform actions inside the items boundingRect.
      If you just need a circle, QGraphicsEllipseItem should do the same for you.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • IamSumitI IamSumit

        Hello all,
        I have plotted a QGraphicsPixmaxItem on which i set a transparent pixmap of circle. I am capturing mouse events like mouse click/press on this item successfully.
        I observed the two things:
        When i click on perimeter of this circle then only i am getting click event, but when i click inside the circle then i am not getting any click event.
        My Question is How can in get click event inside the circle ?

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #3

        @IamSumit
        see the QGraphicsPixmapItem::setShapeMode()
        By default it's QGraphicsPixmapItem::MaskShape, which means the transparent areas in the pixmap wont be added to it's shape which is responsible for the clickable area.
        You want it to set to QGraphicsPixmapItem::BoundingRectShape, or reimplement QGraphicsItem::shape() yourself.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        3

        • Login

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