CardViewItem Class Reference
Represents a single card (item) in the card view. More...
#include <cardview.h>
Public Types | |
typedef QPair< QString, QString > | Field |
A single field in the card view. | |
Public Member Functions | |
CardViewItem (CardView *parent, QString caption=QString::null) | |
Constructor. | |
const QString & | caption () const |
void | setCaption (const QString &caption) |
Sets the caption of the card. | |
virtual void | paintCard (QPainter *p, QColorGroup &cg) |
Paints the card using the given painter and color group. | |
virtual void | repaintCard () |
Repaints the card. | |
void | insertField (const QString &label, const QString &value) |
Adds a field to the card. | |
void | removeField (const QString &label) |
Removes the field with label label from the card. | |
QString | fieldValue (const QString &label) |
void | clearFields () |
Removes all the fields from this card. | |
CardViewItem * | nextItem () |
bool | isSelected () const |
Protected Member Functions | |
void | setSelected (bool selected) |
Sets the card as selected. | |
Friends | |
class | CardView |
Detailed Description
Represents a single card (item) in the card view.A card has a caption and a list of fields. A Field is a label<->value pair. The labels in a card should be unique, since they will be used to index the values.
Definition at line 21 of file cardview.h.
Member Typedef Documentation
|
A single field in the card view. The first item is the label and the second item is the value. Definition at line 29 of file cardview.h. Referenced by insertField(), and removeField(). |
Constructor & Destructor Documentation
|
Constructor.
Definition at line 134 of file cardview.cpp. References caption(). |
Member Function Documentation
|
Definition at line 243 of file cardview.cpp. Referenced by CardViewItem(). |
|
Sets the caption of the card. This is the text that will appear at the top of the card. This is also the string that will be used to sort the cards in the view. Definition at line 365 of file cardview.cpp. References QScrollView::viewport(). |
|
Paints the card using the given painter and color group. The card will handle painting itself selected if it is selected. Definition at line 165 of file cardview.cpp. References QColorGroup::brush(), QColorGroup::button(), QPtrListIterator::current(), CardView::d, QPainter::drawRect(), QPainter::drawText(), QPainter::fillRect(), QPainter::font(), QFontMetrics::height(), QColorGroup::highlight(), QColorGroup::highlightedText(), isSelected(), QPainter::restore(), QPainter::save(), QFont::setBold(), QPainter::setFont(), QPainter::setPen(), QColorGroup::text(), QPtrListIterator::toFirst(), and QFontMetrics::width(). Referenced by CardView::viewportPaintEvent(). |
|
Repaints the card. This is done by sending a repaint event to the view with the clip rect defined as this card. Definition at line 359 of file cardview.cpp. References QScrollView::viewport(). Referenced by CardView::setSelected(). |
|
Adds a field to the card.
Definition at line 285 of file cardview.cpp. References Field, and CardView::setLayoutDirty(). |
|
Removes the field with label label from the card.
Definition at line 295 of file cardview.cpp. References QPtrListIterator::current(), Field, CardView::setLayoutDirty(), and QPtrListIterator::toFirst(). |
|
Definition at line 373 of file cardview.cpp. References QPtrListIterator::current(), and QPtrListIterator::toFirst(). |
|
Removes all the fields from this card.
Definition at line 316 of file cardview.cpp. References CardView::setLayoutDirty(). |
|
Definition at line 349 of file cardview.cpp. References CardView::itemAfter(). Referenced by KAddressBookCardView::incrementalSearch(), KAddressBookCardView::refresh(), KAddressBookCardView::selectedUids(), and KAddressBookCardView::setSelected(). |
|
Definition at line 275 of file cardview.cpp. Referenced by CardView::isSelected(), paintCard(), KAddressBookCardView::selectedUids(), and CardView::setSelected(). |
|
Sets the card as selected. This is usually only called from the card view. Definition at line 280 of file cardview.cpp. Referenced by CardView::setSelected(). |
The documentation for this class was generated from the following files: