KFileMetaData 5.109.0
Public Member Functions | Static Public Member Functions | List of all members
KFileMetaData::PropertyInfo

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.
 
PropertyInfooperator= (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.
 

Detailed Description

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.

Member Function Documentation

◆ allNames()

static QStringList KFileMetaData::PropertyInfo::allNames ( )
static

Get all supported property names.

Since
6.0

◆ displayName()

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.

◆ formatAsDisplayString()

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.

Since
5.56

◆ fromName()

static PropertyInfo KFileMetaData::PropertyInfo::fromName ( const QString &  name)
static

Construct a PropertyInfo from the internal property name.

The internal property name is case insensitive

◆ name()

QString KFileMetaData::PropertyInfo::name ( ) const

The internal unique name used to refer to the property.

◆ property()

Property::Property KFileMetaData::PropertyInfo::property ( ) const

The enumeration which represents this property.

◆ shouldBeIndexed()

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.

◆ valueType()

QVariant::Type KFileMetaData::PropertyInfo::valueType ( ) const

The type the value of this property should be.

Eg - Property::Height should be an integer