Closed almarklein closed 1 week ago
Out of curiosity is using qtpy that bad?
Out of curiosity is using qtpy that bad?
I think qtpy solves a different problem. We don't really need it because the API that we use of Qt is so small that dealing with the different Qt libs is easily done:
This PR is really to scratch a little itch that in order to run an example in qt (e.g. for testing stuff) we had to write
import PySide # this line is needed so rendercanvas.qt knows what lib to use
from rendercanvas.qt import ...
A small annoyance, to be fair, but it felt inconsistent. With this pr I can just replace the "auto" in rendercanvas.auto
to "pyside6".
For users using the rendercanvas in a Qt app, I'd recommend to just keep using from rendercanvas.qt ...
.
from rendercanvas.pyside6 import RenderCanvas, loop
.When selecting the qt backend via these modules, it can be that
rendercanvas.qt
has already been imported with another qt-lib. That's why we also do a check to make sure it's actually the intended lib being used.