Results 1 to 2 of 2

Thread: QTreeView with QAbstractItemModel slow

  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QTreeView with QAbstractItemModel slow

    Hi guys,
    I use a subclass of QAbtractItemModel and QTreeView to edit big xml files. It works fine, but today I noticed, that the app gets very slow, if the xml file is too big.

    Then I debugged a little bit and noticed, that the index method i called everytime. Even if I move the mouse over the view.

    What's wrong? What can I do. There are 400 items and it is slow. What, if there are 5000 items?

    Please help me...thanks

  2. #2
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeView with QAbstractItemModel slow

    After optimizing rowCount- and data-method and implementing hasChildren-method the view works like a charm = )

Similar Threads

  1. Performance with QTreeView and QAbstractItemModel
    By Goug in forum Qt Programming
    Replies: 2
    Last Post: 23rd November 2011, 01:30
  2. QTreeView with QAbstractItemModel
    By Fletcher in forum Qt Programming
    Replies: 4
    Last Post: 11th December 2009, 00:02
  3. Creating a QAbstractItemModel for QTreeView
    By hbill in forum Qt Programming
    Replies: 13
    Last Post: 14th August 2008, 17:01
  4. Need help with QTreeView/QAbstractItemModel
    By Valheru in forum Qt Programming
    Replies: 5
    Last Post: 28th August 2006, 16:09
  5. [QT4] QTreeView, QAbstractItemModel and sorting
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 24th March 2006, 21:16

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.