Important: Please read the Qt Code of Conduct -

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:


    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
    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:


    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 !

  • I'm noticing that setFirstColumnSpanned is a major time-sink in Qt 5.11 as well.

Log in to reply