Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtTreePropertyBrowser getting slower to populate
Qt 6.11 is out! See what's new in the release blog

QtTreePropertyBrowser getting slower to populate

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gjaegy
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0
    • G Offline
      G Offline
      gjaegy
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gjaegy
        wrote on last edited by
        #3

        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 !

        1 Reply Last reply
        0
        • V Offline
          V Offline
          Vadi2
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved