mottosso / Qt.py

Minimal Python 2 & 3 shim around all Qt bindings - PySide, PySide2, PyQt4 and PyQt5.
MIT License
896 stars 252 forks source link

add QProxyStyle #406

Closed robertjoosten closed 1 month ago

robertjoosten commented 1 month ago

Previously unable to access QProxyStyle as it was not mapped.

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

robertjoosten commented 1 month ago

i needed to test to see if it worked for the other bindings as well which I see it doesn't. Does this go against the commonality of all Qt versions or is there a way to slot it in?

mottosso commented 1 month ago

Does this go against the commonality of all Qt versions or is there a way to slot it in?

Yes unfortunately this won't work. It would mean you could write a UI with Qt.py, and sometimes it would work, sometimes it would not. Based on what bindings the user would have available. It's important that if it works at all, it should work on all bindings, and PySide2 is still the source of truth for what exists and where.

mottosso commented 1 month ago

For completeness, the recommended workflow for when you have binding-specific requirements is to explicitly include these, e.g.

import Qt

try:
   from PySide6.QtCore import QProxyStyle
   CAN_PROXY_STYLE = True
except ImportError:
   CAN_PROXY_STYLE = False

And thus you can design your code to take this into account.