Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QContentProperties Class Reference
[QtBaseModule]

The QContentProperties class allows the meta-data stored in content to be read and edited. More...

    #include <QContentProperties>

This class is under development and is subject to change.

Public Functions


Detailed Description

The QContentProperties class allows the meta-data stored in content to be read and edited.

Many content formats include meta-data fields which are used to store descriptive information about the content. QContentProperties provides an interface to access these properties directly in a generic manner.

Properties are identified by string keys, for any given content a list of keys which have associated values can be queried using the keys() function, and a list of all possible keys for the content can be gained from the supportedKeys() function. Common properties are documented in the QContent::Property enumeration.

Unlike QContent::property() and QContent::setProperty() QContentProperties accesses data embedded in the content itself and not the database which means the changes will be persisted wherever the content is moved. Any properties normally extracted by the content system will be updated in the database as well. Note the reverse does not occur, changing a property in the database with QContent::setProperty() will not modify properties embedded in the content.

See also QContent::Property, QContent::propertyKey(), QContent::property(), and QContent::setProperty().


Member Function Documentation

QContentProperties::QContentProperties ( const QContent & content )

Constructs a new content properties editor.

QContentProperties::~QContentProperties ()

Destroys a content properities editor.

bool QContentProperties::contains ( const QString & key ) const

Returns true if the content contains a property for the given key, and false otherwise.

QContent QContentProperties::content () const

Returns the content whose properties are being accessed.

bool QContentProperties::isReadOnly () const

Returns true if the content properties are read-only. Properties may be read-only because the underlying file is read-only or the plug-in doesn't support writing properties.

QStringList QContentProperties::keys () const

Returns a list of all the keys the content has properties for.

bool QContentProperties::remove ( const QString & key )

Removes the property with the given key from the content. Returns true if the property was removed and false otherwise.

bool QContentProperties::setValue ( const QString & key, const QVariant & value )

Sets the value of the content property identified by key to value. Returns true if the value was assigned and false otherwise.

See also value().

QStringList QContentProperties::supportedKeys () const

Returns a list of all property keys explicitly supported for the content's type. If arbitrary strings keys are supported this will return an empty list.

QVariant QContentProperties::value ( const QString & key, const QVariant & defaultValue = QVariant() ) const

Returns the value of the content property identified by key. If the content doesn't contain the property defaultValue is returned instead.

See also setValue().


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3