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

Using a different abstraction layer, includes Qt.py #107

Closed
tobkum opened this issue Sep 14, 2018 · 6 comments
Closed

Using a different abstraction layer, includes Qt.py #107

tobkum opened this issue Sep 14, 2018 · 6 comments
Milestone

Comments

@tobkum
Copy link

tobkum commented Sep 14, 2018

Not really an issue, but probably stupidity on my part - how do I use qdarkstyle when using Qt.py (https://github.com/mottosso/Qt.py) as a wrapper for Qt?
I migrated my project to Qt.py to be more flexible, but am having a hard time with getting the style back.
Thanks!

@dpizetta
Copy link
Collaborator

Hi @tobkum, it should be possible to use.

Using QdarkStyle v3.0
Actually, if you don't matter to add QtPy (not Qt.py) dependence (QDarkStyle v3.0), the style that you get is dependent on it. Both are not bindings, they are abstraction layers if I'm correct, so if you set both (qtpy and Qt.py) to the same binding, e.g., PyQt5, you can use the returned style to set your app. After you import, for example, qtpy.QWidgets, then print all imported packages you will see PyQt5.QWidgets (if you are using this binding).

Using QDarkStyle v2.x
Following the same arguments, you can check the version of binding you are using, then get the style according.

Creating a new option (for version 3.0, preferably)
Another option is to write another option in the QDarkStyle to use Qt.py - it should be also simple, take a look at the code dependencies.

Final thought
The style itself is a string, so it is not dependent of any binding. The real need to use it is to pre-compile and for problems, if mac-os when you need to add some more code.

Can you take a look at the first two options and check if it works? Tks :)

@tobkum
Copy link
Author

tobkum commented Sep 14, 2018

@dpizetta Thanks so much for the suggestions! I'll try it over the weekend and report back :)

@tobkum
Copy link
Author

tobkum commented Sep 21, 2018

I'd like to create a new option for compatibility with Qt.py and submit a PR - is the current head the v3.0 you're talking about or does that reside in an extra repository?

@dpizetta
Copy link
Collaborator

Hum, I think it would be nice to have one more abstraction layer possible, what is your option @ColinDuquesnoy ? The v2 we are just providing bugfixes. New stuff in v3. Tks

@dpizetta dpizetta changed the title using a different wrapper Using a different abstraction layer, includes Qt.py Sep 25, 2018
@ColinDuquesnoy
Copy link
Owner

ColinDuquesnoy commented Oct 8, 2018

I don't think we need to support more shim. It should not matter to client code which shim we're using as long as we clearly documents how the qt binding will be selected (e.g. set the QT_API environment variable). Client code is free to use whatever shim they want as long as they select the same qt binding. Most shim (maybe not Qt.py) support selection via the QT_API environment variable, so setting it once should be enough....

@dpizetta
Copy link
Collaborator

dpizetta commented Oct 8, 2018

So, @tobkum adding my arguments and the @ColinDuquesnoy arguments, it is better we provide theQdarkStyle with QtPy, and since you set both Qt.py and QtPy, your app will run perfectly. Closing this issue. Thank you for your suggestion. We will add some advice for this configuration in the future.

@dpizetta dpizetta closed this as completed Oct 8, 2018
@dpizetta dpizetta added this to the 2.6 milestone Oct 25, 2018
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

3 participants