|
KanoopGuiQt 1.3.0
Qt GUI utility library
|
|
Descriptor for a single column or row header in a model/view. More...
#include <tableheader.h>
Classes | |
| class | IntMap |
| An int-keyed map of TableHeader objects with bulk-operation helpers. More... | |
| class | List |
| A list of TableHeader objects with name and type search helpers. More... | |
Public Member Functions | |
| TableHeader () | |
| Default constructor — creates an invalid horizontal header. | |
| TableHeader (int type, Qt::Orientation orientation=Qt::Vertical) | |
| Construct a header with a type and optional orientation. | |
| TableHeader (int type, const QString &text, Qt::Orientation orientation=Qt::Vertical) | |
| Construct a header with a type, display text, and optional orientation. | |
| int | type () const |
| Return the header type integer. | |
| QString | text () const |
| Return the display text. | |
| void | setText (const QString &text) |
| Set the display text. | |
| Qt::Orientation | orientation () const |
| Return the header orientation. | |
| QColor | columnTextColor () const |
| Return the text colour for cells in this column. | |
| void | setColumnTextColor (const QColor &value) |
| Set the text colour for cells in this column. | |
| bool | isVisible () const |
| Return whether this header (and its column) is visible. | |
| void | setVisible (bool value) |
| Set header (and column) visibility. | |
| EntityMetadata | entityMetadata () const |
| Return the EntityMetadata attached to this header. | |
| EntityMetadata & | entityMetadataRef () |
| Return a mutable reference to the attached EntityMetadata. | |
| void | setEntityMetadata (const EntityMetadata &value) |
| Set the EntityMetadata attached to this header. | |
| QVariant | data (int role) const |
| Return data stored in the attached metadata for the given role. | |
| void | setData (const QVariant &value, int role) |
| Store a value in the attached metadata under the given role. | |
| QUuid | uuid () const |
| Return the UUID stored in the attached metadata. | |
| bool | isValid () const |
| Return whether this header has a non-zero type. | |
Static Public Member Functions | |
| static QString | typeToString (int type) |
| Look up the string name for a header type integer. | |
Descriptor for a single column or row header in a model/view.
TableHeader stores the header type (an application-defined integer), display text, orientation, optional text colour, and visibility flag. An EntityMetadata can also be attached for carrying additional role-keyed data.
Two container classes are provided:
Definition at line 29 of file tableheader.h.
|
inline |
Default constructor — creates an invalid horizontal header.
Definition at line 33 of file tableheader.h.
| TableHeader::TableHeader | ( | int | type, |
| Qt::Orientation | orientation = Qt::Vertical |
||
| ) |
Construct a header with a type and optional orientation.
| type | Application-defined header type integer |
| orientation | Header orientation (default Qt::Vertical) |
| TableHeader::TableHeader | ( | int | type, |
| const QString & | text, | ||
| Qt::Orientation | orientation = Qt::Vertical |
||
| ) |
Construct a header with a type, display text, and optional orientation.
| type | Application-defined header type integer |
| text | Display text |
| orientation | Header orientation (default Qt::Vertical) |
|
inline |
Return the text colour for cells in this column.
Definition at line 78 of file tableheader.h.
|
inline |
Return data stored in the attached metadata for the given role.
| role | Model role key |
Definition at line 121 of file tableheader.h.
|
inline |
Return the EntityMetadata attached to this header.
Definition at line 102 of file tableheader.h.
|
inline |
Return a mutable reference to the attached EntityMetadata.
Definition at line 108 of file tableheader.h.
|
inline |
Return whether this header has a non-zero type.
Definition at line 140 of file tableheader.h.
|
inline |
Return whether this header (and its column) is visible.
Definition at line 90 of file tableheader.h.
|
inline |
Return the header orientation.
Definition at line 72 of file tableheader.h.
|
inline |
Set the text colour for cells in this column.
| value | New text colour |
Definition at line 84 of file tableheader.h.
Referenced by TableHeader::IntMap::setTextColorForType().
|
inline |
Store a value in the attached metadata under the given role.
| value | Value to store |
| role | Model role key |
Definition at line 128 of file tableheader.h.
|
inline |
Set the EntityMetadata attached to this header.
| value | Metadata to associate |
Definition at line 114 of file tableheader.h.
Referenced by TableHeader::IntMap::setEntityMetadataForType().
|
inline |
Set the display text.
| text | New header label string |
Definition at line 66 of file tableheader.h.
|
inline |
Set header (and column) visibility.
| value | true to show, false to hide |
Definition at line 96 of file tableheader.h.
|
inline |
Return the display text.
Definition at line 60 of file tableheader.h.
Referenced by TableHeader::List::findByName().
|
inline |
Return the header type integer.
Definition at line 54 of file tableheader.h.
Referenced by TableHeader::IntMap::setEntityMetadataForType(), TableHeader::List::setHeaderVisible(), TableHeader::IntMap::setHeaderVisible(), and TableHeader::IntMap::setTextColorForType().
|
inlinestatic |
Look up the string name for a header type integer.
| type | Header type integer |
Definition at line 245 of file tableheader.h.
|
inline |
Return the UUID stored in the attached metadata.
Definition at line 134 of file tableheader.h.