ListCategorizer Class Reference
This Widget extends KListView for a particular purpose: sorting some items into some bins. More...
#include <listCat.h>
Inherits KListView.
Public Member Functions
- ListCategorizer (QWidget *parent, const char *name=0)
- ListCategorizer (const QStringList &categories, bool startOpen, QWidget *parent, const char *name=0)
- void addCategories (const QStringList &)
- QListViewItem * addCategory (const QString &name, const QString &description=QString::null)
- QStringList categories () const
- QListViewItem * addItem (const QString &category, const QString &name, const QString &description=QString::null)
- QStringList items (const QString &category, int column=0) const
- QListViewItem * findCategory (const QString &categoryName) const
- QStringList listSiblings (const QListViewItem *p, int column=0) const
- bool startOpen () const
- void setStartOpen (bool b)
Protected Member Functions
- virtual bool acceptDrag (QDropEvent *event) const
- virtual void startDrag ()
- virtual void contentsDropEvent (QDropEvent *)
Detailed Description
This Widget extends KListView for a particular purpose: sorting some items into some bins.This can be useful for putting items in an enabled / disabled state, or into categories, or configuring toolbars (putting icons onto toolbars).
You can use all of the standard KListView signals and slots. You may in particular want to change the names of the columns, for example:
ListCategorizer *lc = new ListCategorizer(this,colors); lc->setColumnText(0,i18n("Color")); lc->setColumnText(1,i18n("HTML")); QListViewItem *stdKDE = lc->addCategory(i18n("Standard KDE")); (void) new QListViewItem(stdKDE,i18n("red"),"#FF0000");to set sensible column headers for a list of colors and their HTML equivalents (although why you would want to categorize colors is beyond me).
- Version:
- Id
- listCat.h 386915 2005-02-06 22:48:34Z winterz
Constructor & Destructor Documentation
|
Constructor. This creates a new empty ListCategorizer with
|
|
Constructor.
This creates a ListCategorizer with the given
|
Member Function Documentation
|
Add a list of categories to the ListCategorizer. All the categories are added without descriptions; use
|
|
Add a category with name This can be useful if you want either a description for the category or want to refer to this category in the future without using
|
|
Returns the list of names of the categories in the ListCategorizer.
|
|
Add a single item to the category named This might be a convenience function, but it's probably more convenient to just use
|
|
Returns the list of strings in column
You can do this to get, for example the names of all the items categorized under a given category, or, more usefully, set
|
|
Given a category.
|
|
Return the list of strings in column of all siblings of the given item If you remembered a pointer to a category, you can use QStringList l = lc->listSiblings(stdKDE->firstChild(),2);to get the list of strings in hidden column 2 under the category you remembered.
|
|
|
|
Enable categories being inserted in an open state. It is disabled by default but may be set from the constructor. |
|
Reimplemented to prevent categories from being dragged.
|
|
Reimplemented to prevent categories from being dragged.
|
|
Reimplemented to prevent categories from being dragged.
|
The documentation for this class was generated from the following files:
- listCat.h
- listCat.cc