IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QPlaceSearchResult Class

The QPlaceSearchResult class is the base class for search results.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QPlaceSearchResult Class

Detailed Description

A list of search results can be retrieved from the QPlaceSearchReply after it has successfully completed the request. Common to all search results are the title and icon, which can be used to present the search result to the user.

The intended usage is that depending on the type, the search result can be converted to a more detailed subclass like so:

 
Sélectionnez
if (result.type() == QPlaceSearchResult::PlaceResult) {
    QPlaceResult placeResult = result;
    qDebug() << placeResult.place().name();
    qDebug() << placeResult.place().location().coordinate();
    qDebug() << placeResult.distance();
}

The implementation is handled in such a way that object slicing is not an issue. It is not expected that client applications or backend plugins instantiate a QPlaceSearchResult directly, but rather client applications simply convert to search result subclasses and backend plugins only instantiate subclasses.

See Also

See also QPlaceResult

Member Type Documentation

 

enum QPlaceSearchResult::SearchResultType

Defines the type of search result

Constant

Value

Description

QPlaceSearchResult::UnknownSearchResult

0

The contents of the search result are unknown.

QPlaceSearchResult::PlaceResult

1

The search result contains a place.

QPlaceSearchResult::ProposedSearchResult

2

The search result contains a proposed search which may be relevant.

Member Function Documentation

 

QPlaceSearchResult::QPlaceSearchResult()

Constructs a new search result.

QPlaceSearchResult::QPlaceSearchResult(const QPlaceSearchResult &other)

Constructs a copy of other

[virtual] QPlaceSearchResult::~QPlaceSearchResult()

Destroys the search result.

QPlaceIcon QPlaceSearchResult::icon() const

Returns an icon that can be used to represent the search result.

See Also

See also setIcon()

void QPlaceSearchResult::setIcon(const QPlaceIcon &icon)

Sets the icon of the search result to icon.

See Also

See also icon()

void QPlaceSearchResult::setTitle(const QString &title)

Sets the title of the search result to title.

See Also

See also title()

QString QPlaceSearchResult::title() const

Returns the title of the search result. This string can be used to display the search result to the user.

See Also

See also setTitle()

QPlaceSearchResult::SearchResultType QPlaceSearchResult::type() const

Returns the result type.

bool QPlaceSearchResult::operator!=(const QPlaceSearchResult &other) const

Returns true if other not equal to this search result, otherwise returns false.

QPlaceSearchResult &QPlaceSearchResult::operator=(const QPlaceSearchResult &other)

Assigns other to this search result and returns a reference to this search result.

bool QPlaceSearchResult::operator==(const QPlaceSearchResult &other) const

Returns true if other is equal to this search result, otherwise returns false.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+