1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-26 04:33:06 +01:00
ScreenPlay/ScreenPlaySysInfo/ram.h
2018-10-26 12:05:23 +02:00

40 lines
661 B
C++

#pragma once
#include <QObject>
#include <QDebug>
class RAM : public QObject {
Q_OBJECT
Q_PROPERTY(float usage READ usage NOTIFY usageChanged)
public:
explicit RAM(QObject* parent = nullptr);
float usage() const
{
return m_usage;
}
signals:
void usageChanged(float usage);
public slots:
void exe(){
qDebug() << "aa";
}
void setUsage(float usage)
{
qWarning("Floating point comparison needs context sanity check");
if (qFuzzyCompare(m_usage, usage))
return;
m_usage = usage;
emit usageChanged(m_usage);
}
private:
float m_usage = 42.0f;
};