Advertisement
Guest User

Untitled

a guest
May 31st, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. QSqlquery query;
  2. query.prepare("select DeviceName from Devices" );
  3.  
  4. if(query.exec())
  5. {
  6. ui->treeWidget_Device->setColumnCount(1);
  7.  
  8. QList<QTreeWidgetItem *> items;
  9.  
  10. for (int i = 0; i < 10; ++i) // here I have confusion about list numbers. my
  11. //list is verx big and will be added more
  12.  
  13. item.append(new QTreeWidgetItem((QTreeWidget*)0, QString("item:%1").arg(i))); //this is an example with simple string but
  14. // I want to show my query in here
  15. ui->treeWidget_Device->insertTopLevelItems(0, items);
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement