Warning, /libraries/kcgroups/tests/main.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2020 Henri Chain <henri.chain@enioka.com> 0002 // SPDX-FileCopyrightText: 2020 Kevin Ottens <kevin.ottens@enioka.com> 0003 // 0004 // SPDX-License-Identifier: LGPL-2.1-or-later 0005 0006 import QtQuick 2.0 0007 import QtQuick.Controls 2.0 0008 0009 ListView { 0010 width: parent && parent.width > 1000 ? parent.width : 1000 0011 height: parent && parent.height > 600 ? parent.height : 600 0012 model: appList 0013 delegate: Rectangle { 0014 id: rect 0015 anchors.left: parent.left 0016 anchors.right: parent.right 0017 height: 60 0018 color: index % 2 ? "lightblue": "lightgreen" 0019 0020 Text { 0021 id: indexText 0022 anchors.left: rect.left 0023 anchors.verticalCenter: rect.verticalCenter 0024 anchors.leftMargin: 10 0025 text: index 0026 width: 50 0027 } 0028 0029 CheckBox { 0030 id: quotaCheckBox 0031 anchors.left: indexText.right 0032 anchors.verticalCenter: rect.verticalCenter 0033 checked: object.cpuQuota.hasValue 0034 onToggled: object.cpuQuota.value = checked ? quotaSlider.value : undefined 0035 } 0036 0037 Slider { 0038 id: quotaSlider 0039 anchors.left: quotaCheckBox.right 0040 anchors.verticalCenter: rect.verticalCenter 0041 width: 200 0042 anchors.leftMargin: 10 0043 from: 0 0044 to: 1000000 0045 value: object.cpuQuota.hasValue ? object.cpuQuota.value : 1000000 0046 onMoved: object.cpuQuota.value = value 0047 enabled: object.cpuQuota.hasValue 0048 } 0049 0050 Text { 0051 id: quotaText 0052 anchors.left: quotaSlider.right 0053 anchors.verticalCenter: rect.verticalCenter 0054 text: object.cpuQuota.hasValue ? `${Math.round(object.cpuQuota.value/10000)}%` : "no quota" 0055 horizontalAlignment: Text.AlignRight 0056 width: 70 0057 } 0058 0059 Button { 0060 id: killButton 0061 anchors.left: quotaText.right 0062 anchors.verticalCenter: rect.verticalCenter 0063 anchors.leftMargin: 20 0064 onClicked: object.stop() 0065 text: "stop" 0066 width: 50 0067 } 0068 0069 Text { 0070 id: displayText 0071 anchors.left: killButton.right 0072 anchors.top: rect.top 0073 anchors.topMargin: 10 0074 anchors.leftMargin: 20 0075 text: display 0076 } 0077 0078 Text { 0079 id: desktopNameText 0080 anchors.left: killButton.right 0081 anchors.bottom: rect.bottom 0082 anchors.bottomMargin: 10 0083 anchors.leftMargin: 20 0084 text: object.desktopName 0085 horizontalAlignment: Text.AlignRight 0086 } 0087 0088 Text { 0089 id: instanceText 0090 anchors.left: displayText.right 0091 anchors.right: rect.right 0092 anchors.bottom: rect.bottom 0093 anchors.bottomMargin: 10 0094 anchors.rightMargin: 20 0095 text: object.instance 0096 horizontalAlignment: Text.AlignRight 0097 font.family: "monospace" 0098 } 0099 } 0100 }