-
Notifications
You must be signed in to change notification settings - Fork 252
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
PyQt5 uses directory
instead of dir
for members of QFileDialog
#321
Comments
@jasperges Are you sure? It seems to only use Or is this old documentation? Edit: Also the PyQt5 documentation doesn't state that as a change from PyQt4 at all, interestingly enough. And this just points to the C++ documentation that lists the same Seems like someone over-refactored the code and left it undocumented? :) |
Me and Jasper chatted about this prior to making an issue out of it, and decided it wasn't worth handling through Qt.py. Initially we thought of making a QtCompat member. QtCompat.getOpenFilename() But there are quite a few of these static members that are presumably all wrong (in PyQt) that we would need to add and I'd like to avoid having too much of anyone's code being calls to The other option is "fixing" the original calls, like we've done by forwarding things from Qt 4's QtGui to QtWidgets for example. That would be the ideal option, as it would mean code you write with PySide also works in PyQt and vice versa. It just isn't clear how complex that would be, but a pull-request is welcome. And for completeness, the "correct" one would be |
|
In all bindings you have the keyword argument
dir
for members ofQFileDialog
, but in PyQt5 it isdirectory
(personally I think it's better because it doesn't redefine a built-in). For exampleQFileDialog.getOpenFilename(dir="/home/me")
would beQFileDialog.getOpenFileName(directory="/home/me")
in PyQt5.I have no idea how difficult this would be, but personally I think the best solution would be that you can use either
dir
ordirectory
. If that would be impractical, I would suggestdir
because that is used by the majority of bindings.The text was updated successfully, but these errors were encountered: