View Full Version : QTreeView
npc
24th January 2007, 07:34
Hi all,
How to add a column in QTreeView, and how to name that column ?
Thanks,
e8johan
24th January 2007, 07:52
The headers (i.e. columns) are a part of the model.
gri
24th January 2007, 07:53
You need to use a model. Just look up QStandardItemModel in your documentation.
QStandardItemModel* p = new QStandardItemModel(0, 2, myView);
p->setHeaderData(0, Qt::Horizontal, "First Column");
p->setHeaderData(1, Qt::Horizontal, "Second Column");
myView->setModel(p);
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.