default property alias xxx 应用

 

ArchInterface.qml

Control {

  id: content

  default property alias contentChildren: content.data    // 内部的元素, 由子模块去实现

  backgroud: Rectangle {

    color: "transparent"

    anchor.fill: parent

  }

}

 

应用:

AppModule.qml

  Item {

    ArchInterface {

      Rectangle {

        id: firstChild

      }

 

      Rectangle {

        id: secondChild

      }

 

      Rectangle {

        id: thirdChild

      }

    }

  }

posted @ 2023-09-25 12:49  HenryLiuY  阅读(12)  评论(0编辑  收藏  举报