QtMobility Reference Documentation

QLandmarkAttributeFilter Class Reference

The QLandmarkAttributeFilter class provides filtering on various landmark attributes. More...

 #include <QLandmarkAttributeFilter>

Inherits: QLandmarkFilter.

This class was introduced in Qt Mobility 1.1.

Public Types

enum OperationType { AndOperation, OrOperation }

Public Functions

QLandmarkAttributeFilter ()
QLandmarkAttributeFilter ( const QLandmarkFilter & other )
virtual ~QLandmarkAttributeFilter ()
QVariant attribute ( const QString & key ) const
QStringList attributeKeys () 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, QLandmarkFilter::MatchFlags flags = 0 )
void setAttributes ( const QStringList & keys, const QVariant & value, QLandmarkFilter::MatchFlags flags = 0 )
void setOperationType ( OperationType operationType )

Detailed Description

The QLandmarkAttributeFilter class provides filtering on various landmark attributes.

You can provide various keys which describe the attribute(s) to search. Precisely which keys may be used depends on the manager and these can be retrieved by using QLandmarkManager::searchableLandmarkAttributeKeys(). The table below outlines some keys that may be used with the default managers on the currently supported platforms. The match flags may be used for attributes which are of string type (typically most, if not all searchable attributes are string types).

Searchable attributes
"city""country"countryCode"
"county""description""district"
"name""state""phoneNumber"
"postcode""street"

Please note that different platforms support different capabilities with the attribute filter.

  • The S60 3.1, 3.2 and 5.0 platforms do not support an OR type attribute filter.
  • The S60 3.1, 3.2, 5.0 and Symbian platforms do not support the MatchContains flag.
  • The S60 3.1, 3.2, 5.0 and Symbian platforms do not support multiple attributes with an AND type attribute filter(using a single attribute however is supported).

Member Type Documentation

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.

This function was introduced in Qt Mobility 1.1.

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.

This function was introduced in Qt Mobility 1.1.

See also setAttribute().

QStringList QLandmarkAttributeFilter::attributeKeys () const

Returns the keys of all attributes set in the filter.

This function was introduced in Qt Mobility 1.1.

void QLandmarkAttributeFilter::clearAttributes ()

Clears all attributes from the filter.

This function was introduced in Qt Mobility 1.1.

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.

This function was introduced in Qt Mobility 1.1.

OperationType QLandmarkAttributeFilter::operationType () const

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

This function was introduced in Qt Mobility 1.1.

See also setOperationType().

void QLandmarkAttributeFilter::removeAttribute ( const QString & key )

Removes the attribute corresponding to key from the filter.

This function was introduced in Qt Mobility 1.1.

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

Sets the value of the attribute corresponding to key.

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. The beahviour of the filter is undefined if an invalid QVariant is used as a value

This function was introduced in Qt Mobility 1.1.

See also attribute().

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

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

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. The behaviour of the filter is undefined if an invalid QVariant is used as value.

This function was introduced in Qt Mobility 1.1.

void QLandmarkAttributeFilter::setOperationType ( OperationType operationType )

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

This function was introduced in Qt Mobility 1.1.

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.