Guest User

Untitled

a guest
Oct 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. // filling combobox
  2. QDirIterator path("/home/max/Qt/Converter-build-desktop/img");
  3. QMap <QString, QPixmap> map;
  4. QMap <QString, QPixmap>::iterator it;
  5.  
  6. while(path.hasNext()) // get names of files and make the map
  7. {
  8. QFileInfo pathInfo( path.next() );
  9. map[pathInfo.fileName()] = QPixmap(path.next());
  10. }
  11.  
  12. for(QMap<QString, QPixmap>::iterator it = map.begin(); it != map.end(); ++it)
  13. {
  14. fromCombo->addItem(it.key());
  15. }
Add Comment
Please, Sign In to add comment