8000 Support loading "narrow" data using File->Open Data · Issue #245 · larray-project/larray-editor · GitHub
[go: up one dir, main page]

Skip to content

Support loading "narrow" data using File->Open Data #245

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.

8000

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
gdementen opened this issue Nov 17, 2022 · 2 comments
Open

Support loading "narrow" data using File->Open Data #245

gdementen opened this issue Nov 17, 2022 · 2 comments

Comments

@gdementen
Copy link
Collaborator

We need to add a checkbox in the File dialog or something like that

@gdementen
Copy link
Collaborator Author

This does not seem as simple as I thought, unless we use some trickery.

Apparently, this is not supported anymore since Qt started its push to use system file dialogs where possible (in Qt4 it seems).

The only workaround I read about is to force using Qt builtin dialog instead of the system dialog by setting the QFileDialog::DontUseNativeDialog flag and then add our widget to the FileDialog manually.

Below is some C++ code doing that (from https://www.qtcentre.org/threads/42858-Creating-a-Custom-FileOpen-Dialog)

void FileDialog::addCheckBoxIn() {
    QDialogButtonBox *box = qFindChild<QDialogButtonBox*>(this);
    QBoxLayout *l = qFindChild<QBoxLayout*>(box);
    QCheckBox *toProj = new QCheckBox("To Project:", box);
    l->insertWidget(0, toProj);
}

@gdementen
Copy link
Collaborator Author

Another, uglier but easier solution is to select the file using the normal/system dialog but open a second dialog with options. Or we could open that "options" dialog directly and have the filepath one of the options.

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

No branches or pull requests

1 participant
0