Hacker News new | ask | show | jobs
by tored 1523 days ago
A while back I worked on a Qt 5 code base and a another with QML.

I would say I prefer QML over that other Qt GUI Framework, mostly because you can leverage JavaScript for fast development, but not that fond of the the GUI part of QML, but it is still better than the Qt GUI Framework because of better customization.

I found it difficult to adapt and style many of the standard widgets in the Qt GUI framework, like item lists and similar things.

It is sort of easy to expose "dumb" C++ functions from Qt to be used from QML's JavaScript and then you put all the GUI logic in JavaScript instead.

Qt makes the C++ easier with their own copy-on-write containers for the most common things you need, however the extra qmake build step is somewhat horrible and when you need to ship your application you run some command line tool that copies a bunch of dlls that you still need to sort out manually. And when all is done you have big zip file anyway.

But would I use Qt again? No, even if we ignore the licensing issues.

I'm not interested in writing GUI desktop applications in C++, it just too clunky (still with C++20) and does not fit a fast iterative approach (at least not for me) even with all Qt containers. And of course compiling C++ is not fun especially when you add an extra qmake step. (And now I see that Qt 6 has switched to CMake, oh lord, I truly dislike CMake, the main reason why I stopped using CLion)

If I remember correctly there was some complaints of lack of documentation for the Qt Python bindings, that you basically need to read the C++ code and then figure it out, but that can have changed.

If I want native widgets I write that in PureBasic, PureBasic is way faster to develop in than C++ or even C. I have instant compilation of my project on press of button out of the box. No asinine build step that I spend hours to configure.

And for QML I think there are better options. One that I'm in the beginning of building is with Sciter(HTML/CSS/JS) with a custom backend in PureBasic.

Nice thing with Sciter is that you can easily bind it to any language you prefer as long as you can load a dynamic library(dll/so/dylib) (I think if you have a license you can compile it against C headers). It exist many different bindings, C/C++ of course, Pascal, golang, rust, python, .NET, D.

Or you can just go with app bundle that Sciter ships and don't have custom backend at all (all depending on what you are trying to build of course). Sciter is not a browser either like electron, so it doesn't have the same resource impact.

1 comments

> PureBasic

Would you elaborate how do you program GUIs in PureBasic? I noticed there are multiple ways to do that: positioning each gadget manually, coding XML, using visual GUI designer, more?

Also, how are things on macOS? They mention full Cocoa coverage in the documentation.

> positioning each gadget manually, coding XML, using visual GUI designer

Yes, I have only done manual position. My programs are not that big yet. Some gadgets are not always feature complete, thus sometimes you need to write custom code (like for special events) for each platform or use a canvas. Drawback with canvas is that you need to write it dpi aware thus making it a bit more complex.

GUI for Windows is the old Windows look (win32), not the new modern one.

That is why I was bit excited with a Sciter integration, now you have the possibility to write complex GUI ("modern") with Sciter and classic GUI with PureBasic or a combination.

XML layout, there is some critique against it not being DPI perfect. You can read about it in this thread

https://www.purebasic.fr/english/viewtopic.php?t=71146

Form Designer - popular but to my understanding starts showing some limitations when you start getting multiple windows (handling of identifiers of windows/gadgets). And if the form designer has a default that you can't change then of course you need to change that value manually every time you update your form by the form designer.

To my knowledge there exist two commercial alternative to the built in form designer, PureVision (old) and IceDesign (new).

macOS - I'm not a mac user so I can't tell, but I do know there is frequent mac discussions on the forum. There have been some excitement around the new coming PureBasic 6 release with a new C backend, making it possible to compile to native code for the M1 processor.