84 const std::string & label_1 = std::string(),
85 const std::string & label_2 = std::string(),
86 const std::string & label_3 = std::string(),
87 const std::string & label_4 = std::string(),
88 const std::string & label_5 = std::string(),
89 const std::string & label_6 = std::string(),
90 const std::string & label_7 = std::string(),
91 const std::string & label_8 = std::string(),
92 const std::string & label_9 = std::string() );
151 bool hasCell(
int index )
const;
157 std::string
label(
int index )
const;
163 std::string
iconName(
int index )
const;
182 std::string iconName()
const {
return ""; }
183 bool hasIconName()
const {
return false; }
184 void setLabel (
const std::string & ) {}
185 void setIconName (
const std::string & ) {}
228 , _iconName( iconName )
239 const std::string &
label,
240 const std::string & iconName =
"" )
242 , _iconName( iconName )
259 std::string
label()
const {
return _label; }
268 void setLabel(
const std::string & newLabel ) { _label = newLabel; }
287 void setIconName(
const std::string & newIconName ) { _iconName = newIconName; }
304 int itemIndex()
const {
return _parent ? _parent->index() : -1; }
318 std::string _iconName;
325 #endif // YTableItem_h std::string label() const
Just for debugging.
void deleteCells()
Delete all cells.
std::string iconName(int index) const
Return the icon name of cell no.
void setLabel(const std::string &newLabel)
Set this cell's label.
bool hasIconName() const
Return 'true' if this cell has an icon name.
void addCell(YTableCell *cell_disown)
Add a cell.
bool hasCell(int index) const
Return 'true' if this item has a cell with the specified index (counting from 0 on), 'false' otherwise.
YTableCell(YTableItem *parent, int column, const std::string &label, const std::string &iconName="")
Constructor with parent, column no., label and optional icon name for cells that are created with a p...
const YTableCell * cell(int index) const
Return the cell at the specified index (counting from 0 on) or 0 if there is none.
virtual ~YTableItem()
Destructor.
virtual ~YTableCell()
Destructor.
One cell (one column in one row) of a YTableItem.
int index() const
Return the index of this item (as set with setIndex() ).
YTableCellCollection::iterator YTableCellIterator
Mutable iterator over YTableCellCollection.
virtual YItem * parent() const
Returns this item's parent item or 0 if it is a toplevel item.
YTableCellCollection::const_iterator YTableCellConstIterator
Const iterator over YTableCellCollection.
std::string label() const
Return this cells's label.
Simple item class for SelectionBox, ComboBox, MultiSelectionBox etc.
bool hasIconName(int index) const
Return 'true' if there is a cell with the specified index that has an icon name.
int cellCount() const
Return the number of cells this item has.
std::vector< YTableCell * > YTableCellCollection
Collection of pointers to YTableCell.
int column() const
Return this cell's column no.
std::string iconName() const
Return this cell's icon name.
void setIconName(const std::string &newIconName)
Set this cell's icon name.
YTableItem * parent() const
Return this cell's parent item or 0 if it doesn't have one yet.
int itemIndex() const
Convenience function: Return this cell's parent item's index within its table widget or -1 if there i...
YTableCellIterator cellsEnd()
Return an iterator that points after the last cell of this item.
Item class for YTable items.
YTableItem()
Default constructor.
YTableCell(const std::string &label, const std::string &iconName="")
Constructor with label and optional icon name for cells that don't have a parent item yet (that will ...
YTableCellIterator cellsBegin()
Return an iterator that points to the first cell of this item.