Guest User

Untitled

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