Hacker News new | ask | show | jobs
by rms25 2977 days ago
Having used QML in the past, its made the most sense to me out of all the UI/Animation setups I have ever used. This sounds amazing
1 comments

I've used it a fair bit and it gets very messy very quickly. It pretty much encourages spaghetti code.

Also it is very incomplete. For example there's no way to do custom widgets that draw text (e.g. a graph). There's no good text area widget (there is one but it is extremely limited - you couldn't use it for a log output for example).

Plain QtWidgets is way way better on every level except animation and styling. And maybe touch support.

But if I were making a mobile app I'd definitely use Flutter. Much nicer experience than QML.

It definitely can get messy, but there are some very easy ways to keep your project well structured.

1. Refactor out to separate components a lot.

2. Use the .ui.qml and .qml code behind pattern to separate UI from code.

3. Use singleton QtObjects to create abstract classes that contain any non-UX behavior.

As for graphing, the built in components work pretty well:

https://doc.qt.io/qt-5.10/qtcharts-index.html

As far as QML widgets go, they have improved greatly since they released Quick Controls 2 (a rewrite of the initial set of controls).

https://doc.qt.io/qt-5.10/qtquickcontrols2-index.html

Unlike most of Qt, QtCharts is GPL, not LGPL. You can't avoid the virality by dynamic linking.