qasync doesn't support pyqt6 yet and I'm trying to run discord.py in the same loop as pyqt but so far I'm not doing the best. I've tried multiprocess, multithread, and even running synchronous code from non-synchronous code but I either end up with blocking code that makes the pyqt program non responsive or it just outright doesn't work. Can somebody please point me in the right direction?
-
1Why don't you use PyQt5 or PySide2 or PySide6 until qasync supports PyQt6?eyllanesc– eyllanesc2021-08-23 20:45:55 +00:00Commented Aug 23, 2021 at 20:45
-
before I realized I would need it I created my program with pyqt6, And porting it to pyqt5 has been a little rough. I'd need to recreate my program which wouldn't be ideal :/Lino– Lino2021-08-23 20:47:34 +00:00Commented Aug 23, 2021 at 20:47
-
@Lino right now PyQt6 has little differences from 5, and unless you're using specific new features added in Qt6 the only big difference is the usage of Enums. Also, AFAIK, if you use a recent version of PySide2, the problem doesn't present at all, since it already supports that naming pattern. For [very] future reference, always check for supported features when dealing with major versions that are pretty new: Qt6 has been released less than 9 months ago (which is not a lot for a huge toolkit like Qt is), and many features of Qt5 have been temporarily removed until they're considered mature.musicamante– musicamante2021-08-23 21:36:01 +00:00Commented Aug 23, 2021 at 21:36
Add a comment
|
2 Answers
qasync does not currently support PyQt6 but I have created a PR that implements it.
At the moment you can install my version of qasync using the following command:
pip install git+https://github.com/eyllanesc/qasync.git@PyQt6
Probably in future releases my PR will be accepted so there will already be support for PyQt6
They already accepted my PR so you can already install the latest version of qasync that has support for PyQt6.
Comments
os.environ.setdefault("QT_API", "PyQt6")
from asyncqt import QEventLoop
1 Comment
Jeremy Caney
Remember that Stack Overflow isn't just intended to solve the immediate problem, but also to help future readers find solutions to similar problems, which requires understanding the underlying code. This is especially important for members of our community who are beginners, and not familiar with the syntax. Given that, can you edit your answer to include an explanation of what you're doing and why you believe it is the best approach?