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. How to replace the default property in qt quick?
Forum Updated to NodeBB v4.3 + New Features

How to replace the default property in qt quick?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qt quickqt 5qml
1 Posts 1 Posters 630 Views
  • 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.
  • A Offline
    A Offline
    Accelerated
    wrote on 7 Apr 2016, 08:52 last edited by
    #1

    Hi everyone,
    I want to replace the property like header&ToolBar.
    For example, there is a property in ApplicationWindow called header. It can be replaced by ToolBar. like this:

    ApplicationWindow {
        visible:true
    
      header: ToolBar {
          RowLayout {
              anchors.fill: parent
              Item { Layout.fillWidth: true }
              Switch {
                  checked: true
                  text: qsTr("Notifications")
             }
          }
       }
    }
    

    The new ToolBar replace the ApplicationWindow‘s header, and it always at the top of ApplicationWindow.

    And now, i have some codes:

    Bar{
        id: titleBar
        property alias title: titleText
        //left controls
    
        property Item leftControls:
            ControlsList{
            parent: titleBar
            anchors.left: parent.left
            anchors.verticalCenter: parent.verticalCenter
        }
    
        //right controls
        property Item rightControls:
            ControlsList{
                parent: titleBar
                anchors.right: parent.right
                anchors.verticalCenter: parent.verticalCenter
        }
    

    How could i replace the leftControls or rightControls and don't change their layout? (。・・)ノ

    1 Reply Last reply
    0

    1/1

    7 Apr 2016, 08:52

    • Login

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