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. TreeView Hide Column hides the expand / collapse icon and prints plain Table
Forum Updated to NodeBB v4.3 + New Features

TreeView Hide Column hides the expand / collapse icon and prints plain Table

Scheduled Pinned Locked Moved Solved General and Desktop
treeviewexpandiconsymbolcolumn
3 Posts 2 Posters 2.5k 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.
  • O Offline
    O Offline
    Opa114
    wrote on 15 Nov 2016, 16:41 last edited by
    #1

    Hi there,

    i have a TreeView which i populate with some data. In the first column i have stored some data i need the whole time, so it makes sense to fill the data there. Because the data should not be visible to the user i hide the column via ui->treeView->setColumnHidden(0, TRUE); which works, but there is a big problem: this command hides the expand / collapse arrow symbol and the Tree Structure, too. I now got a plain table list, which is very bad.

    Is there any way to hide the column without changing the Tree-Structure and the icon?

    I solved it temporarly by storing the data into the last column of my TreeView and hide this column, which works as expected, but maybe there is an easier solution for this?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 16 Nov 2016, 06:51 last edited by
      #2

      Unfortunately no. QTreeView assumes only the first column has children and base everything off that one

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      1
      • O Offline
        O Offline
        Opa114
        wrote on 16 Nov 2016, 12:30 last edited by
        #3

        Good to know, so my solution to store this in the last column and hide this one is the best solution for me.

        1 Reply Last reply
        0

        1/3

        15 Nov 2016, 16:41

        • Login

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