You can do the same thing in C++. I had the impression you wanted to do that in QML