QML Controls Custom
-
Hi everyone,
I have a question regarding the customization of Controls in QtQuick, more specifically a
Page.
In the documentation here, under Avoid assigning an id to styles' implementations of item delegates, it states:"This technique relies on the absence of an id in the style's implementation of that item. If an id is assigned, the technique cannot work, and both items will be created. For example, it can be tempting to assign an id to the background or contentItem so that other objects within the file can refer to those items:"
I fully understand this code example and try to apply it as much as possible in my custom Controls:
T.Button { // ... background: Rectangle { id: backgroundRect // ... } contentItem: Text { // Use backgroundRect in some way... } // ... }However, my issue arises when customizing a QML
Page(which inherits from Controls). Does this technique also apply toheaderandfooter? Because when debugging with the QML Profiler, I can see that theheaderdeclared in the baseCustomPageis always created, despite the fact that I use another one higher in my component hierarchy.