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. Is there similar function QGraphicsItem::boundingRect () for circle?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.3k 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.
  • R Offline
    R Offline
    romeo.rbw
    wrote on last edited by
    #1

    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
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      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
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        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
        0

        • Login

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