Guilo
10th February 2010, 20:38
Hi !
First of all, what is the difference between QTreeView and QTreeWidget ? The same applies for QListView and QListWidget.
I want the first column of my QTreeView to display a checkbox. Here is my code :
QStandardItem* item0 = new QStandardItem();
item0->setCheckable(true);
item0->setCheckState(Qt::Checked);
item0->setAccessibleText(false);
item0->setEditable(false);
It works great but I have seeked for how to center the checkbox in the column and didn't find anything. There is no text in that column, only a checkbox.
And finally, I wonder how to add a combox in my tree and even if it is possible within a QTreeView. I don't especialy need a QTreeView, only a "list"-style widget.
Thanks
First of all, what is the difference between QTreeView and QTreeWidget ? The same applies for QListView and QListWidget.
I want the first column of my QTreeView to display a checkbox. Here is my code :
QStandardItem* item0 = new QStandardItem();
item0->setCheckable(true);
item0->setCheckState(Qt::Checked);
item0->setAccessibleText(false);
item0->setEditable(false);
It works great but I have seeked for how to center the checkbox in the column and didn't find anything. There is no text in that column, only a checkbox.
And finally, I wonder how to add a combox in my tree and even if it is possible within a QTreeView. I don't especialy need a QTreeView, only a "list"-style widget.
Thanks