Results 1 to 2 of 2

Thread: Slow QStandardItem::setChild

  1. #1
    Join Date
    Feb 2013
    Posts
    38
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Slow QStandardItem::setChild

    Hi,

    I have QStandardItemModel model.

    When I add an item to the invisibleRootItem() of the model with setChild, it takes me arond 200 ms.
    When I add an item to an item of the model with setChild, it takes me around 0 ms.

    Why is it slow ? How to do it better (because I really want to add items to the invisibleRootItem()) ?

    Thanks.

    Temporary answer :
    I had this effect when I was doing on the item (or on the invisible) a setRowCount and a setColumCount.
    I still have something slow...I need to figure out where it is...
    Last edited by moijhd; 29th April 2014 at 13:40.

  2. #2
    Join Date
    Feb 2013
    Posts
    38
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Slow QStandardItem::setChild

    The option QHeaderView::setResizeMode of the header of my view set to QHeaderView::ResizeToContents was causing the slow. I removed it.

    The QStandardItem::setChild still takes around 13 ms (from 300 ms) (based on a QTime::start and QTime::elapsed around it) which I think is still a lot.

    I am producing on a Debian 6.0.6 with Qt 4.6.3.
    Last edited by moijhd; 30th April 2014 at 13:53.

Similar Threads

  1. Replies: 2
    Last Post: 22nd August 2013, 10:50
  2. QStandardItemModel and QStandardItem
    By DmitryNik in forum Newbie
    Replies: 5
    Last Post: 9th October 2011, 17:17
  3. Replies: 3
    Last Post: 29th October 2010, 23:26
  4. invisibleRootItem question
    By QXiaoWang in forum Qt Programming
    Replies: 1
    Last Post: 25th October 2010, 11:28
  5. setObjectName for QStandardItem
    By abk883 in forum Newbie
    Replies: 1
    Last Post: 20th May 2010, 18:20

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.