-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Get rid of getexistingdirectory and patch QFileDialog? #26
Comments
I have no problem with that. I think the current approach worked for versions older than PyQt 4.6, but they are ancient now. PR coming? |
Yep, coming soon ;-) |
It won't be retrocompatible, will it be qtpy 2.0 then ? |
Both will work, utils will be deprecated On 2.0 we remove, which gives time for migration :) |
I mean if people used QFileDialog directly, the behavior may change ? But we are still the main user, I guess. |
Ahh true, hmm will have to explore that :-p, |
Making this change would make QFileDialog different from the Qt docs, because it will return a tuple instead of just a string. So we either
Either way we do need to switch to 2.x |
I switched most of my apps to qtpy and it works great. Swithching QFileDialog methods was a bit more painful because the method names were lowercase instead of keeping the Qt case. |
@Nodd you are alive :-) |
@goanpeca Barely ! 😉 |
I personally think that qtpy should not patch the imported Qt objects. The rationale is the same as I already expressed in #119 : side effects for people not even using qtpy should be avoided at all costs. |
@ccordoba12 is this still relevant? |
I don't understand what this issue is about exactly, sorry. |
@ccordoba12 I'm not a Qt expert like either of you, but looking at the code, seems like its about replacing the QtPy custom compatibility wrappers around the various QFileDialog static helper methods (included in this section of compat.py, that smooth over binding/platform-specific rough edges in those methods, with just monkeypatching them in the original As a sidenote, the current method names (all lowercase) follow neither the Qt camelCase nor the Python snake_case convention, and are much harder to read than either. For QtPy 2.0, a shift to one or the other (with the old names as deprecated aliases) might not be a bad idea. |
I'm not totally sure about monkeypathing but providing names to this functions following the Qt camelCase convention seems like a good idea |
Great, thanks. Since its a pretty straightforward change, I can help with that part, if you like and we all agree on that approach. |
Sure go ahead 👍 |
If we're renaming and aliasing these functions anyway, we might want to consider moving the renamed functions to their own module (and keeping the old names as deprecated aliases in FWIW, while I would of course defer to your and @ccordoba12 's expertise given your much deeper Qt experience, at least to my naive eye it seems the stability and compatibility impact discussed by @cpascual here and on #119 , and the rationale on mottosso/Qt.py#224 , outweighs the relatively modest inconvenience this seems to be aimed at addressing (as I understand it), especially with the renamed methods matching those in Qt itself. |
Thinking about it I don't think patching is a good idea but lets check this after v2.0.0 |
You still want me to go ahead with the aliases, right? Since we're renaming them anyway, what are your thoughts above moving them to a more specific submodule than the catchall |
Lets leave it as it is for the moment |
Okay, so not aliasing them at all, or not moving them to a different module but still aliasing them as you told me before? |
What I mean to say is to not spend more time in this one, so yep not even checking the aliasing. Seems like this is not critical at the moment and we need to carefully think if we are going to do something either patching or doing aliases to follow the camelCase convention. For me seems like this is more likely to be closed, so no patching. For the aliasing I was thinking and maybe the idea behind putting such function in neither camelCase or snake_case is to be clear that it is a helper function and is not present in Qt itself |
Well, if it being thin compatibility wrappers (not actually helpers) around existing Qt methods instead of the originals isn't already clear from it being imported and accessed from |
I liked the approach of py.qode better cause it did not relly on helper functions, but instead it patched QFileDialog to get the correct behavior.
We could do the same and get rid of the helper functions.
@ccordoba12 ?
The text was updated successfully, but these errors were encountered: