Re: Customizing QFileDialog
It's not a bug. The file dialog is simply not meant to be subclassed that way.
Re: Customizing QFileDialog
Quote:
Originally Posted by
wysota
It's not a bug. The file dialog is simply not meant to be subclassed that way.
Ok... What would be a right way to customize file dialog then?
Yet even if I don't subclass QFileDialog using setProxyModel() will probably cause sidebar to fail.
Thanks.
Re: Customizing QFileDialog
I wouldn't say there is any right way to do it. Especially that in 90% of the cases native dialogs are used and not the dialog created by Qt.
Re: Customizing QFileDialog
Is it possible to customize QFileDialog in the way that there is no way to leave a particular (specified) subdirectory? The reason is, I wouldn't like the user to choose the files from ANY directory but from the given ones.
Thanks in advance
Re: Customizing QFileDialog
Re: Customizing QFileDialog
Oh, thanks, I guess, this should work!!
Re: Customizing QFileDialog
Well, this works only partially. Namely, e.g. I wanna stay in the directory /tmp. And click to Up-icon in the QFileDialog window. This generates the signal directoryEntered(const QString), which I can catch up and move back to /tmp. However, the path "/" remains in the history. And then backButton from the QFileDialogPrivate can be used and does not generate the signal. In this way, I can traverse the entire /-tree.
Would appreciate any comments
P.S. clearing histroy also didn't help.
P.P.S changeEvent also doesn't react to back- and forward-buttons. However, it does work on go-up-button
Re: Customizing QFileDialog
Ok, just to tell how I solved the problem:
In the file qfiledialog.cpp in functions
void QFileDialogPrivate::_q_navigateForward()
and
void QFileDialogPrivate::_q_navigateBackward()
after
q->setDirectory(nextHistory);
and
q->setDirectory(previousHistory);
I added
emit q->directoryEntered(nextHistory);
and
emit q->directoryEntered(previousHistory);
respectively.
Recompile -> runs :)
However, I'm not sure, if it's a bug or a feature