propertyinfo.cpp Example File
sensor_explorer/import/propertyinfo.cpp
#include "sensoritem.h"
#include <QtCore/QDebug>
#include <QtSensors>
QPropertyInfo::QPropertyInfo(QObject* parent)
: QObject(parent)
, _index(0)
, _isWriteable(false)
, _name("")
, _typeName("")
, _value("")
{}
QPropertyInfo::QPropertyInfo(const QString& name, int index, bool writeable, const QString& typeName, const QString& value, QObject* parent)
: QObject(parent)
, _index(index)
, _isWriteable(writeable)
, _name(name)
, _typeName(typeName)
, _value(value)
{}
QString QPropertyInfo::name()
{
return _name;
}
QString QPropertyInfo::typeName()
{
return _typeName;
}
QString QPropertyInfo::value()
{
return _value;
}
void QPropertyInfo::setValue(const QString& value)
{
if (value != _value){
_value = value;
emit valueChanged();
}
}
int QPropertyInfo::index()
{
return _index;
}
bool QPropertyInfo::isWriteable()
{
return _isWriteable;
}