Results 1 to 14 of 14

Thread: QList of variable data type?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Posts
    70
    Thanks
    43
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QList of variable data type?

    Thank you so much for the vector information! I've found it very difficult to find good resources on vectors in a high-performance environment, so I really appreciate your input. In my experience, Boost tends to slow things down enough that I'm okay with programming the deletion myself. It'll be good practice, anyway.

    I really like the idea of passing a data chunk into a point constructor. That sounds very clean, especially since the file header also gives me the size-on-disk of each point format, I already know programmatically how big of a chunk to read for each point.

    Since my data file is stored in a binary format (not ASCII text), would it be faster to pull data one point (30 bytes, for example) at a time, or one component at a time (2 bytes)? I imagine it would be the former because of the reduced number of calls to the disk, especially with a typical HDD. In that case, would it make sense to read in a QByteArray using QIODevice::read(qint64) and pass that to the point constructor?

    I desperately need to take a good course on code optimization so I don't have to rely on you all. Thanks again! This should be my last question.
    Last edited by Phlucious; 30th November 2011 at 21:26. Reason: reformatted to look better

  2. #2
    Join Date
    Jan 2011
    Posts
    70
    Thanks
    43
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QList of variable data type?

    One more... Why would I use static_cast as in
    Qt Code:
    1. pt1_t * pt1 = static_cast< pt1_t * >( ptcore );
    To copy to clipboard, switch view to plain text mode 
    instead of simply equating it and calling the constructor?
    Qt Code:
    1. ptcore_t* ptcore;
    2. pt1_t* pt1 = new pt1_t();
    3. ptcore = pt1;
    4. //or....
    5. ptcore_t* ptcore = new pt1_t();
    To copy to clipboard, switch view to plain text mode 
    Last edited by Phlucious; 2nd December 2011 at 00:26. Reason: updated contents

Similar Threads

  1. Changing the type of QList
    By wagmare in forum Newbie
    Replies: 4
    Last Post: 19th October 2011, 11:59
  2. Replies: 4
    Last Post: 8th December 2010, 13:22
  3. Replies: 2
    Last Post: 6th October 2010, 22:09
  4. 'QList' does not name a type
    By Qt Coder in forum Qt Programming
    Replies: 3
    Last Post: 22nd September 2009, 14:28
  5. Getting Type of an variable
    By hgedek in forum Qt Programming
    Replies: 1
    Last Post: 9th September 2007, 15: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
  •  
Qt is a trademark of The Qt Company.