QStyleOptionViewItem Class Reference

#include <qstyleoption.h>

Inheritance diagram for QStyleOptionViewItem:

Inheritance graph
[legend]
Collaboration diagram for QStyleOptionViewItem:

Collaboration graph
[legend]
List of all members.

Detailed Description

the text of the title barthe icon for the title barthe state of the title barthe widget flags for the title barThe 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 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.

See also:
QStyleOption, {model-view-programming.html}{Model/View Programming}

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)


Member Enumeration Documentation

enum QStyleOptionViewItem::StyleOptionType

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.

See also:
StyleOptionVersion

Reimplemented from QStyleOption.

Definition at line 430 of file qstyleoption.h.

00430 { Type = SO_ViewItem };

enum QStyleOptionViewItem::StyleOptionVersion

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.

See also:
StyleOptionType

Reimplemented from QStyleOption.

Definition at line 431 of file qstyleoption.h.

00431 { Version = 1 };

enum QStyleOptionViewItem::Position

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.

See also:
decorationPosition

Definition at line 433 of file qstyleoption.h.

00433 { Left, Right, Top, Bottom };


Constructor & Destructor Documentation

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.

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.


Member Data Documentation

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().

Qt::TextElideMode QStyleOptionViewItem::textElideMode

Definition at line 437 of file qstyleoption.h.

Referenced by QItemDelegate::drawDisplay(), and QAbstractItemView::viewOptions().

Position QStyleOptionViewItem::decorationPosition

Definition at line 438 of file qstyleoption.h.

Referenced by QItemDelegate::doLayout(), QItemDelegatePrivate::textLayoutBounds(), QAbstractItemView::viewOptions(), and QListView::viewOptions().

QSize QStyleOptionViewItem::decorationSize

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().

QFont QStyleOptionViewItem::font

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().

bool QStyleOptionViewItem::showDecorationSelected

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().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 19:11:03 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1