QT中new QTreeWidgetItem问题
我的问题如下:
一个对话框类,构造函数中new一个QTreeWidget
ADlg::ADlg(QWidget *parent): QDialog(parent)
{
tree = new QTreeWidget;
}
ADlg::~ADlg()
{
delete tree;
}
void ADlg::OpenADlg()
{
QTreeWidgetItem *Item1= new QTreeWidgetItem(tree, list1);
for(int i=0;i<..;i++)
{
QStringList list2;
list2<<(..);
QTreeWidgetItem *Item2= new QTreeWidgetItem(Item1, list2);
Item1->addChild(Item2);
}
exec();
}