KFileMetaData::PropertyInfo Class
class KFileMetaData::PropertyInfoThe PropertyInfo class can be used to obtain extra information about any property. More...
Header: | #include <KFileMetaData/PropertyInfo> |
CMake: | find_package(KF6 REQUIRED COMPONENTS FileMetaData) target_link_libraries(mytarget PRIVATE KF6::FileMetaData) |
Public Functions
PropertyInfo() | |
PropertyInfo(KFileMetaData::Property::Property property) | |
QString | displayName() const |
(since 5.56) QString | formatAsDisplayString(const QVariant &value) const |
QString | name() const |
KFileMetaData::Property::Property | property() const |
bool | shouldBeIndexed() const |
QMetaType::Type | valueType() const |
bool | operator==(const KFileMetaData::PropertyInfo &rhs) const |
Static Public Members
Detailed Description
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.
Member Function Documentation
PropertyInfo::PropertyInfo()
PropertyInfo::PropertyInfo(KFileMetaData::Property::Property property)
[static, since 5.107]
QStringList PropertyInfo::allNames()
Get the names of all valid, supported properties
Note: Property::Empty is not considered a valid property.
This function was introduced in 5.107.
QString 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.
[since 5.56]
QString 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.
This function was introduced in 5.56.
[static]
KFileMetaData::PropertyInfo PropertyInfo::fromName(const QString &name)
Construct a PropertyInfo from the internal property name. The internal property name is case insensitive
QString PropertyInfo::name() const
The internal unique name used to refer to the property
KFileMetaData::Property::Property PropertyInfo::property() const
The enumeration which represents this property
bool 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.
QMetaType::Type PropertyInfo::valueType() const
The type the value of this property should be. Eg - Property::Height should be an integer