Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open_file return empty #42

Open
whu-lyh opened this issue Jul 19, 2020 · 4 comments
Open

open_file return empty #42

whu-lyh opened this issue Jul 19, 2020 · 4 comments

Comments

@whu-lyh
Copy link

whu-lyh commented Jul 19, 2020

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?

@samhocevar
Copy link
Owner

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

@whu-lyh
Copy link
Author

whu-lyh commented Sep 7, 2020

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

@samhocevar
Copy link
Owner

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.

@whu-lyh
Copy link
Author

whu-lyh commented Sep 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants