Rectangle{} debugging in QML – like printf(), but for QT

# · ✸ 16 · 💬 7 · 10 days ago · raymii.org · jandeboevrie
Recently I've been using a debugging technique in QT/QML that I've decided to name Rectangle debugging, in the same vein as printf() debugging. The Rectangle style of debugging places a semi-transparent rectangle with a border around your element so you can visualize the positioning and see what effect your changes have. I've written about QT / QML before, that article went into signalling and slots, a method to communicate between C++ and QML. The Qt Quick anchoring system allows you to define relationships between the anchor lines of different items. I prefer a dedicated debugger, but it has to be good and integrated in my IDE. CLion has this, Visual Studio has a reasonable one and QT Creator's QML debugger is just bad. For visual elements like in QML, it's harder to debug positioning and relative stuff. Without the rectangle debugging technique, I would probably not have spotted the text being outside of the image. QML mixes markup language with inline JavaScript, which in my case can be helpful when debugging. I often prefer this printf-style debugging in QML due to how bad QT Creator and their QML debugger is.
Rectangle{} debugging in QML – like printf(), but for QT



Archive | Send Feedback | WebAssembly Version (beta)