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. [SOLVED] How to show branch/child indicator for QStandardItem

[SOLVED] How to show branch/child indicator for QStandardItem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.4k Views
  • 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.
  • F Offline
    F Offline
    Firehand
    wrote on last edited by
    #1

    Hello,

    I have QTreeView which uses QStandardItemModel/QStandardItem to show remote directories and files. I dont want to populate all dirs until the branch icon is clicked.
    So is there any way to show the indicators as in QTreeWidgetItem::setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator) ?

    Thanks!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIK, you need to have a child to have the indicator. What you could do is put a dummy child that says e.g. "Loading.." and that you will replace once you have your data.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Firehand
        wrote on last edited by
        #3

        [quote author="SGaist" date="1411656962"]Hi,

        AFAIK, you need to have a child to have the indicator. What you could do is put a dummy child that says e.g. "Loading.." and that you will replace once you have your data.

        Hope it helps[/quote]
        Thank you! It works as wonderful. Later when i populate the dirs i will remove the empty "Loading.." item.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Great !

          Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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