Nepomuk
#include <Nepomuk/Utils/FacetWidget>
Public Slots | |
void | addFacet (Nepomuk::Utils::Facet *facet) |
void | clear () |
void | setFacets (const QList< Nepomuk::Utils::Facet * > &facets) |
Signals | |
void | queryTermChanged (const Nepomuk::Query::Term &term) |
Public Member Functions | |
FacetWidget (QWidget *parent=0) | |
~FacetWidget () | |
Nepomuk::Query::Query | extractFacetsFromQuery (const Nepomuk::Query::Query &query) |
QList< Facet * > | facets () const |
Nepomuk::Query::Term | queryTerm () const |
void | setClientQuery (const Nepomuk::Query::Query &query) |
Detailed Description
A widget providing a list of facets to add filters to a query.
The basic usage of FacetWidget is rather simple: create a new instance, add facets to it through the addFacet() method, connect to the queryTermChanged() signal, and wait for the user to change the filters.
More sophisticated usage involves extractFacetsFromTerm() or setClientQuery(). For more details see the documentation of FacetModel which provides a similar API since FacetWidget is using it internally.
- Since
- 4.6
Definition at line 57 of file facetwidget.h.
Constructor & Destructor Documentation
Nepomuk::Utils::FacetWidget::FacetWidget | ( | QWidget * | parent = 0 | ) |
Create a new empty FacetWidget.
Nepomuk::Utils::FacetWidget::~FacetWidget | ( | ) |
Destructor.
Member Function Documentation
|
slot |
Add facet
to the widget.
Used to populate the widget with facets. Ownership of facet
is transferred to the widget.
|
slot |
Remove all facets from the widget.
Nepomuk::Query::Query Nepomuk::Utils::FacetWidget::extractFacetsFromQuery | ( | const Nepomuk::Query::Query & | query | ) |
Extract as many facets from a query as possible.
This method is not able to handle all kinds of queries but works well on queries created via queryTerm().
Facets supported by this widget will be extracted from term
and configured accordingly.
- See also
- FacetModel::extractFacetsFromTerm()
- Returns
- The rest term after facets have been extracted.
QList<Facet*> Nepomuk::Utils::FacetWidget::facets | ( | ) | const |
- Returns
- All Facet instances added via addFacet() and setFacets().
Nepomuk::Query::Term Nepomuk::Utils::FacetWidget::queryTerm | ( | ) | const |
- Returns
- the query term composed by the facets
|
signal |
Emitted whenever the facets change, i.e.
when the user changes the selection or it is changed programmatically via extractFacetsFromQuery()
void Nepomuk::Utils::FacetWidget::setClientQuery | ( | const Nepomuk::Query::Query & | query | ) |
Can be used to set the full query the client is using (this includes facets created through this widget).
It allows the facet system to disable certain choices that would not change the result set or do not make sense otherwise.
- See also
- FacetModel::setClientQuery()
|
slot |
Set facets
as the list of facets used in this widget.
Used to populate the widget with facets. Ownership of the facets is transferred to the widget.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.