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. QPolygonF to QRectF

QPolygonF to QRectF

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 752 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.
  • L Offline
    L Offline
    Loc888
    wrote on last edited by
    #1

    I can't convert QPolygonF to QRectF.
    I need to return exactly the same object, except it has to be a QRectF created from QPolygonF.

    Can't find any idea how to even start, since QPolygonF has 4-5 QPoints and QRectF 4 but doubles... Any help?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by Bonnie
      #2

      A QRectF can only define a rectangle.
      So it is not possible "to return exactly the same object" unless your QPolygonF is a rectangle.

      L 1 Reply Last reply
      3
      • B Bonnie

        A QRectF can only define a rectangle.
        So it is not possible "to return exactly the same object" unless your QPolygonF is a rectangle.

        L Offline
        L Offline
        Loc888
        wrote on last edited by
        #3

        @Bonnie I wanna convert it only when it is a rectangle, so in this case it will be.

        B 1 Reply Last reply
        0
        • L Loc888

          @Bonnie I wanna convert it only when it is a rectangle, so in this case it will be.

          B Offline
          B Offline
          Bonnie
          wrote on last edited by Bonnie
          #4

          @Loc888
          Then what's the problem here?
          A RectF can be defined by the topLeft point and the bottomRight point of the rectangle.
          Or you may try QPolygonF::boundingRect().

          1 Reply Last reply
          4

          • Login

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