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. Significance of the row parameter in QTreeView::setRowHidden

Significance of the row parameter in QTreeView::setRowHidden

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.2k Views 1 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.
  • A Offline
    A Offline
    ajaxcrypto
    wrote on last edited by
    #1

    QTreeView has a setRowHidden member function. The function takes three arguments. While the second (parent QModelIndex) and the third (a boolean) are easy to understand, what does the int row parameter signify? In a tree, the rows cannot be numbered linearly trivially, does row imply the insertion order in which it was inserted to some parent? Or something else?

    joeQJ 1 Reply Last reply
    0
    • A ajaxcrypto

      QTreeView has a setRowHidden member function. The function takes three arguments. While the second (parent QModelIndex) and the third (a boolean) are easy to understand, what does the int row parameter signify? In a tree, the rows cannot be numbered linearly trivially, does row imply the insertion order in which it was inserted to some parent? Or something else?

      joeQJ Offline
      joeQJ Offline
      joeQ
      wrote on last edited by joeQ
      #2

      @ajaxcrypto Hi,friend. Welcome.

      In the QTreeView, when we use row, we should give the row's parent index. about this, the model/view programming. In Basic concepts section. It tell different in QListView QTableView QTreeView. It will help you better than me.

      Just do it!

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ajaxcrypto
        wrote on last edited by
        #3

        So row signifies the order in which the row was inserted/added for the given parent.

        JonBJ 1 Reply Last reply
        0
        • A ajaxcrypto

          So row signifies the order in which the row was inserted/added for the given parent.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @ajaxcrypto
          No, it seems to me the http://doc.qt.io/qt-4.8/model-view-programming.html#basic-concepts link @joeQ gave you shows in the diagram what the row definition is for a Tree Model. Did you look at it?

          To be clear, it is the current order of children at each level, not the order they were added --- although those two might be the same if all you do is append, you can also do inserts into the middle of the children, or deletes, which will change the row numbering.

          1 Reply Last reply
          1
          • A Offline
            A Offline
            ajaxcrypto
            wrote on last edited by
            #5

            Well yes, the model will not be inserting, only appending rows so in my case, it matches the insertion order. You are completely correct however.

            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