Thanks for reply
here are some code I have used for desplaying data in Treewidget from database.
QSqlquery query;
query.prepare("select DeviceName from Devices" );
if(query.exec())
{
ui->treeWidget_Device->setColumnCount(1);
QList<QTreeWidgetItem *> items;
for (int i = 0; i < 10; ++i) // here I have confusion about list numbers. y list is verx big and will be added more
my query in here
ui->treeWidget_Device->insertTopLevelItems(0, items);
}
QSqlquery query;
query.prepare("select DeviceName from Devices" );
if(query.exec())
{
ui->treeWidget_Device->setColumnCount(1);
QList<QTreeWidgetItem *> items;
for (int i = 0; i < 10; ++i) // here I have confusion about list numbers. y list is verx big and will be added more
item.append(new QTreeWidgetItem((QTreeWidget*)0, QString("item: %1").arg(i))); //this is an example with simple string but I want to show
my query in here
ui->treeWidget_Device->insertTopLevelItems(0, items);
}
To copy to clipboard, switch view to plain text mode
hope these code will be enough to understand my difficulty...
looking for your advice..
Thanks
Bookmarks