Results 1 to 2 of 2

Thread: I feel stupid, but I need help with QPointF dynamic array ....

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default I feel stupid, but I need help with QPointF dynamic array ....

    After surf on the web I have seen some tips on dynamic arrays.
    I want to have a private dinamyc QPointF array.

    I have to declare it so : ?
    QpointF **points_f_array;

    and later :
    points_f_array = new QpointF *[number_of_points_needed] //

    I confuse with :
    QpointF *points_f_array[];

    By last.... I have to delete every point and by last delete the array itself ?
    Is there any easy way to do this ? Maybe a Vector can be easier ?

    I feel stupid doing this question, but I can't to write the right code .
    Thanks

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: I feel stupid, but I need help with QPointF dynamic array ....

    You should use QVector -- things really are easier with proper classes.

    But when you have an array of points, perhaps you have a polygon. Therefore, see QPolygonF, which really is a QVector<QPointF>: http://doc.qt.nokia.com/latest/qpolygonf.html. At least it will give you ideas about how to handle your points.

Similar Threads

  1. QToolBar look and feel
    By schall_l in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 14th February 2011, 16:18
  2. Replies: 1
    Last Post: 10th July 2008, 17:59
  3. No Interactive feel-QProcess
    By prasann87 in forum Qt Programming
    Replies: 5
    Last Post: 11th January 2008, 10:47
  4. Look and Feel on Debian Linux
    By Krish_ng in forum Qt Programming
    Replies: 1
    Last Post: 24th July 2007, 09:11
  5. GUI Look and Feel -- public repository available?
    By Byngl in forum Qt Programming
    Replies: 2
    Last Post: 28th November 2006, 06:37

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.