6 ms·
I still remember the amount of pain I went with trying to use Qt5 on python, the compile errors, the compile times, the differences between what QtDesigner show
by mattigames 8y ago
I still remember the amount of pain I went with trying to use Qt5 on python, the compile errors, the compile times, the differences between what QtDesigner showed and the actual output, made me appreciate CSS and SASS a lot more.
- rolleiflex 8y agoSame here. I designed and built the first version of Aether with Qt5 via Python. It was a miserable experience where the only way to solve certain things were to insert non-meaningful text into certain magic Python fields which would go and compile in C++. Plus a few hundred iterations of getting the magic incantations to work in a consistent manner. For the second version — I've moved to Electron for UI and Go binaries for actual heavy lifting. At least that one is a known pain you can Google for.
- qwerty456127 8y agoIndeed lack of a good (Tkinter just doesn't offer all the necessary widgets, looks and feels clumsy) modern pythonic GUI toolkit seems the biggest problem of Python to me. Nevertheless I'm surprised to read you had to compile anything (if you don't mean using pyuic5 to generate Python classes from QtDesigner XML files) and deal with C++ while using Qt5 with Python.
- pjmlp 8y agoThey are now investing into Python as official supported language. https://www.qt.io/qt-for-python https://www.qt.io/qt-for-python
- mk89 8y agoWell, it was about time. Pyside is a quite old project that for a while almost seemed to have fallen into oblivion. Glad to see that they are finally using it as official binding tool.
- fbender 8y agoWxWidgets is now available & stable(!) for Py3 and available on PyPI for easy installation & distribution. Moreso, the dev pipeline has been streamlined and they are now able to follow upstream much more closely! Maybe this is sth for you.
- makapuf 8y agoRegarding Go / Browser interaction sI've stumbled on two libs : https://github.com/zserge/lorca https://github.com/zserge/lorca to integrate chrome as a UI (smaller than electron apparently) and https://github.com/zserge/webview https://github.com/zserge/webview (not tested myself and the second one is rewritten currently)
- rolleiflex 8y agoI just run Go binaries and talk to them using gRPC. As a real world example on how to do that, here's my app: https://getaether.net https://getaether.net and here's the source code: https://github.com/nehbit/aether https://github.com/nehbit/aether.
- mgreenleaf 8y agoPySide2 makes this way easier. I recently setup a PySide2 Project in PyCharm with the integrated package-management and it was a breeze (I guess the official support helps a lot as opposed to PySide[1]). First tried several other graphical libraries and was getting nowhere, but was happy that the Qt integration was relatively painless. On a related note, does anyone know of a way of creating a "stand-alone binary" or installer for PySide2?
- toyg 8y agoPyInstaller and cx_freeze both work with PyQt, afaik, so they probably work with pyside too. There is also some other project (fsmb? Something like that) that is focused towards packaging pyqt apps, but it requires you to adopt its framework.
- dman 8y agoCould you elaborate a bit on the compile times? Python is an interpreted language, so am surprised to see that as a pain point.
- mattigames 8y agoI don't remember the specifics, I remember that after designing the UI files on QtDesigner you had to compile some files that python consumes, some sort of bindings to the interface you created.
- deleted 8y ago[deleted]
- blattimwind 8y agoYou never had to do that. You can load Qt Designer XML files at runtime with neglible performance impact.
- toyg 8y agoI still like to use pyuic so that the IDE will pick up the generated file and suggest widget names while you’re editing the subclass. Otherwise you’re a bit blind. It’s trivial to add pyuic as an external tool in most iDEs anyway.
- blattimwind 8y agoGood point, though I personally don't work through self.ui but rather prefer loading into the class itself. Then I just put type annotations of the widgets in the class.
- jancsika 8y ago> the differences between what QtDesigner showed and the actual output I'd like to read some examples of that.
- mattigames 8y agoYeah I rather not thinker with it again, maybe someone else has some idea why that happens; I remember being something about the text looking centered on the editor then not so on the generated bindings.
- amelius 8y agoNot to mention the expensive licenses for both pyqt and qt itself.
- marioflach 8y agoQt is licensed under the LGPL. Same goes for PySide.
- amelius 8y agoYes, I'm talking about use of qt in a closed-source commercial product.
- q3k 8y agoYou can ship a closed-source product with LGPL licensed libraries like PySide/PyQt as long as you respect the license (most difficult part to comply with is relinkability by the user if you're shipping with static libs) [1]. [1] - https://www.qt.io/faq/#_Toc_3_7 https://www.qt.io/faq/#_Toc_3_7
- wjoe 8y agoPyQt5 is GPL licensed. Not expensive, but perhaps not suitable for your closed source project. There is also a commercial license available, probably that is expensive. PySide2 is LGPL licensed, so more likely to be suitable for you, since it can be used without having to provide the source of your application. Both libraries serve the same purpose of providing Qt5 bindings for Python in slightly different ways. PySide2 has become officially supported by Qt recently, and has generally been the preferred option for closed source development due to the licensing.