QtTreePropertyBrowser getting slower to populate



  • Hi,

    I am experiencing a strange issue, which I have been unsuccessfully investigating during the whole day :(

    Basically, I use one of the Qt Property Browser component: QtTreePropertyBrowser.

    The object being linked by this widget changes (when the users load a new file), therefore, sometime I recreate its content.

    However, populating the QtTreePropertyBrowser lasts significantly longer each time, with the amount of items being constant, and I haven't been able to find out why...

    I am using a QtVariantPropertyManager and a QtVariantEditorFactory object to create the properties.

    Each time I want to display a new widget, I first call the following methods to clear the previous content:

    m_pVariantManager->clear();
    QtTreePropertyBrowser::clear();

    I have been looking for stuff (lists, maps) not being emptied, but wasn't able to find anything wrong...

    What am I missing ?

    thanks for your help !!



  • I have found out that commenting one line fix the increasing population duration, however, this leads to the text not being displayed correctly.

    the line to comment out is the call to
    @updateItem(newItem);@
    which happens in
    @void QtTreePropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, QtBrowserItem *afterIndex)@

    Any idea why ? I am completely lost I must admit :(



  • Actually, the increasing slow down can be removed by commenting the @setFirstColumnSpanned()@ call from qttreepropertybrowser.cpp, from the @void QtTreePropertyBrowserPrivate::updateItem(QTreeWidgetItem *item)@ method:

    @//item->setFirstColumnSpanned(!property->hasValue());@

    I am not sure why, and what the side effects are, but the population process get much faster, and more important, is a constant time operation !


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.