CpuStatus QML Type

Provides information on the CPU status. More...

Import Statement: import QtApplicationManager 2.0



Detailed Description

As the name implies, CpuStatus provides information on the status of the CPU. Its property values are updated whenever the method update() is called.

You can use this component as a MonitorModel data source if you want to plot its previous values over time.

import QtQuick 2.11
import QtApplicationManager 2.0
MonitorModel {
    CpuStatus {}

You can also use it alongside a Timer for instance, when you're only interested in its current value.

import QtQuick 2.11
import QtApplicationManager 2.0
CpuStatus { id: cpuStatus }
Timer {
    interval: 500
    running: true
    repeat: true
    onTriggered: cpuStatus.update()
Text {
    property string loadPercent: Number(cpuStatus.cpuLoad * 100).toLocaleString(Qt.locale("en_US"), 'f', 1)
    text: "cpuLoad: " + loadPercent + "%"

Property Documentation

[read-only] cpuCores : int

The number of physical CPU cores that are installed on the system.

[read-only] cpuLoad : real

Holds the overall system's CPU utilization at the point when update() was last called, as a value ranging from 0 (inclusive, completely idle) to 1 (inclusive, fully busy).

See also CpuStatus::update.

[read-only] roleNames : list<string>

Names of the roles provided by CpuStatus when used as a MonitorModel data source.

See also MonitorModel.

Method Documentation


Updates the cpuLoad property.

See also CpuStatus::cpuLoad.

© 2019 Luxoft Sweden AB. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.