A Q3CheckTableItem is a table item which looks and behaves like a checkbox. The advantage of using Q3CheckTableItems rather than real checkboxes is that a Q3CheckTableItem uses far less resources than a real checkbox would in a {Q3Table}. When the cell has the focus it displays a real checkbox which the user can interact with. When the cell does not have the focus the cell looks like a checkbox. Pixmaps may not be used in Q3CheckTableItems.
Q3CheckTableItem items have the edit type WhenCurrent
(see {EditType}).
To change the checkbox's label use setText(). The checkbox can be checked and unchecked with setChecked() and its state retrieved using isChecked().
To populate a table cell with a Q3CheckTableItem use Q3Table::setItem().
Q3CheckTableItems can be distinguished from {Q3TableItem}s and {Q3ComboTableItem}s using their Run Time Type Identification (rtti) value.
qtableitems.png Table Items
Definition at line 188 of file q3table.h.
Public Types | |
enum | EditType { Never, OnTyping, WhenCurrent, Always } |
Public Member Functions | |
virtual int | alignment () const |
int | col () const |
int | colSpan () const |
virtual QWidget * | createEditor () const |
EditType | editType () const |
bool | isChecked () const |
bool | isEnabled () const |
bool | isReplaceable () const |
virtual QString | key () const |
virtual void | paint (QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected) |
virtual QPixmap | pixmap () const |
Q3CheckTableItem (Q3Table *table, const QString &txt) | |
int | row () const |
int | rowSpan () const |
int | rtti () const |
virtual void | setChecked (bool b) |
virtual void | setCol (int c) |
virtual void | setContentFromEditor (QWidget *w) |
virtual void | setEnabled (bool b) |
virtual void | setPixmap (const QPixmap &p) |
virtual void | setReplaceable (bool) |
virtual void | setRow (int r) |
virtual void | setSpan (int rs, int cs) |
void | setText (const QString &t) |
virtual void | setWordWrap (bool b) |
QSize | sizeHint () const |
Q3Table * | table () const |
virtual QString | text () const |
void | updateEditor (int oldRow, int oldCol) |
bool | wordWrap () const |
Static Public Attributes | |
static int | RTTI = 2 |
Private Attributes | |
QCheckBox * | cb |
bool | checked |