Published:

Jarle Aase

Monthly update, January 2024

bookmark 1 min read

Projects

In January, nextapp got my full attention.

Mysqlpool

When I started to work with boost.mysql in the nextapp backend, it soon became clear that it is quite low level (like boost.beast is for http). So one of the first tings I implemented was a connection pool on top of boost.mysql. It was quite small and very convenient to use. It became clear to me that it did not belong in Nextapp! The connection pool solved a general problem that I probably will need solved in other, future projects. So one of the last things I did in January was to move the code out to its own project: mysqlpool-cpp.

Next-app

Working with QT and QML is slow, at least for me. It's not something I have worked with a lot in the past, and using it in a desktop application is actually a lot of pain.

The common user interface controls like trees and lists are there, but just like starting points for your own code. If you want to select an item in a tree or list, you must deal with that yourself in code, from tracking the selected item, to visually showing that it is in fat selected.

In nextapp, data is centered around a tree of "folders", which each can have stuff attached to them, like actions. It took some time to get the tree right in QT C++ (model) and QML (view). But now it works beautifully, as a MVC thing, where the controller is in the back-end. So if I have multiple instance of the application running, I can add things to the tree in one instance and immediately see the changes in all the other instances. This is of course quite basic functionality in a multi-device app like nextapp. I may use the app both on my phone, and on several PC's and laptops simultaneously. Still, it was cool to see it working for the first time ;)

I am a bit worried about how to deal with large number of actions in the QML ListView's. It doesn't look like QT support a view into a list of potentially tens of thousands of actions (that will occur if you want to scroll over done items after just a few years or daily use). You can fill the view with more data as the user scrolls down, but the model is supposed to remember all the items loaded so far. I probably need to display something like "Loading..." for items the user scrolls up to, if the model has released the memory for those items and need to re-fetch them from the backend. But this is a worry for the future. Right now I'm trying to make a MVP for the end of 1st quarter 2024.