Results 1 to 3 of 3

Thread: Set model into treeview

  1. #1
    Join Date
    Apr 2006
    Location
    Saint-Petersburg, Russia
    Posts
    63
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Set model into treeview

    Hello, colleagues !

    I make MDi application, and test setting model into treeview such as
    Qt Code:
    1. QTreeView * tv = new QTreeView;
    2. QAbstractItemModel * radModel = new QStandardItemModel (2*11776, 100000, 0);
    3. tv->setModel (radModel);
    4. QMdiSubWindow * subW = m_mdiArea->addSubWindow (tv);
    5. tv->show ();
    To copy to clipboard, switch view to plain text mode 
    But one bug arises
    ASSERT failure in QVector<T>::at: "index out of range", file ../../include/QtCore/../../src/corelib/tools/qvector.h, line 351

    If I try to construct model with 10000 columns then all works fine. Where is my error and which way I have to solve this problem ?
    Best regards,
    Yuriy Rusinov.

  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: Set model into treeview

    2*11776*100000 = ~2.35*10^9 = ~2G items. Can your computer really handle QStandardItemModel with so many items? Does your machine have more than 16G RAM?
    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
    Apr 2006
    Location
    Saint-Petersburg, Russia
    Posts
    63
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Set model into treeview

    Unfortunately not, I try to control some input items.
    Best regards,
    Yuriy Rusinov.

Similar Threads

  1. Use QIterator on TreeView's model
    By LynneV in forum Qt Programming
    Replies: 1
    Last Post: 12th December 2009, 19:46
  2. CSS does not work with custom model + TreeView
    By dsedov in forum Qt Programming
    Replies: 0
    Last Post: 11th December 2009, 14:29
  3. Replies: 2
    Last Post: 27th September 2009, 21:36
  4. Treeview and custom model
    By steg90 in forum Qt Programming
    Replies: 8
    Last Post: 15th May 2007, 13:54
  5. TreeView custom model
    By steg90 in forum Newbie
    Replies: 1
    Last Post: 9th May 2007, 10:06

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.