Hai,
I need to display some icons and information when click on current QtreeWidgetItem
ex: code
for(int i=0; i<10; i++)
{
ui->secTreeWidget->addTopLevelItem(parent);
// Add the child TreeWidgetItem one step down in the tree
parent->addChild(child);
// Set the widget for the child item to be a QLineEdit for column zero.
ui
->secTreeWidget
->setItemWidget
(child,
0,
new QLabel(ui
->secTreeWidget
));
}
for(int i=0; i<10; i++)
{
QStringList strings;
strings << QString("Wit Name");
QTreeWidgetItem *parent = new QTreeWidgetItem(strings);
ui->secTreeWidget->addTopLevelItem(parent);
// Add the child TreeWidgetItem one step down in the tree
QTreeWidgetItem *child = new QTreeWidgetItem;
parent->addChild(child);
// Set the widget for the child item to be a QLineEdit for column zero.
ui->secTreeWidget->setItemWidget(child, 0, new QLabel(ui->secTreeWidget));
}
To copy to clipboard, switch view to plain text mode
Bookmarks