Results 1 to 4 of 4

Thread: toFillPolygon

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default toFillPolygon

    Hello forum,

    Please Check the following code:

    Qt Code:
    1. QPolygonF myPolygon;
    2. QGraphicsEllipseItem item(-100,-50,200,100);
    3. myPolygon = item.shape().toFillPolygon();
    To copy to clipboard, switch view to plain text mode 


    QPolygonF is nothing but a vector of QPointF.

    In that case can i visualize myPolygon as a dotted ellipse ?



    Regards
    Sajjad

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: toFillPolygon

    Maybe just set a proper brush and pen style for QPainter when drawing the ellipse item ? Why do you need the "toFillPolygon()" ?

  3. #3
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: toFillPolygon

    i need to do some intersection testing or draw arrow item from the border of the ellipse when the user press on elliptical item

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: toFillPolygon

    Was the simple maths from your earlier Decide the arrow graphics item's docking point not suitable?

    Now that you have the ellipse as a polygon the approach used in the Diagram Scene Example may work for you.

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.