#include <searchquery.h>

Public Member Functions

 SearchQuery (SearchTerm::Relation rel=SearchTerm::RelAnd)
 SearchQuery (const SearchQuery &other)
void addTerm (const QString &key, const QVariant &value, SearchTerm::Condition condition=SearchTerm::CondEqual)
void addTerm (const SearchTerm &term)
bool isNull () const
int limit () const
SearchQueryoperator= (const SearchQuery &other)
bool operator== (const SearchQuery &other) const
void setLimit (int limit)
void setTerm (const SearchTerm &term)
SearchTerm term () const
QByteArray toJSON () const

Static Public Member Functions

static SearchQuery fromJSON (const QByteArray &json)

Detailed Description

A query that can be passed to ItemSearchJob or others.


Definition at line 115 of file searchquery.h.

Constructor & Destructor Documentation

SearchQuery::SearchQuery ( SearchTerm::Relation  rel = SearchTerm::RelAnd)

Constructs query where all added terms will be in given relation.

Definition at line 175 of file searchquery.cpp.

Member Function Documentation

void SearchQuery::addTerm ( const QString key,
const QVariant value,
SearchTerm::Condition  condition = SearchTerm::CondEqual 

Adds a new term.

Definition at line 211 of file searchquery.cpp.

void SearchQuery::addTerm ( const SearchTerm term)

Adds a new term with subterms.

Definition at line 216 of file searchquery.cpp.

int SearchQuery::limit ( ) const

Returns the maximum number of results.

The default value is -1, indicating no limit.

Definition at line 231 of file searchquery.cpp.

void SearchQuery::setLimit ( int  limit)

Sets the maximum number of results.

Note that this limit is only evaluated per search backend, so the total number of results retrieved may be larger.

Definition at line 226 of file searchquery.cpp.

void SearchQuery::setTerm ( const SearchTerm term)

Sets the root term.

Definition at line 221 of file searchquery.cpp.

SearchTerm SearchQuery::term ( ) const

Returns the root term.

Definition at line 206 of file searchquery.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Sep 20 2020 23:16:20 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.