News for hackers. Stuff that matters.
Re:Qt 6.6 and 6.7 Make QML Faster Than Ever: A New Benchmark... by JanisErdmanis on Tuesday December 19, 2023 @08:29AM (#38695254)
Can you elaborate on “recipe for tears”?
Re:Qt 6.6 and 6.7 Make QML Faster Than Ever: A New Benchmark... by saidinesh5 on Tuesday December 19, 2023 @08:43AM (#38695413)
The imperative parts of QML is javascript. So lack of type safety in larger apps can start getting really annoying, especially once the code base starts to age and not all corners of the code base gets tested every day.

Other than that, beginners to the codebase tend to break property bindings without realizing. There are a few tools to catch this at runtime, but would be nice to do this at compile time.

Also not all of the "Desktop widgets" were readily available in QML in Qt 5 (not sure what the status in Qt 6), and you tend to roll your own Table Views etc.. and those ones need even more work to work like native widgets, supporting keyboard navigation etc...

Overall Qt5/QML was fun to work with, but I did miss a few bits that were readily available on QWidgets.

Re:Qt 6.6 and 6.7 Make QML Faster Than Ever: A New Benchmark... by JanisErdmanis on Tuesday December 19, 2023 @09:13AM (#38695692)
I agree. Lack of typing in JavaScript is a hassle.
Re:Qt 6.6 and 6.7 Make QML Faster Than Ever: A New Benchmark... by ognarb on Tuesday December 19, 2023 @08:39AM (#38695361)
Not OP, but QML is not a great language to put more logic than simple bindings and functions like

    Button {
        text: "Save"
        enabled: textField.text.length > 0 // this is reactive to the value of a TextField
        onClicked: Backend.save()
    }
as soon as you try to for example implement the save method in JS/QML this starts to become very painful as it often ends up with a lot of spaghetti code. The very cool thing with QML is that the save function can be simply implemented in C++ like this.

    Backend::save()
    {
        // call QFile/QNetworkRequest/...
    }
It force the programmer to split their logic from the UI layer which I don't consider a bad thing.
Re:Qt 6.6 and 6.7 Make QML Faster Than Ever: A New Benchmark... by JanisErdmanis on Tuesday December 19, 2023 @08:53AM (#38695515)
It is also possible to have a backend implemented in JS in similar way. Though I personally only have used in intial UI prototype which I latter swapped with Julia backend.
Re:Qt 6.6 and 6.7 Make QML Faster Than Ever: A New Benchmark... by notyoutube on Tuesday December 19, 2023 @09:13AM (#38695697)
I'm curious about julia as a gui language: mind sharing your code/project?
Re:Qt 6.6 and 6.7 Make QML Faster Than Ever: A New Benchmark... by JanisErdmanis on Tuesday December 19, 2023 @09:29AM (#38695904)
I have developed/prototyped a voting client with QML/Julia in PeaceFounderClient [1]. Few weeks ago I made bundling setup for it and have published bundles [2]. This may not scale well but I opted for bridging the backend with frontend in top scope with Bridge.qml [3] which on the Julia side is loaded with ‘loadqml’ using ‘QML.jl’ pacakge [4].

[1]: https://github.com/PeaceFounder/PeaceFounderClient/tree/main

[2]: https://github.com/PeaceFounder/PeaceFounderClient/releases

[3]: https://github.com/PeaceFounder/PeaceFounderClient/blob/main...

[4]: https://github.com/PeaceFounder/PeaceFounderClient/blob/cf9d...

Re:Qt 6.6 and 6.7 Make QML Faster Than Ever: A New Benchmark... by notyoutube on Tuesday December 19, 2023 @09:47AM (#38696148)
And an interesting project to boot! Thanks for sharing
Re:Qt 6.6 and 6.7 Make QML Faster Than Ever: A New Benchmark... by sircastor on Tuesday December 19, 2023 @04:15PM (#38701692)
It was basically this - and to be clear this is not a shortcoming of QML. As you said, splitting the logic layer from the UI is a good idea - but the choice for us to be building apps in QML without a logic layer under it required a lot of weird solutions that could've been easily addressed if we'd been doing C++ and Qt. But our team were Javascript developers, the team we were partnering with were Qt devs, and someone had negotiated this solution and we did the work.