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. [Solved] QPainterPath: add (open) polyline
Forum Updated to NodeBB v4.3 + New Features

[Solved] QPainterPath: add (open) polyline

Scheduled Pinned Locked Moved General and Desktop
3 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

    I feel a little stupid asking the obvious, but I just can't find the method to add an (open) polyline to a QPainterPath.

    Anyone?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      msue
      wrote on last edited by
      #2

      You can use a QPolygonF. It does not have to be closed.

      The questions is what you do with the QPainterPath afterwards that might auto-close any polygon to do what is thinks it has to do.

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

        Thank you. That's a good question.

        I was assuming from the name "addPolygon" that this closed the path. However, I was calling path.united(otherPath) after that, and there the docs say that any open subpath is closed.

        Now, I use addPath instead, and have the desired outcome.

        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