samhocevar / portable-file-dialogs

💬 Portable GUI dialogs library, C++11, single-header

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

open_file return empty

whu-lyh opened this issue · 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?

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

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

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.

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