2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2017-09-25 09:38:08 +00:00
|
|
|
|
2020-03-26 16:01:51 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
2017-09-25 09:38:08 +00:00
|
|
|
|
|
|
|
Frame {
|
|
|
|
id: container
|
|
|
|
|
|
|
|
property var controlMetaObject
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: exampleLayout
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: !exampleLoader.active ? qsTr("Show example") : qsTr("Hide example")
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: exampleLoader.active = !exampleLoader.active
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: exampleLoader
|
|
|
|
active: false
|
|
|
|
sourceComponent: controlMetaObject ? controlMetaObject.exampleComponent : null
|
|
|
|
|
|
|
|
Layout.preferredHeight: active ? item.implicitHeight : 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|