vinayaka
2nd March 2012, 06:38
Hai,
for(int i=0; i<3; i++)
{
QStringList strings;
strings << QString("Wit Name");
QTreeWidgetItem *parent = new QTreeWidgetItem(strings);
ui->firstTreeWidget->addTopLevelItem(parent);
parent ->setIcon(0,QIcon(QString::fromUtf8(":/images/heart.ico")));
QTreeWidgetItem *child = new QTreeWidgetItem;
parent->addChild(child);
ui->firstTreeWidget->setItemWidget(child, 0, new QLineEdit(ui->firstTreeWidget));
}
Icon is not setting . Is there any problem in the code
for(int i=0; i<3; i++)
{
QStringList strings;
strings << QString("Wit Name");
QTreeWidgetItem *parent = new QTreeWidgetItem(strings);
ui->firstTreeWidget->addTopLevelItem(parent);
parent ->setIcon(0,QIcon(QString::fromUtf8(":/images/heart.ico")));
QTreeWidgetItem *child = new QTreeWidgetItem;
parent->addChild(child);
ui->firstTreeWidget->setItemWidget(child, 0, new QLineEdit(ui->firstTreeWidget));
}
Icon is not setting . Is there any problem in the code