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. QPainterPath::contains - Docs too brief
Qt 6.11 is out! See what's new in the release blog

QPainterPath::contains - Docs too brief

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.5k 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    @bool QPainterPath::contains ( const QRectF & rectangle ) const

    Returns true if the given rectangle is inside the path, otherwise returns false.@

    Does it mean completely contained? Partially contained? All corners contained? All lines contained?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Judging from other places (QRectF), it's probably something like "more or less completely contained". It's usually hard to say for sure when dealing with floating point numbers.

      (Z(:^

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        Ok, I know about the limitations concerning whether edges are included or not.
        But for example, if I have a painter path in form of a pac man (circle with open triangular mouth), and a rectangle which is completely inside the pac man's bounding rectangle, but partially visible in the mouth - is that rectangle considered "contained"?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          That is a quite specific use case. You can test, and maybe update the documentation with your findings (or file a bug report for that).

          (Z(:^

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            It's just an example to illustrate that the word "contained" alone is not as clear as one would hope.
            I wouldn't dare to update the documentation based on some trial and error. The docs need to describe how the method is expected to perform (and any deviation from that is then a good basis for a bug report).

            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