Qt Code:
  1. iconmodel->setQuery("SELECT `PictureForButtonMode` FROM `dictionary` WHERE `PictureForButtonMode` LIKE '%.%'");
  2.  
  3. while(iconmodel->query().next())
  4. {
  5. QString buttonFV = iconmodel->query().value(0).toString(); // = String = image file name
  6.  
  7. foreach(...) // is this possible ?
  8. {
  9. // The code below works when not in this foreach statement
  10. QString bttnPath = QApplication::applicationDirPath();
  11. bttnPath = "/home/dev/ttm/directory/icon/" + buttonFV;
  12.  
  13. stylesheet += "QListView { show-decoration-selected: 0; border:transparent; color: white; background: transparent ; }";
  14. stylesheet += "QListView::text { padding-right: 300px; }";
  15. stylesheet += "QListView::item {image: url(" +bttnPath + "); width: 135px; height: 207px; }";
  16.  
  17. iListView->setStyleSheet(stylesheet);
  18. }
To copy to clipboard, switch view to plain text mode 

this code works without the foreach but im getting the first image for each item and its using the same image for all of them

what im trying to do is for each string assign the string filename to the item.... still cant get it working properly ...