News for hackers. Stuff that matters.
Re:A Book about Qt5 by mattigames on Sunday March 03, 2019 @07:18PM (#19297851)
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.
Re:A Book about Qt5 by rolleiflex on Sunday March 03, 2019 @08:00PM (#19298034)
Same 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.

Re:A Book about Qt5 by mgreenleaf on Monday March 04, 2019 @05:00AM (#19300069)
PySide2 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?

Re:A Book about Qt5 by toyg on Monday March 04, 2019 @06:38AM (#19300489)
PyInstaller 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.

Re:A Book about Qt5 by qwerty456127 on Sunday March 03, 2019 @11:30PM (#19298788)
Indeed 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.

Re:A Book about Qt5 by pjmlp on Monday March 04, 2019 @02:07AM (#19299368)
They are now investing into Python as official supported language.

https://www.qt.io/qt-for-python

Re:A Book about Qt5 by mk89 on Monday March 04, 2019 @04:21AM (#19299895)
Well, 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.
Re:A Book about Qt5 by fbender on Monday March 04, 2019 @05:43AM (#19300247)
WxWidgets 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.
Re:A Book about Qt5 by makapuf on Monday March 04, 2019 @03:47AM (#19299748)
Regarding Go / Browser interaction sI've stumbled on two libs : https://github.com/zserge/lorca to integrate chrome as a UI (smaller than electron apparently) and https://github.com/zserge/webview (not tested myself and the second one is rewritten currently)
Re:A Book about Qt5 by rolleiflex on Monday March 04, 2019 @04:46AM (#19300011)
I 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 and here's the source code: https://github.com/nehbit/aether.
Re:A Book about Qt5 by jancsika on Sunday March 03, 2019 @10:58PM (#19298660)
> the differences between what QtDesigner showed and the actual output

I'd like to read some examples of that.

Re:A Book about Qt5 by mattigames on Monday March 04, 2019 @12:40AM (#19299063)
Yeah 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.
Re:A Book about Qt5 by dman on Sunday March 03, 2019 @10:20PM (#19298534)
Could you elaborate a bit on the compile times? Python is an interpreted language, so am surprised to see that as a pain point.
Re:A Book about Qt5 by mattigames on Monday March 04, 2019 @12:32AM (#19299018)
I 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.
Re:A Book about Qt5 by blattimwind on Monday March 04, 2019 @04:55AM (#19300048)
You never had to do that. You can load Qt Designer XML files at runtime with neglible performance impact.
Re:A Book about Qt5 by toyg on Monday March 04, 2019 @06:41AM (#19300496)
I 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.

Re:A Book about Qt5 by blattimwind on Monday March 04, 2019 @11:06AM (#19302252)
Good 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.
Re:A Book about Qt5 by amelius on Monday March 04, 2019 @02:35AM (#19299467)
Not to mention the expensive licenses for both pyqt and qt itself.
Re:A Book about Qt5 by wjoe on Monday March 04, 2019 @09:23AM (#19301416)
PyQt5 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.

Re:A Book about Qt5 by marioflach on Monday March 04, 2019 @03:58AM (#19299799)
Qt is licensed under the LGPL. Same goes for PySide.
Re:A Book about Qt5 by amelius on Monday March 04, 2019 @04:02AM (#19299817)
Yes, I'm talking about use of qt in a closed-source commercial product.
Re:A Book about Qt5 by q3k on Monday March 04, 2019 @04:05AM (#19299827)
You 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