Results 1 to 3 of 3

Thread: Maximum size of QStandardItemModel

  1. #1
    Join Date
    Jul 2014
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Maximum size of QStandardItemModel

    Hi,

    I suffer a crash issue when use QStandardItemModel with huge row*column

    #10 0x00002aaaabb007a8 in QVector<QStandardItem*>::realloc(int, int) ()
    ...

    the row is 30000, column is 29656.

    Do you have idea about the maximum size that we should limit in QStandardItemModel, thanks.

  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: Maximum size of QStandardItemModel

    30000 * 29656 = 0.88E9 items. QStandardItem has size of 16 bytes in Qt5. Assuming no items keep any data (they are empty) the model already occupies almost 16 gigabytes of memory. Do you have that much in your machine? Once you add data to each item (setting things like text, color, font, etc.) the size of each item will grow. Do you have enough memory to contain that much data?

    To answer your question:

    Do you have idea about the maximum size that we should limit in QStandardItemModel, thanks.
    There is no set limit on the size of the model as the model may have practically infinite depth.
    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. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Maximum size of QStandardItemModel

    the row is 30000, column is 29656.
    This sounds like a design problem to me. Do you really need to keep almost 900 million things in a model (and in memory) at the same time? Are all of them going to contain something, or will most of them be empty?

Similar Threads

  1. The maximum size of a QList
    By Denarius in forum Newbie
    Replies: 3
    Last Post: 30th November 2012, 11:27
  2. Problem with setting a label's maximum size
    By Midleiro F. in forum Newbie
    Replies: 2
    Last Post: 21st October 2012, 19:09
  3. Get maximum size a widget can get
    By joseprl89 in forum Qt Programming
    Replies: 0
    Last Post: 8th August 2011, 09:57
  4. Replies: 6
    Last Post: 27th July 2010, 22:07
  5. maximum size of xml files
    By freeskydiver in forum Qt Programming
    Replies: 1
    Last Post: 15th January 2008, 11:02

Tags for this Thread

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.