If it's a non-release build that seems fine, but do you have a way to disable this in release builds? Even if the object doesn't show, since QML may be loaded dynamically, having these scattered around could slow your app.
I still remember optimizing customer code bases that suffered from horrible startup performance because they instantiated thousands of debug rects unconditionally all the time...
Yeah and in QML you can wrap this in a loader but even if it's disabled I could see potential problems there.