• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Nepomuk

  • Nepomuk
  • Utils
  • FacetWidget
Public Slots | Signals | Public Member Functions | List of all members
Nepomuk::Utils::FacetWidget Class Reference
The Facet API

#include <Nepomuk/Utils/FacetWidget>

Inheritance diagram for Nepomuk::Utils::FacetWidget:
Inheritance graph
[legend]

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.

Author
Oszkar Ambrus aoszk.nosp@m.ar@g.nosp@m.mail..nosp@m.com, Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org
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

void Nepomuk::Utils::FacetWidget::addFacet ( Nepomuk::Utils::Facet *  facet)
slot

Add facet to the widget.

Used to populate the widget with facets. Ownership of facet is transferred to the widget.

void Nepomuk::Utils::FacetWidget::clear ( )
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
void Nepomuk::Utils::FacetWidget::queryTermChanged ( const Nepomuk::Query::Term &  term)
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()
void Nepomuk::Utils::FacetWidget::setFacets ( const QList< Nepomuk::Utils::Facet * > &  facets)
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:
  • facetwidget.h
This file is part of the KDE documentation.
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.

Nepomuk

Skip menu "Nepomuk"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal