#include <qstyleoption.h>
Inheritance diagram for QStyleOptionViewItem:


QStyleOptionViewItem contains all the information that QStyle functions need to draw the items for Qt's model/view classes.
For performance reasons, the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.
For an example demonstrating how style options can be used, see the {widgets/styles}{Styles} example.
Definition at line 427 of file qstyleoption.h.
Public Types | |
| enum | StyleOptionType |
| enum | StyleOptionVersion |
| enum | Position |
Public Member Functions | |
| QStyleOptionViewItem () | |
| QStyleOptionViewItem (const QStyleOptionViewItem &other) | |
Public Attributes | |
| Qt::Alignment | displayAlignment |
| Qt::Alignment | decorationAlignment |
| Qt::TextElideMode | textElideMode |
| Position | decorationPosition |
| QSize | decorationSize |
| QFont | font |
| bool | showDecorationSelected |
Protected Member Functions | |
| QStyleOptionViewItem (int version) | |
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass.
Type The type of style option provided ({SO_ViewItem} for this class).
The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles.
Reimplemented from QStyleOption.
Definition at line 430 of file qstyleoption.h.
00430 { Type = SO_ViewItem };
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass.
Version 1
The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it.
Reimplemented from QStyleOption.
Definition at line 431 of file qstyleoption.h.
00431 { Version = 1 };
This enum describes the position of the item's decoration.
Left On the left of the text. Right On the right of the text. Top Above the text. Bottom Below the text.
Definition at line 433 of file qstyleoption.h.
| QStyleOptionViewItem::QStyleOptionViewItem | ( | ) |
whether the decoration should be highlighted on selected itemswhere ellipsis should be added for text that is too long to fit into an item
Constructs a QStyleOptionViewItem, initializing the members variables to their default values.
Definition at line 3708 of file qstyleoption.cpp.
03709 : QStyleOption(Version, SO_ViewItem), 03710 displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft), 03711 textElideMode(Qt::ElideMiddle), decorationPosition(Left), 03712 showDecorationSelected(false) 03713 { 03714 }
| QStyleOptionViewItem::QStyleOptionViewItem | ( | const QStyleOptionViewItem & | other | ) | [inline] |
Constructs a copy of the other style option.
Definition at line 444 of file qstyleoption.h.
00444 : QStyleOption(Version, Type) { *this = other; }
| QStyleOptionViewItem::QStyleOptionViewItem | ( | int | version | ) | [protected] |
Definition at line 3719 of file qstyleoption.cpp.
03720 : QStyleOption(version, SO_ViewItem), 03721 displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft), 03722 textElideMode(Qt::ElideMiddle), decorationPosition(Left), 03723 showDecorationSelected(false) 03724 { 03725 }
| Qt::Alignment QStyleOptionViewItem::displayAlignment |
Definition at line 435 of file qstyleoption.h.
Referenced by QItemDelegate::doLayout(), QItemDelegate::drawDisplay(), QItemDelegate::setOptions(), QAbstractItemView::viewOptions(), and QListView::viewOptions().
| Qt::Alignment QStyleOptionViewItem::decorationAlignment |
Definition at line 436 of file qstyleoption.h.
Referenced by QItemDelegate::doLayout(), QItemDelegate::drawDecoration(), QItemDelegate::paint(), and QAbstractItemView::viewOptions().
Definition at line 437 of file qstyleoption.h.
Referenced by QItemDelegate::drawDisplay(), and QAbstractItemView::viewOptions().
Definition at line 438 of file qstyleoption.h.
Referenced by QItemDelegate::doLayout(), QItemDelegatePrivate::textLayoutBounds(), QAbstractItemView::viewOptions(), and QListView::viewOptions().
Definition at line 439 of file qstyleoption.h.
Referenced by QItemDelegate::decoration(), QComboMenuDelegate::getStyleOption(), QItemDelegate::paint(), QItemDelegatePrivate::textLayoutBounds(), QItemDelegate::updateEditorGeometry(), QAbstractItemView::viewOptions(), and QListView::viewOptions().
Definition at line 440 of file qstyleoption.h.
Referenced by qdesigner_internal::QPropertyEditor::drawBranches(), QItemDelegate::drawDisplay(), MessagesItemDelegate::paint(), QFontFamilyDelegate::paint(), qdesigner_internal::ColorDelegate::paint(), qdesigner_internal::QPropertyEditorDelegate::paint(), QItemDelegate::setOptions(), QFontFamilyDelegate::sizeHint(), QComboMenuDelegate::sizeHint(), QItemDelegate::updateEditorGeometry(), and QAbstractItemView::viewOptions().
Definition at line 441 of file qstyleoption.h.
Referenced by QItemDelegate::doLayout(), QItemDelegate::drawBackground(), QWindowsStyle::drawPrimitive(), QTreeView::drawRow(), QCompleterItemDelegate::paint(), QItemDelegate::updateEditorGeometry(), QAbstractItemView::viewOptions(), QTableView::viewOptions(), qdesigner_internal::QPropertyEditor::viewOptions(), QListView::viewOptions(), and QComboBoxListView::viewOptions().
1.5.1