How to enable RootIsDecorated in QTreeView if the first column is hidden
-
If I hide the first column in a QTreeView the root decorate disappears even if setRootIsDecorated is set to true.
m_ui->treeView->setModel(m_sqlTreeModel); m_ui->treeView->hideColumn(0); m_ui->treeView->setRootIsDecorated(true);
How can I enable the root decorate, when I hide the first column?
-
Hi,
Well, technically you are hiding the root index so it's not going to be painted.
What exactly are you after ?
-
Hi,
Well, technically you are hiding the root index so it's not going to be painted.
What exactly are you after ?
-
Hallo,
I have the same question and have not come across an answer yet. How do I get the branch drawn when the first column is hidden.@AndreasF said in How to enable RootIsDecorated in QTreeView if the first column is hidden:
How do I get the branch drawn when the first column is hidden.
Don't hide the first column - the decoration belongs to the first column. Since you're creating the model I don't see why the first column must be hidden - simply move that data to another column in your model.
-
@AndreasF said in How to enable RootIsDecorated in QTreeView if the first column is hidden:
How do I get the branch drawn when the first column is hidden.
Don't hide the first column - the decoration belongs to the first column. Since you're creating the model I don't see why the first column must be hidden - simply move that data to another column in your model.
@Christian-Ehrlicher
Hello Christian,of course you are right that I am in control of the displayed data and sequence on my own model. However, there are circumstances that would suggest that I have a present structure and for whatever reason I want to hide columns. Therefore I hoped that the QTreeView for the display of the branches can be configured to always display the node (expand/collapse) in the first visible column.
-
@Christian-Ehrlicher
Hello Christian,of course you are right that I am in control of the displayed data and sequence on my own model. However, there are circumstances that would suggest that I have a present structure and for whatever reason I want to hide columns. Therefore I hoped that the QTreeView for the display of the branches can be configured to always display the node (expand/collapse) in the first visible column.