A Property object represents a context property, i.e., a key-value pair. More...
#include <ContextProvider>
Signals | |
void | firstSubscriberAppeared (const QString &key) |
This is emitted when the first subscriber appears for this Property. | |
void | lastSubscriberDisappeared (const QString &key) |
This is emitted when the last subscriber disappears for this Property. | |
Public Member Functions | |
Property (Service &service, const QString &key, QObject *parent=0) | |
Create a Property object on service for the key k. | |
Property (const QString &key, QObject *parent=0) | |
Create a Property object on the default service for the key k. | |
virtual | ~Property () |
Destructor. | |
QString | key () const |
Returns the name of the key this Property represents. | |
bool | isSet () const |
Returns true if the key is set (it's value is determined). | |
void | setValue (const QVariant &v) |
Sets the property value to QVariant v. | |
QVariant | value () |
Returns the current value of the property. | |
void | unsetValue () |
Unsets the value. |
A Property object represents a context property, i.e., a key-value pair.
Every Property object is associated with a Service object. If you delete the Service object, the associated Property objects will turn invalid and you should not use them.
ContextProvider::Property::Property | ( | Service & | service, | |
const QString & | key, | |||
QObject * | parent = 0 | |||
) | [explicit] |
Create a Property object on service for the key k.
ContextProvider::Property::Property | ( | const QString & | k, | |
QObject * | parent = 0 | |||
) | [explicit] |
Create a Property object on the default service for the key k.
The default service can be set with Service::setAsDefault().
ContextProvider::Property::~Property | ( | ) | [virtual] |
Destructor.
void ContextProvider::Property::firstSubscriberAppeared | ( | const QString & | key | ) | [signal] |
bool ContextProvider::Property::isSet | ( | ) | const |
Returns true if the key is set (it's value is determined).
QString ContextProvider::Property::key | ( | ) | const |
Returns the name of the key this Property represents.
void ContextProvider::Property::lastSubscriberDisappeared | ( | const QString & | key | ) | [signal] |
void ContextProvider::Property::setValue | ( | const QVariant & | v | ) |
Sets the property value to QVariant v.
void ContextProvider::Property::unsetValue | ( | ) |
Unsets the value.
This is equivalent to setting it to a null QVariant.
QVariant ContextProvider::Property::value | ( | ) |
Returns the current value of the property.
The returned QVariant is invalid if the key value is undetermined or the Property is invalid.