#include "widget.h"
#include "ui_widget.h"Widget::Widget(QWidget *parent) :QWidget(parent),ui(new Ui::Widget)
{ui->setupUi(this);ui->treeWidget->setHeaderLabels(QStringList()<<"英雄"<<"英雄介绍");QTreeWidgetItem *liItem1 = new QTreeWidgetItem(QStringList()<<"力量");QTreeWidgetItem *liItem2 = new QTreeWidgetItem(QStringList()<<"敏捷");QTreeWidgetItem *liItem3 = new QTreeWidgetItem(QStringList()<<"智力");ui->treeWidget->addTopLevelItem(liItem1);ui->treeWidget->addTopLevelItem(liItem2);ui->treeWidget->addTopLevelItem(liItem3);QTreeWidgetItem *l1 = new QTreeWidgetItem(QStringList()<<"小明"<<"可强行攻击");liItem1->addChild(l1);QStringList Hl2;Hl2<<"小红"<<"可加速";QTreeWidgetItem *l2 = new QTreeWidgetItem(Hl2);liItem2->addChild(l2);
}Widget::~Widget()
{delete ui;
}