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. QTreeView with Tristate checkboxes
Forum Updated to NodeBB v4.3 + New Features

QTreeView with Tristate checkboxes

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 877 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.
  • J Offline
    J Offline
    JohnDoh
    wrote on last edited by
    #1

    Hello gents,
    I have a silly question regarding the usage of tristate checkboxes within a QTreeView.

    According to Qt documentation :

    Qt::ItemIsAutoTristate : The item's state depends on the state of its children. This enables automatic management of the state of parent items in QTreeWidget (checked if all children are checked, unchecked if all children are unchecked, or partially checked if only some children are checked).
    

    I understand that the tristate propagation behavior automatically works with QTreeWidget... But does that mean that if I use a QTreeView with a custom model, I have to reimplement all of this behavior by myself ?

    Thanks & regards

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @JohnDoh said in QTreeView with Tristate checkboxes:

      I have to reimplement all of this behavior by myself ?

      Yes - the model has to do the work. QTreeWidget also uses an internal model which does it.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JohnDoh
        wrote on last edited by
        #3

        Thank you! I close the topic :)

        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