Hi there guys, my program has a function that imports a picture into the program. this function works fine when i run it on my machine (i.e. the machine I used to write the program) but when I package the program with all the dll to run it on a different machine then all of a sudden QFileDialog::getOpenFileName does not return the file path in that machine. here is my code below.
Qt Code:
  1. void MainWindow::on_actionOpen_triggered()
  2. {
  3. QString file = QFileDialog::getOpenFileName(this, "Import Picture", "/home", tr("Images (*.jpg *.png *.xpm)"));
  4.  
  5. photo = new Picture(QRectF(201,225,152,200));
  6.  
  7. if(!file.isEmpty()){
  8. photo->setParentItem(pagesList.at(pageIterator));
  9. photo->setPicDir(file);
  10. photo->setPainterID(1);
  11.  
  12. for(int i = 0; i < 4; i++){
  13. QModelIndex index = photoModel->index(i, 0, QModelIndex());
  14. item = new QStandardItem();
  15. QPixmap pic(file);
  16. item->setData(pic, Qt::DecorationRole);
  17. photoModel->setData(index, pic, Qt::DecorationRole);
  18. }
  19. }
  20. }
To copy to clipboard, switch view to plain text mode