当我将元素插入 a时,我为两者QTreeWidget
分配内存QStringList
QTreeWidgetItem
QStringList *temp;
while(other_elements)
{
temp = new QStringList();
temp->push_back("first_field");
temp->push_back("second_field");
items.append(new QTreeWidgetItem((QTreeWidget*)0, *temp));
element_iterator++;
}
myTreeWidget->insertTopLevelItems(0, items);
我读到调用函数QTreeWidgetItem
时会自动释放clear()
,但是QStringList
呢?是内存泄漏吗?