CardViewItem Class Reference
Represents a single card (item) in the card view. More...
#include <cardview.h>
Public Types | |
typedef QPair< QString, QString > | Field |
Public Member Functions | |
CardViewItem (CardView *parent, QString caption=QString::null) | |
const QString & | caption () const |
void | setCaption (const QString &caption) |
virtual void | paintCard (QPainter *p, QColorGroup &cg) |
virtual void | repaintCard () |
void | insertField (const QString &label, const QString &value) |
void | removeField (const QString &label) |
QString | fieldValue (const QString &label) |
void | clearFields () |
CardViewItem * | nextItem () |
bool | isSelected () const |
void | showFullString (const QPoint &pos, CardViewTip *tip) |
Field * | fieldAt (const QPoint &itempos) const |
CardView * | cardView () |
int | height (bool allowCache=true) const |
Protected Member Functions | |
void | setSelected (bool selected) |
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 47 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 55 of file cardview.h. Referenced by insertField(), and showFullString(). |
Constructor & Destructor Documentation
|
Constructor.
Definition at line 215 of file cardview.cpp. References CardViewItem(). Referenced by CardViewItem(). |
Member Function Documentation
|
Definition at line 351 of file cardview.cpp. Referenced by showFullString(). |
|
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 488 of file cardview.cpp. References repaintCard(), and setCaption(). Referenced by setCaption(). |
|
Paints the card using the given painter and color group. The card will handle painting itself selected if it is selected. Definition at line 247 of file cardview.cpp. References CardView::currentItem(), CardView::d, CardView::headerFont(), height(), isSelected(), CardView::itemMargin(), CardView::itemWidth(), CardView::maxFieldLines(), and paintCard(). Referenced by CardView::drawContents(), and paintCard(). |
|
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 482 of file cardview.cpp. References CardView::repaintItem(). Referenced by setCaption(), CardView::setCurrentItem(), and CardView::setSelected(). |
|
Adds a field to the card.
Definition at line 406 of file cardview.cpp. References CardView::d, Field, insertField(), and CardView::setLayoutDirty(). Referenced by insertField(). |
|
Removes the field with label label from the card.
Definition at line 419 of file cardview.cpp. References removeField(), and CardView::setLayoutDirty(). Referenced by removeField(). |
|
Definition at line 494 of file cardview.cpp. References fieldValue(). Referenced by fieldValue(). |
|
Removes all the fields from this card.
Definition at line 439 of file cardview.cpp. References CardView::setLayoutDirty(). |
|
Definition at line 472 of file cardview.cpp. References CardView::itemAfter(). Referenced by KAddressBookCardView::refresh(), KAddressBookCardView::selectedUids(), KAddressBookCardView::setSelected(), and CardView::takeItem(). |
|
Definition at line 396 of file cardview.cpp. Referenced by CardView::isSelected(), paintCard(), KAddressBookCardView::selectedUids(), and CardView::setSelected(). |
|
Called by the parent card view when the mouse has been resting for a certain amount of time. If the label or value at pos is obscured (trimmed) make the label display the full text. Definition at line 505 of file cardview.cpp. References caption(), CardView::d, CardView::drawFieldLabels(), Field, fieldAt(), CardView::headerFont(), CardView::itemMargin(), CardView::itemWidth(), CardView::maxFieldLines(), CardView::showEmptyFields(), and showFullString(). Referenced by showFullString(). |
|
Definition at line 584 of file cardview.cpp. References CardView::d, fieldAt(), CardView::maxFieldLines(), and CardView::showEmptyFields(). Referenced by fieldAt(), and showFullString(). |
|
allowCache is true, the item may use an internally cached value rather than recalculating from scratch. The argument is mainly to allow the cardView to change global settings (like maxFieldLines) that might influence the items heights
Definition at line 357 of file cardview.cpp. References CardView::d, height(), CardView::itemMargin(), CardView::maxFieldLines(), and CardView::showEmptyFields(). Referenced by CardView::calcLayout(), CardView::drawContents(), height(), CardView::itemAt(), CardView::itemRect(), paintCard(), and CardView::repaintItem(). |
|
Sets the card as selected. This is usually only called from the card view. Definition at line 401 of file cardview.cpp. References setSelected(). Referenced by CardView::setSelected(), and setSelected(). |
The documentation for this class was generated from the following files: