I'm starting to put together a tree control. I need to know if I can use the same pointer to allocate the tree nodes, or if I need to keep separate variables around for each tree node?
Example:
if (pConn)
{
while (pConn[i].name != NULL)
{
subItem->setText(pConn[i].name);
i++;
}
}
if (pConn)
{
while (pConn[i].name != NULL)
{
QTreeWidgetItem *subItem = new QTreeWidgetItem(m_pConnectionsItem, ITEM_CONNECTIONS);
subItem->setText(pConn[i].name);
i++;
}
}
To copy to clipboard, switch view to plain text mode
Do I need separate subItems, one for each sub-item in the tree? What is the right way to do this? Does someone have some sample working code I could look at?
- BRC
Bookmarks