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. imbed a custom control's child into an inner component of the control
Forum Updated to NodeBB v4.3 + New Features

imbed a custom control's child into an inner component of the control

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qml binding
4 Posts 3 Posters 584 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.
  • L Offline
    L Offline
    lawrence.emke
    wrote on 6 Aug 2020, 18:34 last edited by
    #1
    This post is deleted!
    J 1 Reply Last reply 7 Aug 2020, 04:33
    0
    • L lawrence.emke
      6 Aug 2020, 18:34

      This post is deleted!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 7 Aug 2020, 04:33 last edited by
      #2

      @lawrence-emke I'm not sure I understand your description. But nothing stops you from setting one of the "one of the children of the custom control" as parent in the user embedded control.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • G Online
        G Online
        GrecKo
        Qt Champions 2018
        wrote on 7 Aug 2020, 07:58 last edited by
        #3

        What you want is a default alias property :

        CustomControl.qml:

        Column {
            default property alias innerColumnData: innerColumn.data
            property alias title: label.text    
            Label {
                id: label
            }
            Column {
                id: innerColumn
            }
        }
        

        usage:

        CustomControl {
            title: "Firstname"
            TextField {} // text field will be put as a child of innerColumn, (equivalent to innerColumnData: TextField {})
        }
        
        L 1 Reply Last reply 8 Aug 2020, 01:51
        1
        • G GrecKo
          7 Aug 2020, 07:58

          What you want is a default alias property :

          CustomControl.qml:

          Column {
              default property alias innerColumnData: innerColumn.data
              property alias title: label.text    
              Label {
                  id: label
              }
              Column {
                  id: innerColumn
              }
          }
          

          usage:

          CustomControl {
              title: "Firstname"
              TextField {} // text field will be put as a child of innerColumn, (equivalent to innerColumnData: TextField {})
          }
          
          L Offline
          L Offline
          lawrence.emke
          wrote on 8 Aug 2020, 01:51 last edited by lawrence.emke 8 Aug 2020, 01:52
          #4
          This post is deleted!
          1 Reply Last reply
          0

          1/4

          6 Aug 2020, 18:34

          • Login

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