Qt Mobility Reference Documentation

QLandmarkAttributeFilter Class Reference

The QLandmarkAttributeFilter class provides filtering based on generic landmark attributes. More...

 #include <QLandmarkAttributeFilter>

Inherits QLandmarkFilter.


Public Types

enum AttributeType { ManagerAttributes, CustomAttributes }
enum OperationType { AndOperation, OrOperation }

Public Functions

QLandmarkAttributeFilter ()
QLandmarkAttributeFilter ( const QLandmarkFilter & other )
virtual ~QLandmarkAttributeFilter ()
QVariant attribute ( const QString & key ) const
QStringList attributeKeys () const
AttributeType attributeType () const
void clearAttributes ()
QLandmarkFilter::MatchFlags matchFlags ( const QString & key ) const
OperationType operationType () const
void removeAttribute ( const QString & key )
void setAttribute ( const QString & key, const QVariant & value = QVariant(), QLandmarkFilter::MatchFlags flags = 0 )
void setAttributeType ( AttributeType attributeType )
void setAttributes ( const QStringList & keys, const QVariant & value = QVariant(), QLandmarkFilter::MatchFlags flags = 0 )
void setOperationType ( OperationType operationType )

Detailed Description

The QLandmarkAttributeFilter class provides filtering based on generic landmark attributes.

The QLandmarkAttributeFilter class may be used to filter landmarks whose attributes match certain values. If an invalid QVariant is provided as the value for an attribute, then any landmark that has that attribute is considered a match, regardless of its value. More than one attribute may be set in the filter and may be combined using an AND or OR operation. The filter may only be used to search through either manager attributes (ie. common cross platform attributes and extended attributes specific to a manager) or custom attributes.


Member Type Documentation

enum QLandmarkAttributeFilter::AttributeType

Defines type of landmark attributes this filter operates on.

ConstantValueDescription
QLandmarkAttributeFilter::ManagerAttributes0The filter operates on standard cross platform attributes and extended attributes.
QLandmarkAttributeFilter::CustomAttributes1The filter operates on custom attributes.

enum QLandmarkAttributeFilter::OperationType

Defines how the attribute criteria are combined if more than one attribute is defined.

ConstantValueDescription
QLandmarkAttributeFilter::AndOperation0Landmarks must match all the attributes provided by the filter.
QLandmarkAttributeFilter::OrOperation1Landmarks must match at least one attribute provided by the filter.

Member Function Documentation

QLandmarkAttributeFilter::QLandmarkAttributeFilter ()

Creates an attribute filter.

QLandmarkAttributeFilter::QLandmarkAttributeFilter ( const QLandmarkFilter & other )

Constructs a copy of other if possible, otherwise constructs a new attribute filter.

QLandmarkAttributeFilter::~QLandmarkAttributeFilter () [virtual]

Destroys the filter.

QVariant QLandmarkAttributeFilter::attribute ( const QString & key ) const

Returns the value of the attribute corresponding to key.

If the attribute isn't set an invalid QVariant is returned.

See also setAttribute().

QStringList QLandmarkAttributeFilter::attributeKeys () const

Returns the keys of all attributes set in the filter.

AttributeType QLandmarkAttributeFilter::attributeType () const

Returns the type of attribute this filter will operate on.

See also setAttributeType().

void QLandmarkAttributeFilter::clearAttributes ()

Clears all attributes from the filter.

QLandmarkFilter::MatchFlags QLandmarkAttributeFilter::matchFlags ( const QString & key ) const

Returns the match flags for a particular key. The match flags are only take into consideration when the attribute for a particular key is a string. In all other cases the match flags are ignored.

OperationType QLandmarkAttributeFilter::operationType () const

Returns the operation to be used by the filter when multiple attributes are provided.

See also setOperationType().

void QLandmarkAttributeFilter::removeAttribute ( const QString & key )

Removes the attribute corresponding to key from the filter.

void QLandmarkAttributeFilter::setAttribute ( const QString & key, const QVariant & value = QVariant(), QLandmarkFilter::MatchFlags flags = 0 )

Sets the value of the attribute corresponding to key.

Setting an invalid QVariant to an attribute means that the filter will match any landmark that has that attribute, regardless of its value. Setting a valid QVariant means that the filter will match only landmarks whose values match that of value. For string based attributes a set of matching flags can be provided to define how the string values should be matched. For non-string based attributes the flags are ignored.

See also attribute().

void QLandmarkAttributeFilter::setAttributeType ( AttributeType attributeType )

Sets the type of attribute this filter will operate on to attributeType.

See also attributeType().

void QLandmarkAttributeFilter::setAttributes ( const QStringList & keys, const QVariant & value = QVariant(), QLandmarkFilter::MatchFlags flags = 0 )

Sets the value of all the attributes correponding to those in keys.

Setting an invalid QVariant to an attribute means that the filter will match any landmark that has that attribute, regardless of its value. Setting a valid QVariant means that the filter will match only landmarks whose values match that of value. For string based attributes a set of matching flags can be provided to define how the string values should be matched. For non-string based attributes the flags are ignored.

void QLandmarkAttributeFilter::setOperationType ( OperationType operationType )

Sets the operation to be used by the filter when multiple attributes are provided to operationType.

See also operationType().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.