Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QCategoryFilter class allows consistent filtering of records or objects that have a set of categories assigned. More...
#include <QCategoryFilter>
The QCategoryFilter class allows consistent filtering of records or objects that have a set of categories assigned.
QCategoryFilter is used to represent selected categories. Unlike a list of category ids, QCategoryFilter handles the All and Unfiled cases so it allows unambiguous behaviour when new categories are added to the system. It is most useful when filtering items by category to create a QCategoryFilter and use the accepted() function.
See also Categories.
Constant | Value | Description |
---|---|---|
QCategoryFilter::List | 0 | Only accepts category sets that contain all of the required categories. |
QCategoryFilter::Unfiled | 1 | Only accepts empty category sets. |
QCategoryFilter::All | 2 | Accepts all category sets. |
Constructs a QCategoryFilter object. By default this object will accept all category sets.
Constructs a QCategoryFilter object of type t.
See also FilterType.
Constructs a QCategoryFilter object that only accepts category sets containing all of the category ids listed in set. The type is set to QCategoryFilter::List.
Constructs a QCategoryFilter object that only accepts category sets containing category id c. The type is set to QCategoryFilter::List.
Constructs a QCategoryFilter object as a copy of other.
Destroys a QCategoryFilter object.
Returns true if the QCategoryFilterObject accepts all category sets. Otherwise returns false.
See also QCategoryFilter::requiredCategories().
Returns true if the QCategoryFilterObject only accepts empty category sets. Otherwise returns false.
Returns true if the set of categories described by list is accepted by the QCategoryFilter object. Otherwise returns false.
Returns a translated string that briefly describes the QCategoryFilter object. If specified, scope specifies the scope in which to search for the label.
This is useful when displaying a string describing the categories the QCategoryFilter allows.
currentCategoryLabel->setText( catetoryFilter->label() );
Reads the QCategoryFilter from field key in c.
QSettings settings("mycompany", "myapp"); QCategoryFilter filter; filter.readConfig(settings,"filter");
See also writeConfig().
Returns the list of categories that must be in a set for the set to be accepted. Note that this only returns a list of the QCategoryFilter object is of type QCategoryFilter::List. To get the list of categories corresponding to QCategoryFilter::All you must create a QCategoryManager.
QStringList categories;
if ( filter.acceptAll() )
categories = QCategoryManager(scope).categoryIds();
else
categories = filter.requiredCategories(); // returns empty list for Unfiled
Writes the QCategoryFilter to field key in c.
QCategoryFilter filter("mycategory"); QSettings settings("mycompany", "myapp"); filter.writeConfig(settings,"filter");
See also readConfig().
Returns true if the QCategoryFilter object is not equivilent to other. Otherwise returns false.
Assigns the QCategoryFilter object to be a copy of other.
Returns true if the QCategoryFilter object is equivilent to other. Otherwise returns false.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |