Warning, /plasma/plasma-workspace/libtaskmanager/autotests/data/windows/ManyWindows.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2022 Fushan Wen <qydwhotmail@gmail.com>
0003
0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006
0007 import QtQuick 2.15
0008 import QtQuick.Window 2.15
0009
0010 QtObject {
0011 id: root
0012
0013 /**
0014 * A list containing maps of initial properties
0015 * like [QVariantMap, QVariantMap, ...]
0016 */
0017 required property var windowInitialProperties
0018 property var windowList: []
0019
0020 property Component windowComponent: Component {
0021 Window {
0022 width: 320
0023 height: 240
0024
0025 visible: true
0026 }
0027 }
0028
0029 Component.onCompleted: {
0030 if (!windowInitialProperties.length) {
0031 console.error("Invalid initial properties!")
0032 return;
0033 }
0034
0035 // Create new windows based on given initial properties
0036 windowInitialProperties.forEach(props => {
0037 windowList.push(windowComponent.createObject(root, props));
0038 });
0039 }
0040 }