#include <YTableItem.h>
Public Member Functions | |
YTableCell (const std::string &label, const std::string &iconName="", const std::string &sortKey="") | |
YTableCell (YTableItem *parent, int column, const std::string &label, const std::string &iconName="", const std::string &sortKey="") | |
virtual | ~YTableCell () |
std::string | label () const |
void | setLabel (const std::string &newLabel) |
std::string | iconName () const |
bool | hasIconName () const |
void | setIconName (const std::string &newIconName) |
std::string | sortKey () const |
bool | hasSortKey () const |
void | setSortKey (const std::string &newSortKey) |
YTableItem * | parent () const |
int | column () const |
int | itemIndex () const |
void | reparent (YTableItem *parent, int column) |
One cell (one column in one row) of a YTableItem. Each cell has a label (a user visible text), optionally an icon (*) and also optionally a sort-key.
Note that cells don't have individual IDs; they have just an index. The first cell in an item is cell(0). In an ideal world, each YTableItem would have exactly as many cells as there are columns in the YTable, but these classes make no such assumptions. A YTableItem might have any number of cells, including none.
The YTable widget is free to ignore any excess cells if there are more than the YTable widget has columns. If there are less cells than the table has columns, the nonexistent cells will be treated as empty.
(*) Not all UIs can handle icons. UIs that can't handle them will simply ignore any icons specified for YTableCells. Thus, applications should either check the UI capabilities if it can handle icons or use icons only as an additional visual cue that still has a text counterpart (so the user can still make sense of the table content when no icons are visible).
|
inline |
Constructor with label and optional icon name and optional sort key for cells that don't have a parent item yet (that will be added to a parent later with setParent()).
|
inline |
Constructor with parent, column no., label and optional icon name for cells that are created with a parent.
|
inlinevirtual |
Destructor. Not strictly needed inside this class, but useful for derived classes. Since this is the only virtual method of this class, the cost of this is a vtable for this class and a pointer to the vtable in each instance.
|
inline |
Return this cell's column no. (counting from 0on) or -1 if it doesn't have a parent yet.
|
inline |
Return 'true' if this cell has an icon name.
|
inline |
Return 'true' if this cell has a sort key.
|
inline |
Return this cell's icon name.
|
inline |
Convenience function: Return this cell's parent item's index within its table widget or -1 if there is no parent item or no parent table.
|
inline |
Return this cells's label. This is what the user sees in a dialog, so this will usually be a translated text.
|
inline |
Return this cell's parent item or 0 if it doesn't have one yet.
void YTableCell::reparent | ( | YTableItem * | parent, |
int | column ) |
Set this cell's parent item and column no. if it doesn't have a parent yet.
This method will throw an exception if the cell already has a parent.
|
inline |
Set this cell's icon name.
If this is called after the corresponding table item (table row) is added to the table widget, call YTable::cellChanged() to notify the table widget about the fact. Only then will the display be updated.
|
inline |
Set this cell's label.
If this is called after the corresponding table item (table row) is added to the table widget, call YTable::cellChanged() to notify the table widget about the fact. Only then will the display be updated.
|
inline |
Set this cell's sort key.
If this is called after the corresponding table item (table row) is added to the table widget, call YTable::cellChanged() to notify the table widget about the fact. Only then will the display be updated.
|
inline |
Return this cell's sort key.