portable-file-dialogs icon indicating copy to clipboard operation
portable-file-dialogs copied to clipboard

open_file return empty

Open whu-lyh opened this issue 4 years ago • 4 comments

Hi, thank you for your amazing code. I try to implement a simply file dialog to selected multi designed suffix( under vs2013 and qt), but i found that the file vector(f.result ()) returns empty. So i wander whether where might be some incompatible with qt?

whu-lyh avatar Jul 19 '20 01:07 whu-lyh

I am not aware of any incompatibilities with Qt. Can you maybe show some code?

samhocevar avatar Sep 04 '20 13:09 samhocevar

std::string title = "File Selection";
std::string defaultpath = std::string (InputFileFolderPath.toLocal8Bit ());
auto f = portableDialog::open_file (title, defaultpath,
	       { "(.txt .Post *.PosT .txtEst)", "*.txt *.Post *.PosT *.txtEst","All files", "*.*" },
		portableDialog::opt::multiselect);

It's simple just like the examples shown in your code, and the f is return empty. I don't know why this happens. I just try to replace the original QT5's file selection with portable-file-dialogs. Thanks

whu-lyh avatar Sep 07 '20 06:09 whu-lyh

Thanks for the additional information. Does the system open a file dialog when you run that code? If so, can you tell whether it’s Zenity, or Kdialog, or something else?

I also suggest calling portableDialog::settings::verbose(true); and see whether anything interesting is reported in stdout.

samhocevar avatar Sep 07 '20 10:09 samhocevar

Yeah, the file dialog is opened, And i tried the latest version of pfd , the open_file somehow works. Another question: how can the select_folder to select multi folders while pressing the CTRL button? Thanks

whu-lyh avatar Sep 07 '20 13:09 whu-lyh