Go to the documentation of this file.
28 #include "YTreeItem.h"
93 const std::string & label_1 = std::string(),
94 const std::string & label_2 = std::string(),
95 const std::string & label_3 = std::string(),
96 const std::string & label_4 = std::string(),
97 const std::string & label_5 = std::string(),
98 const std::string & label_6 = std::string(),
99 const std::string & label_7 = std::string(),
100 const std::string & label_8 = std::string(),
101 const std::string & label_9 = std::string() );
107 const std::string & label_0,
108 const std::string & label_1 = std::string(),
109 const std::string & label_2 = std::string(),
110 const std::string & label_3 = std::string(),
111 const std::string & label_4 = std::string(),
112 const std::string & label_5 = std::string(),
113 const std::string & label_6 = std::string(),
114 const std::string & label_7 = std::string(),
115 const std::string & label_8 = std::string(),
116 const std::string & label_9 = std::string() );
129 virtual const char *
itemClass()
const {
return "YTableItem"; }
147 const std::string & iconName = std::string(),
148 const std::string & sortKey = std::string() );
153 void addCells(
const std::string & label_0,
154 const std::string & label_1,
155 const std::string & label_2 = std::string(),
156 const std::string & label_3 = std::string(),
157 const std::string & label_4 = std::string(),
158 const std::string & label_5 = std::string(),
159 const std::string & label_6 = std::string(),
160 const std::string & label_7 = std::string(),
161 const std::string & label_8 = std::string(),
162 const std::string & label_9 = std::string() );
209 std::string iconName(
int index )
const;
215 bool hasIconName(
int index )
const;
235 std::string iconName()
const {
return ""; }
237 void setLabel (
const std::string & ) {}
238 void setIconName (
const std::string & ) {}
280 const std::string &
sortKey =
"" )
294 const std::string &
label,
296 const std::string &
sortKey =
"" )
316 std::string
label()
const {
return _label; }
325 void setLabel(
const std::string & newLabel ) { _label = newLabel; }
344 void setIconName(
const std::string & newIconName ) { _iconName = newIconName; }
349 std::string
sortKey()
const {
return _sortKey; }
363 void setSortKey(
const std::string & newSortKey ) { _sortKey = newSortKey; }
394 std::string _iconName;
395 std::string _sortKey;
401 #endif // YTableItem_h
Item class for tree items.
std::string label() const
Return this cells's label.
YTableCellIterator cellsBegin()
Return an iterator that points to the first cell of this item.
int cellCount() const
Return the number of cells this item has.
int index() const
Return the index of this item (as set with setIndex() ).
YTableItem * parent() const
Return this cell's parent item or 0 if it doesn't have one yet.
virtual std::string debugLabel() const
Return a descriptive label of this item instance for debugging.
std::string label() const
Just for debugging.
std::string iconName() const
Return this cell's icon name.
int column() const
Return this cell's column no.
YTableCell(YTableItem *parent, int column, const std::string &label, const std::string &iconName="", const std::string &sortKey="")
Constructor with parent, column no., label and optional icon name for cells that are created with a p...
void setIconName(const std::string &newIconName)
Set this cell's icon name.
void reparent(YTableItem *parent, int column)
Set this cell's parent item and column no.
int itemIndex() const
Convenience function: Return this cell's parent item's index within its table widget or -1 if there i...
virtual const char * itemClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
bool isOpen() const
Return 'true' if this tree item should be displayed open (with its children visible) by default.
Item class for YTable items.
void deleteCells()
Delete all cells.
std::vector< YTableCell * > YTableCellCollection
Collection of pointers to YTableCell.
virtual YTreeItem * parent() const
Returns this item's parent item or 0 if it is a toplevel item.
YTableCellIterator cellsEnd()
Return an iterator that points after the last cell of this item.
bool hasIconName() const
Return 'true' if this cell has an icon name.
void setLabel(const std::string &newLabel)
Set this cell's label.
YTableItem()
Default constructor.
YTableCellCollection::iterator YTableCellIterator
Mutable iterator over YTableCellCollection.
void addCells(const std::string &label_0, const std::string &label_1, const std::string &label_2=std::string(), const std::string &label_3=std::string(), const std::string &label_4=std::string(), const std::string &label_5=std::string(), const std::string &label_6=std::string(), const std::string &label_7=std::string(), const std::string &label_8=std::string(), const std::string &label_9=std::string())
Add up to 10 cells without any icons.
bool hasSortKey() const
Return 'true' if this cell has a sort key.
YTableCell(const std::string &label, const std::string &iconName="", const std::string &sortKey="")
Constructor with label and optional icon name and optional sort key for cells that don't have a paren...
const YTableCell * cell(int index) const
Return the cell at the specified index (counting from 0 on) or 0 if there is none.
YTableCellCollection::const_iterator YTableCellConstIterator
Const iterator over YTableCellCollection.
virtual ~YTableCell()
Destructor.
virtual ~YTableItem()
Destructor.
bool hasIconName(int index) const
Return 'true' if there is a cell with the specified index that has an icon name.
void setSortKey(const std::string &newSortKey)
Set this cell's sort key.
void addCell(YTableCell *cell_disown)
Add a cell.
One cell (one column in one row) of a YTableItem.
bool hasCell(int index) const
Return 'true' if this item has a cell with the specified index (counting from 0 on),...
std::string sortKey() const
Return this cell's sort key.