QStyleOptionViewItemV2 Class Reference

#include <qstyleoption.h>

Inheritance diagram for QStyleOptionViewItemV2:

Inheritance graph
[legend]
Collaboration diagram for QStyleOptionViewItemV2:

Collaboration graph
[legend]
List of all members.

Detailed Description

The QStyleOptionViewItemV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.2 or above.

Since:
4.2
QStyleOptionViewItemV2 inherits QStyleOptionViewItem.

An instance of the QStyleOptionViewItemV2 class has type SO_ViewItem and version 2. 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. 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 QStyleOptionFrameV2's detailed description for a discussion of how to handle "V2" classes.

See also:
QStyleOptionViewItem, QStyleOption

Definition at line 450 of file qstyleoption.h.

Public Types

enum  StyleOptionVersion
enum  ViewItemFeature

Public Member Functions

 QStyleOptionViewItemV2 ()
 QStyleOptionViewItemV2 (const QStyleOptionViewItemV2 &other)
 QStyleOptionViewItemV2 (const QStyleOptionViewItem &other)
QStyleOptionViewItemV2operator= (const QStyleOptionViewItem &other)

Public Attributes

ViewItemFeatures features

Protected Member Functions

 QStyleOptionViewItemV2 (int version)


Member Enumeration Documentation

enum QStyleOptionViewItemV2::StyleOptionVersion

This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass.

Version 2

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 QStyleOptionViewItem.

Definition at line 453 of file qstyleoption.h.

00453 { Version = 2 };

enum QStyleOptionViewItemV2::ViewItemFeature

This enum describles the different types of features an item can have.

None Indicates a normal item. WrapText Indicates an item with wrapped text. Alternate Indicates that the item's background is rendered using alternateBase.

Definition at line 455 of file qstyleoption.h.

00455                          {
00456         None = 0x00,
00457         WrapText = 0x01,
00458         Alternate = 0x02
00459     };


Constructor & Destructor Documentation

QStyleOptionViewItemV2::QStyleOptionViewItemV2 (  ) 

a bitwise OR of the features that describe this view item

Constructs a QStyleOptionViewItemV2 object.

Definition at line 697 of file qstyleoption.cpp.

00698     : QStyleOptionViewItem(Version), features(None)
00699 {
00700 }

QStyleOptionViewItemV2::QStyleOptionViewItemV2 ( const QStyleOptionViewItemV2 other  )  [inline]

Constructs a copy of other.

Definition at line 465 of file qstyleoption.h.

00465 : QStyleOptionViewItem(Version) { *this = other; }

QStyleOptionViewItemV2::QStyleOptionViewItemV2 ( const QStyleOptionViewItem other  ) 

Constructs a QStyleOptionViewItemV2 copy of the other style option which can be either of the QStyleOptionViewItemV2 or QStyleOptionViewItem types.

If the other style option's version is 1, the new style option's ViewItemFeature value is set to QStyleOptionViewItemV2::None. If its version is 2, its ViewItemFeature value is simply copied to the new style option.

See also:
version

Definition at line 720 of file qstyleoption.cpp.

00721     : QStyleOptionViewItem(Version)
00722 {
00723     (void)QStyleOptionViewItemV2::operator=(other);
00724 }

QStyleOptionViewItemV2::QStyleOptionViewItemV2 ( int  version  )  [protected]

Definition at line 729 of file qstyleoption.cpp.

00730     : QStyleOptionViewItem(version)
00731 {
00732 
00733 }


Member Function Documentation

QStyleOptionViewItemV2 & QStyleOptionViewItemV2::operator= ( const QStyleOptionViewItem other  ) 

Assigns the other style option to this style option. The other style option can be either of the QStyleOptionViewItemV2 or QStyleOptionViewItem types.

If the {other} style option's version is 1, this style option's ViewItemFeature value is set to QStyleOptionViewItemV2::None. If its version is 2, its ViewItemFeature value is simply copied to this style option.

Definition at line 745 of file qstyleoption.cpp.

References features, None, and QStyleOption::operator=().

00746 {
00747     QStyleOptionViewItem::operator=(other);
00748     const QStyleOptionViewItemV2 *v2 = qstyleoption_cast<const QStyleOptionViewItemV2 *>(&other);
00749     features = v2 ? v2->features : ViewItemFeatures(QStyleOptionViewItemV2::None);
00750     return *this;
00751 }

Here is the call graph for this function:


Member Data Documentation

ViewItemFeatures QStyleOptionViewItemV2::features

Definition at line 462 of file qstyleoption.h.

Referenced by QTableViewPrivate::drawAndClipSpans(), QTableViewPrivate::drawCell(), QItemDelegate::drawDisplay(), QTreeView::drawRow(), operator=(), QItemDelegate::paint(), QTableView::paintEvent(), QListView::paintEvent(), QItemDelegatePrivate::textLayoutBounds(), QListViewPrivate::viewOptionsV2(), and QTableViewPrivate::viewOptionsV2().


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