CopperSpice API
1.9.2
|
Base version, describes the parameters used to draw an item in a view widget. More...
Public Typedefs | |
using | ViewItemFeatures = QFlags< ViewItemFeature > |
Public Types | |
enum | Position |
enum | StyleOptionType |
enum | StyleOptionVersion |
enum | ViewItemFeature |
enum | ViewItemPosition |
Public Types inherited from QStyleOption | |
enum | OptionType |
enum | StyleOptionType |
enum | StyleOptionVersion |
Public Methods | |
QStyleOptionViewItem () | |
QStyleOptionViewItem (const QStyleOptionViewItem &other) | |
QStyleOptionViewItem & | operator= (const QStyleOptionViewItem &other) = default |
Public Methods inherited from QStyleOption | |
QStyleOption (const QStyleOption &other) | |
QStyleOption (int version=QStyleOption::Version, int type=SO_Default) | |
~QStyleOption () | |
void | initFrom (const QWidget *widget) |
QStyleOption & | operator= (const QStyleOption &other) |
Public Members | |
QBrush | backgroundBrush |
Qt::CheckState | checkState |
Qt::Alignment | decorationAlignment |
Position | decorationPosition |
QSize | decorationSize |
Qt::Alignment | displayAlignment |
ViewItemFeatures | features |
QFont | font |
QIcon | icon |
QModelIndex | index |
bool | showDecorationSelected |
QString | text |
Qt::TextElideMode | textElideMode |
ViewItemPosition | viewItemPosition |
Public Members inherited from QStyleOption | |
int | type |
int | version |
Additional Inherited Members | |
Related Functions inherited from QStyleOption | |
T | qstyleoption_cast (const QStyleOption *option) |
T | qstyleoption_cast (QStyleOption *option) |
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widget. QStyleOptionViewItem contains all the information that QStyle functions need to draw the items for the model/view classes.
Typedef for QFlags<ViewItemFeature> which contains an OR combination of ViewItemFeature values.
Refer to QStyleOptionViewItem::ViewItemFeature for the enum documentation.
This enum describes the position of the item's decoration.
Constant | Value | Description |
---|---|---|
QStyleOptionViewItem::Left | 0 | On the left of the text |
QStyleOptionViewItem::Right | 1 | On the right of the text |
QStyleOptionViewItem::Top | 2 | Above the text |
QStyleOptionViewItem::Bottom | 3 | Below the text |
This enum is used to hold information about the type of the style option and is defined for each QStyleOption subclass.
Constant | Value | Description |
---|---|---|
QStyleOptionViewItem::Type | SO_ViewItem | Type of style option |
This enum is used to hold information about the version of the style option and is defined for each QStyleOption subclass.
Constant | Value | Description |
---|---|---|
QStyleOptionViewItem::Version | 4 | Version 4 |
This enum describes the different types of features an item can have.
Constant | Value | Description |
---|---|---|
QStyleOptionViewItem::None | 0x00 | Normal item |
QStyleOptionViewItem::WrapText | 0x01 | Item with wrapped text |
QStyleOptionViewItem::Alternate | 0x02 | Background is rendered using alternateBase |
QStyleOptionViewItem::HasCheckIndicator | 0x04 | Item has a check state indicator |
QStyleOptionViewItem::HasDisplay | 0x08 | Item has a display role |
QStyleOptionViewItem::HasDecoration | 0x10 | Item has a decoration role |
This enum is used to represent the placement of the item on a row. This can be used to draw items differently depending on their placement, for example by putting rounded edges at the beginning and end, and straight edges in between.
Constant | Value | Description |
---|---|---|
QStyleOptionViewItem::Invalid | 0 | ViewItemPosition is unknown and should be disregarded |
QStyleOptionViewItem::Beginning | 1 | Item appears at the beginning of the row |
QStyleOptionViewItem::Middle | 2 | Item appears at the middle of the row |
QStyleOptionViewItem::End | 3 | Item appears at the end of the row |
QStyleOptionViewItem::OnlyOne | 4 | Item is the only one on the row and is therefore both at the beginning and the end |
QStyleOptionViewItem::QStyleOptionViewItem | ( | ) |
Constructs an empty QStyleOptionViewItem.
|
inline |
Copy constructs a new QStyleOptionViewItem from other.
|
default |
Copy assigns from other and returns a reference to this object.
QBrush QStyleOptionViewItem::backgroundBrush |
The QBrush which should be used to paint the view items background.
Qt::CheckState QStyleOptionViewItem::checkState |
This value is true if the item is checked. If ViewItemFeature::HasCheckIndicator is false then the item can not be checked.
Qt::Alignment QStyleOptionViewItem::decorationAlignment |
This variable holds the alignment of the decoration for the item. The default value is Qt::AlignLeft.
Position QStyleOptionViewItem::decorationPosition |
This variable holds the position of the decoration for the item. The default value is Left.
QSize QStyleOptionViewItem::decorationSize |
This variable holds the size of the decoration for the item. The default value is QSize(-1, -1) which is an invalid size.
Qt::Alignment QStyleOptionViewItem::displayAlignment |
This variable holds the alignment of the display value for the item. The default value is Qt::AlignLeft.
ViewItemFeatures QStyleOptionViewItem::features |
This variable holds a bitwise OR of the features that describe this view item
QFont QStyleOptionViewItem::font |
This variable holds the font used for the item. By default the application's default font is used.
QIcon QStyleOptionViewItem::icon |
The icon (if any) to be drawn in the view item.
QModelIndex QStyleOptionViewItem::index |
The model index which is used when displaying the data.
bool QStyleOptionViewItem::showDecorationSelected |
This variable holds whether the decoration should be highlighted on selected items. If this option is true the branch and any decorations on selected items should be highlighted. This indicates the item is selected, otherwise no highlighting is required. The default value is false.
QString QStyleOptionViewItem::text |
The text (if any) to be drawn in the view item.
Qt::TextElideMode QStyleOptionViewItem::textElideMode |
Location to add an ellipsis when text is too long to fit into an item. The default value is Qt::ElideMiddle, which means the ellipsis appears in the middle of the text.
ViewItemPosition QStyleOptionViewItem::viewItemPosition |
Gives the position of this view item relative to other items. See the ViewItemPosition enum for the details.