当前位置: 代码迷 >> QT开发 >> qtreewidget 使用解决办法
  详细解决方案

qtreewidget 使用解决办法

热度:415   发布时间:2016-04-25 05:11:28.0
qtreewidget 使用
怎样创建一个tree控件,子层不缩进,就想qq那样?

------解决方案--------------------
C/C++ code
    QTreeWidgetItem* __qtreewidgetitem = new QTreeWidgetItem();    __qtreewidgetitem->setText(0, "Name");    ui->treeWidget->setHeaderItem(__qtreewidgetitem);    ui->treeWidget->setColumnCount(2);    QTreeWidgetItem* rootFriends = new QTreeWidgetItem(ui->treeWidget);    rootFriends->setText(0, "My Friends");    QTreeWidgetItem* rootBlocked = new QTreeWidgetItem(ui->treeWidget);    rootBlocked ->setText(0, Blocked List");    QTreeWidgetItem* friend = new QTreeWidgetItem(rootFriends);    friend ->setText(0, "Friend 1");    QTreeWidgetItem* badguy = new QTreeWidgetItem(rootBlocked);    badguy ->setText(0, "Bad Guy 1");
------解决方案--------------------
想要不缩进的话,使用 QToolBox 吧
------解决方案--------------------
http://www.qtcn.org/bbs/read-htm-tid-45510.html
不知道有啥想法没
  相关解决方案