Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Controls Custom
Forum Updated to NodeBB v4.3 + New Features

QML Controls Custom

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 226 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    romain.donze
    wrote on last edited by
    #1

    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 to header and footer? Because when debugging with the QML Profiler, I can see that the header declared in the base CustomPage is always created, despite the fact that I use another one higher in my component hierarchy.

    1 Reply Last reply
    1

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved