Results 1 to 2 of 2

Thread: Is QPolygon really just a vector of points?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Posts
    23
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Is QPolygon really just a vector of points?

    Hi,

    QPolygon states that it provides a vector of points.

    Does this mean I can safely do the following or not?

    QVector<QPoints> tmp;

    somefunction(tmp);

    QPolygon somefunction(QPolygon poly)
    {
    //do something to the poly
    return poly;
    }




    Thanks.

  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: Is QPolygon really just a vector of points?

    QPolygon class has a (non-explicit) constructor that takes a QVector<QPoint> as argument, so your code should compile and work fine.

  3. The following user says thank you to stampede for this useful post:

    taraj (26th October 2011)

Similar Threads

  1. Copying vector of pointers to another vector
    By Momergil in forum Newbie
    Replies: 12
    Last Post: 24th September 2011, 22:09
  2. How to use a QPolygon as a Pushbutton?
    By Manish.S in forum Newbie
    Replies: 4
    Last Post: 6th December 2010, 10:57
  3. QPainterPath and QPolygon
    By Muz in forum Qt Programming
    Replies: 0
    Last Post: 18th September 2009, 07:16
  4. What really is a QPolygon...
    By giusepped in forum Qt Programming
    Replies: 11
    Last Post: 14th January 2009, 06:57
  5. 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.