Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Is there similar function QGraphicsItem::boundingRect () for circle?

    General and Desktop
    3
    3
    2089
    Loading More Posts
    • 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.
    • R
      romeo.rbw last edited by

      Hi..
      I used the boundingRect() to make a circle. But the active region always a rectangular like in the manual instruction. Is there any suggestion, how to make my active region only in the inside of the circle especially when pointing a cursor to this item? Thank you.

      1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators last edited by

        would be "QGraphicsItem::shape()":http://qt-project.org/doc/qt-4.8/qgraphicsitem.html#shape enough for you?

        --- 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 Reply Quote 0
        • A
          Asperamanca last edited by

          If you use QGraphicsEllipseItem, the shape should already be correctly defined for you.

          If you write your own QGraphicsItem subclasses, you can optionally reimplement shape() in order to give the item any shape you like. By default, the shape is equal to the boundingRect.

          See "the docs":http://qt-project.org/doc/qt-4.8/qgraphicsitem.html#shape for more info about what the shape is used for.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post