Results 1 to 12 of 12

Thread: What really is a QPolygon...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What really is a QPolygon...

    I am quite stucked at this problem...the previous code does not work.
    The problem is depicted in the figure.
    There is a way to merge two curves or polygon and picks the envelope?
    Regards
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: What really is a QPolygon...

    It's not an easy math problem so I wouldn't expect there to be a ready function for it in Qt.

  3. #3
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What really is a QPolygon...

    Actually, the union of polygons works quite well with QPOlygonF::united(), and
    I expected that a similar function was available also for polylines.
    The problem is that after the union, the points are not ordered in the right way....
    It should be enough to have a way to open the polygon, i.e. eliminating the segment which lies on the x axis....

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: What really is a QPolygon...

    Have you tried using QPainterPath? Maybe you'll have more luck with it.

  5. #5
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What really is a QPolygon...

    I have no idea at all how to use it.
    If you some suggestion, I will appreciate very much....
    G

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: What really is a QPolygon...

    Add primitives to it. You can also unite it. There is a paragraph in the reference (Composing a QPainterPath) that might be helpful.

  7. #7
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What really is a QPolygon...

    I tried, but the problem is always the same.
    After the union of paths, the points order is arbitary and for this reason is quite difficult to convert the path to a curve in the 2D-plane.
    (For instance, the union of Polygons use the united function of QPainterPath).
    G

Similar Threads

  1. Replies: 2
    Last Post: 24th January 2009, 08:11
  2. QPolygon rotate
    By xgoan in forum Qt Programming
    Replies: 3
    Last Post: 8th May 2007, 11:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.