digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::TagProperties Class Reference

Public Member Functions

 TagProperties ()
 This class provides a wrapper over the Database methods to access the properties of a tag.
 
 TagProperties (const TagProperties &other)
 
 TagProperties (int tagId)
 Access the properties of the given tag.
 
void addProperty (const QString &key, const QString &value)
 Adds the given property.
 
bool hasProperty (const QString &key) const
 Returns true if the property is set.
 
bool hasProperty (const QString &key, const QString &value) const
 Returns true if the property is set, with exactly the given value.
 
bool isNull () const
 
TagPropertiesoperator= (const TagProperties &other)
 
QMultiMap< QString, QString > properties () const
 Returns a map of all key->value pairs.
 
QStringList propertyKeys () const
 Returns all set property keys.
 
void removeProperties (const QString &key)
 Remove all occurrences of the property.
 
void removeProperty (const QString &key, const QString &value)
 Remove the given property/value.
 
void setProperty (const QString &key, const QString &value)
 Set the given property. Replaces all previous occurrences of this property.
 
int tagId () const
 
QString value (const QString &key) const
 Returns the value of the given property.
 

Static Public Member Functions

static TagProperties getOrCreate (const QString &tagPath)
 Finds the tag for the given tag path or creates a new tag.
 

Constructor & Destructor Documentation

◆ TagProperties()

Digikam::TagProperties::TagProperties ( )

It is meant to be a short-lived object, it does not listen to external database changes.

Member Function Documentation

◆ addProperty()

void Digikam::TagProperties::addProperty ( const QString &  key,
const QString &  value 
)

Does not change any previous occurrences of this property, allowing multiple properties with the same key.

◆ getOrCreate()

TagProperties Digikam::TagProperties::getOrCreate ( const QString &  tagPath)
static

Then returns the tag properties for this tag.

◆ value()

QString Digikam::TagProperties::value ( const QString &  key) const

If the property is not set, a null string is returned. But a null string is also returned if the property is set, but without a value. Use hasProperty to check that case.