Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just to note, there are official [1] Python bindings available for Qt and this can usually be installed with `pip install pyside2`.

[1] https://www.qt.io/qt-for-python



These aren't mentioned until the fourth paragraph of this tutorial. :)


We use (and pay for) PyQt5 at work. Do you have experience with both and if so can you comment on any tangible differences?

If possible, I would rather get behind the "official" one since we also already pay for commercial Qt licenses.


Signal connection behaviour seems to be different in PySide2 regarding non-slot receivers.

E.g. this works in PyQt:

    def f(): pass

    signal.connect(f)
    signal.disconnect(f)
But the disconnect fails in PySide2 (RuntimError: not connected). Seems like you have to store the connection object, which is a bit of a PITA because signal.connect() does not return that.


PySide2 is now out of beta?


Yes, it's called "Qt for Python" now


It's still just a "technical preview", but I've been using it for a while and didn't have any problems that weren't caused by me not knowing how Qt works.

Some of the examples in the documentation are still in C++, but it's pretty easy to translate them to Python since the names are the same. (Sometimes painfully so, e.g PySide2.QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff.)


Agreed. I dabbled with Pyside2 recently and it was refreshingly well structured compared to PyQt4, which is what I last used when I built a GUI a few years ago. It looks like the community might finally get behind one, good, open library for Qt5.


> Some of the examples in the documentation are still in C++

If you do anything serious with Qt you'll have to read those anyway, I believe even PyQt stopped "translating" the docs to python. It's easy enough anyway, even for people like me with no real experience of C++.


There are some things that are still missing and I have to pull from the PyQt5 package, but otherwise it's great.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: