Widgets
You can create Widgets via the build in wizard:
Widgets are custom QML files which gets executed via the ScreenPlayWidget app. You can learn more about how to develop your widget in qml (even without prior programming skill!) via the fantastic qml book.
Simple interactive button example
Try this code in your browser!
import QtQuick 2.14
import QtQuick.Controls 2.14
Item {
id:root
anchors.fill:parent
Rectangle {
color: "#333333"
width:300
height:300
opacity: 0.5
anchors.centerIn: parent
Button {
id:txtHello
text: qsTr("Hello")
anchors.centerIn: parent
onClicked:{
txtHello.text = "Hello Clicked"
}
}
}
}
Sysinfo to display hardware stats
Just import the SysInfo project in the beginning of your QML file:
import ScreenPlay.Sysinfo 1.0
Example:
import QtQuick 2.14
import QtQuick.Controls 2.14
import ScreenPlay.Sysinfo 1.0
Item {
id:root
anchors.fill: parent
Rectangle {
color: "white"
text: "My CPU Usage: " + SysInfo.cpu.usage
anchors.centerIn: parent
}
}
// CPU
- SysInfo.cpu.usage
- SysInfo.cpu.tickRate //Update every second
// RAM
- SysInfo.ram.usage
- SysInfo.ram.usedPhysicalMemory
- SysInfo.ram.totalPhysicalMemory
- SysInfo.ram.usedVirtualMemory
- SysInfo.ram.totalVirtualMemory
- SysInfo.ram.usedPagingMemory
- SysInfo.ram.totalPagingMemory
// Storage (list model)
// These variables are available for every listed storage device
- name
- displayName
- isReadOnly
- isReady
- isRoot
- isValid
- bytesAvailable
- bytesTotal
- bytesFree
- fileSystemType
Examples:
Sysinfo platform support
Feature | Windows | Linux | MacOS |
---|---|---|---|
CPU | ✔ | ❌ | ❌ |
RAM | ✔ | ❌ | ❌ |
Storage | ✔ | ✔ | ✔ |
Network | ❌ | ❌ | ❌ |
GPU | ❌ | ❌ | ❌ |
Custom C++ Logic
You can add custom QML plugins in the root folder of your widget. These then get automatically loaded at startup.
Last update:
February 26, 2021 11:10:36