0
votes

I am using QFileDialog::getOpenFileName to open file dialog which give me the path of selected file.

Strange Behavior

This is working on

  • MAC debug build
  • Win debug build
  • Win release build

Not Working on

  • Mac Release build : returns empty string as filename

my code is

QString qResult = QFileDialog::getOpenFileName(parent, qCaption, qDefaultPath, qFilter, &qSelectedFilter);

i checked for

  1. parent : Valid pointer
  2. pCation : valid string and caption is showing correctly
  3. qDefaultPath : valid path and exists on machine, checked using QDir(qDefaultPath).exists()
  4. qFilter working fine
  5. qSelectedFilter : seems fine

can anyone give me idea ? why is it happening ? or any alternative ? please help this regards

Qt Version is 4.8.5

1
Try latest Qt 4.8 - 4.8.5 was release way before Mac OS X Yosemite. blog.qt.io/blog/2015/05/26/qt-4-8-7-released - Kamil Klimek

1 Answers

2
votes

Does updating your Qt version a possible solution ? The most recent revision in 4.8 branch is 4.8.7. The release note for that version says:

Better support for running Qt 4.8 applications on Mac OS X 10.10 Yosemite

and the release note for 4.8.6 says

Better support for Mac OS X 10.9 Mavericks

so there is a good chance your issue is fixed with the latest revision.