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

Set file dialog default directory #3

Open
aspschn opened this issue Dec 28, 2021 · 0 comments
Open

Set file dialog default directory #3

aspschn opened this issue Dec 28, 2021 · 0 comments

Comments

@aspschn
Copy link

aspschn commented Dec 28, 2021

When I click 'Open folder' button, the default directory of file dialog is the same as the executable is located.
However, if this program is intended to be used on Linux, it would be more convenient to point to the usual cursor theme directory such as /usr/share/icons.
This could be achieved with code like this:

QString path = QFileDialog::getExistingDirectory(this, "",
    "/usr/share/icons");

If this program is developed to be cross-platform, this code may cause errors. So it might be a good idea to check if a directory exists before.

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

1 participant