KFileMetaData 5.109.0
|
The PropertyInfo class can be used to obtain extra information about any property. More...
#include <KFileMetaData/PropertyInfo>
Public Member Functions | |
PropertyInfo (const PropertyInfo &pi) | |
PropertyInfo (Property::Property property) | |
QString | displayName () const |
A user visible name of the property. | |
QString | formatAsDisplayString (const QVariant &value) const |
Returns the value of the property as a QString with added formatting, added units if needed, and translated enums. | |
QString | name () const |
The internal unique name used to refer to the property. | |
PropertyInfo & | operator= (const PropertyInfo &rhs) |
bool | operator== (const PropertyInfo &rhs) const |
Property::Property | property () const |
The enumeration which represents this property. | |
bool | shouldBeIndexed () const |
Indicates if this property requires indexing or should just be stored. | |
QVariant::Type | valueType () const |
The type the value of this property should be. | |
Static Public Member Functions | |
static QStringList | allNames () |
Get all supported property names. | |
static PropertyInfo | fromName (const QString &name) |
Construct a PropertyInfo from the internal property name. | |
The PropertyInfo class can be used to obtain extra information about any property.
It is commonly used be indexers in order to obtain a translatable name of the property along with additional information such as if the property should be indexed.
|
static |
Get all supported property names.
QString KFileMetaData::PropertyInfo::displayName | ( | ) | const |
A user visible name of the property.
Note: When the displayName for a given property is used repeatedly the returned value should be cached, as calling this method is fairly expensive, as the returned name is localized.
QString KFileMetaData::PropertyInfo::formatAsDisplayString | ( | const QVariant & | value | ) | const |
Returns the value of the property as a QString with added formatting, added units if needed, and translated enums.
|
static |
Construct a PropertyInfo from the internal property name.
The internal property name is case insensitive
QString KFileMetaData::PropertyInfo::name | ( | ) | const |
The internal unique name used to refer to the property.
Property::Property KFileMetaData::PropertyInfo::property | ( | ) | const |
The enumeration which represents this property.
bool KFileMetaData::PropertyInfo::shouldBeIndexed | ( | ) | const |
Indicates if this property requires indexing or should just be stored.
Eg - Property::Height does not need to be part of the global index. When a user searches for 600, they should not get images with that height
This is just a recommendation.
QVariant::Type KFileMetaData::PropertyInfo::valueType | ( | ) | const |
The type the value of this property should be.
Eg - Property::Height should be an integer