Kirigami-addons

ContentItemLoader.qml
1/*
2 * Copyright 2022 Devin Lin <devin@kde.org>
3 * SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5
6import QtQuick
7
8/**
9 * Simple component to easily implement embed QML components without using QQC2.Control.
10 */
11Item {
12 id: root
13 property var contentItem: Item {}
14
15 onContentItemChanged: {
16 // clear old items
17 root.children = "";
18
19 if (contentItem instanceof Item) {
20 contentItem.parent = root;
21 contentItem.anchors.fill = root;
22 root.children.push(contentItem);
23 }
24 }
25}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.