Results 1 to 4 of 4

Thread: Storing and managing huge arrays

  1. #1
    Join Date
    May 2009
    Posts
    7
    Thanks
    3

    Default Storing and managing huge arrays

    Hello, people!

    I'm starting with QT. My current aim is to store huge arrays of
    seven different types. I don't not know which type exactly do I need,
    it depends of file type that i'm going to read.
    My idea is to write a class that has seven QVarLengthArrays. Six of
    them are allways null and one stores my data. But this decision looks
    quite gracelessly... So my questions are:

    0. Is there any more elegant way to store my data?

    1. Is QVarLengthArray sizable for this kind of job? (Storing huge(1
    000 000 elements) arrays)


    Thanks all of you for your time and attention!

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

    Default Re: Storing and managing huge arrays

    I'd use a QVector of QVariant and register your objects with QVariant using Q_DECLARE_METATYPE. This way you can use always the same code for managing your array.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    maka (22nd July 2009)

  4. #3
    Join Date
    May 2009
    Posts
    7
    Thanks
    3

    Default Re: Storing and managing huge arrays

    Quote Originally Posted by wysota View Post
    I'd use a QVector of QVariant and register your objects with QVariant using Q_DECLARE_METATYPE. This way you can use always the same code for managing your array.
    Thank you!
    I have to read some docs and make some experiments... But before this may I ask you one more question? I have to process my data and its size could be changed. I need also fast access to data due to necessity of this processing.
    Will QVector work well?

  5. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Storing and managing huge arrays

    read this article. it should answer on your question.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  6. The following user says thank you to spirit for this useful post:

    maka (22nd July 2009)

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.