Qt Jambi Home

com.trolltech.qt.gui
Class QStyleOptionViewItem

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.gui.QStyleOption
              extended by com.trolltech.qt.gui.QStyleOptionViewItem
All Implemented Interfaces:
QtJambiInterface
Direct Known Subclasses:
QStyleOptionViewItemV2

public class QStyleOptionViewItem
extends QStyleOption

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 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 Styles example.

See Also:
QStyleOption, Model/View Programming

Nested Class Summary
static class QStyleOptionViewItem.Position
          This enum describes the position of the item's decoration.
static class QStyleOptionViewItem.StyleOptionType
          This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass.
static class QStyleOptionViewItem.StyleOptionVersion
          This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass.
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QStyleOption
QStyleOption.OptionType
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
  QStyleOptionViewItem()
          Constructs a QStyleOptionViewItem, initializing the members variables to their default values.
protected QStyleOptionViewItem(int version)
          
  QStyleOptionViewItem(QStyleOptionViewItem other)
          Constructs a copy of the other style option.
 
Method Summary
 Qt.Alignment decorationAlignment()
          Returns the alignment of the decoration for the item.
 QStyleOptionViewItem.Position decorationPosition()
          Returns the position of the decoration for the item.
 QSize decorationSize()
          Returns the size of the decoration for the item.
 Qt.Alignment displayAlignment()
          Returns the alignment of the display value for the item.
 QFont font()
          Returns the font used for the item.
static QStyleOptionViewItem fromNativePointer(QNativePointer nativePointer)
          This function returns the QStyleOptionViewItem instance pointed to by nativePointer
static QNativePointer nativePointerArray(QStyleOptionViewItem[] array)
          This function returns a QNativePointer that is pointing to the specified QStyleOptionViewItem array.
 void setDecorationAlignment(Qt.Alignment decorationAlignment)
          Sets the alignment of the decoration for the item to decorationAlignment.
 void setDecorationAlignment(Qt.AlignmentFlag... decorationAlignment)
          Sets the alignment of the decoration for the item to decorationAlignment.
 void setDecorationPosition(QStyleOptionViewItem.Position decorationPosition)
          Sets the position of the decoration for the item to decorationPosition.
 void setDecorationSize(QSize decorationSize)
          Sets the size of the decoration for the item to decorationSize.
 void setDisplayAlignment(Qt.Alignment displayAlignment)
          Sets the alignment of the display value for the item to displayAlignment.
 void setDisplayAlignment(Qt.AlignmentFlag... displayAlignment)
          Sets the alignment of the display value for the item to displayAlignment.
 void setFont(QFont font)
          Sets the font used for the item to font.
 void setShowDecorationSelected(boolean showDecorationSelected)
          Sets whether the decoration should be highlighted on selected items to showDecorationSelected.
 void setTextElideMode(Qt.TextElideMode textElideMode)
          Sets where ellipsis should be added for text that is too long to fit into an item to textElideMode.
 boolean showDecorationSelected()
          Returns whether the decoration should be highlighted on selected items.
 Qt.TextElideMode textElideMode()
          Returns where ellipsis should be added for text that is too long to fit into an item.
 
Methods inherited from class com.trolltech.qt.gui.QStyleOption
direction, fontMetrics, initFrom, nativePointerArray, palette, rect, setDirection, setFontMetrics, setPalette, setRect, setState, setState, setType, setVersion, state, type, version
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QStyleOptionViewItem

public QStyleOptionViewItem(QStyleOptionViewItem other)

Constructs a copy of the other style option.


QStyleOptionViewItem

public QStyleOptionViewItem()

Constructs a QStyleOptionViewItem, initializing the members variables to their default values.


QStyleOptionViewItem

protected QStyleOptionViewItem(int version)

Method Detail

setShowDecorationSelected

public final void setShowDecorationSelected(boolean showDecorationSelected)

Sets whether the decoration should be highlighted on selected items to showDecorationSelected.

If this option is true, the branch and any decorations on selected items should be highlighted, indicating that the item is selected; otherwise, no highlighting is required. The default value is false.

See Also:
showDecorationSelected, QStyle::SH_ItemView_ShowDecorationSelected, QAbstractItemView

showDecorationSelected

public final boolean showDecorationSelected()

Returns 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, indicating that the item is selected; otherwise, no highlighting is required. The default value is false.

See Also:
setShowDecorationSelected, QStyle::SH_ItemView_ShowDecorationSelected, QAbstractItemView

setDecorationPosition

public final void setDecorationPosition(QStyleOptionViewItem.Position decorationPosition)

Sets the position of the decoration for the item to decorationPosition.

The default value is Left.

See Also:
decorationPosition, Position

decorationPosition

public final QStyleOptionViewItem.Position decorationPosition()

Returns the position of the decoration for the item.

The default value is Left.

See Also:
setDecorationPosition, Position

setDecorationAlignment

public final void setDecorationAlignment(Qt.AlignmentFlag... decorationAlignment)

Sets the alignment of the decoration for the item to decorationAlignment.

The default value is Qt::AlignLeft.

See Also:
decorationAlignment

setDecorationAlignment

public final void setDecorationAlignment(Qt.Alignment decorationAlignment)

Sets the alignment of the decoration for the item to decorationAlignment.

The default value is Qt::AlignLeft.

See Also:
decorationAlignment

decorationAlignment

public final Qt.Alignment decorationAlignment()

Returns the alignment of the decoration for the item.

The default value is Qt::AlignLeft.

See Also:
setDecorationAlignment

setDisplayAlignment

public final void setDisplayAlignment(Qt.AlignmentFlag... displayAlignment)

Sets the alignment of the display value for the item to displayAlignment.

The default value is Qt::AlignLeft.

See Also:
displayAlignment

setDisplayAlignment

public final void setDisplayAlignment(Qt.Alignment displayAlignment)

Sets the alignment of the display value for the item to displayAlignment.

The default value is Qt::AlignLeft.

See Also:
displayAlignment

displayAlignment

public final Qt.Alignment displayAlignment()

Returns the alignment of the display value for the item.

The default value is Qt::AlignLeft.

See Also:
setDisplayAlignment

setTextElideMode

public final void setTextElideMode(Qt.TextElideMode textElideMode)

Sets where ellipsis should be added for text that is too long to fit into an item to textElideMode.

The default value is Qt::ElideMiddle, i.e. the ellipsis appears in the middle of the text.

See Also:
textElideMode, Qt::TextElideMode, QStyle::SH_ItemView_EllipsisLocation

textElideMode

public final Qt.TextElideMode textElideMode()

Returns where ellipsis should be added for text that is too long to fit into an item.

The default value is Qt::ElideMiddle, i.e. the ellipsis appears in the middle of the text.

See Also:
setTextElideMode, Qt::TextElideMode, QStyle::SH_ItemView_EllipsisLocation

setDecorationSize

public final void setDecorationSize(QSize decorationSize)

Sets the size of the decoration for the item to decorationSize.

The default value is QSize(-1, -1), i.e. an invalid size.

See Also:
decorationSize, decorationAlignment, decorationPosition

decorationSize

public final QSize decorationSize()

Returns the size of the decoration for the item.

The default value is QSize(-1, -1), i.e. an invalid size.

See Also:
setDecorationSize, decorationAlignment, decorationPosition

setFont

public final void setFont(QFont font)

Sets the font used for the item to font.

By default, the application's default font is used.

See Also:
font, QFont

font

public final QFont font()

Returns the font used for the item.

By default, the application's default font is used.

See Also:
setFont, QFont

fromNativePointer

public static QStyleOptionViewItem fromNativePointer(QNativePointer nativePointer)
This function returns the QStyleOptionViewItem instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

nativePointerArray

public static QNativePointer nativePointerArray(QStyleOptionViewItem[] array)
This function returns a QNativePointer that is pointing to the specified QStyleOptionViewItem array.

Parameters:
array - the array that the returned pointer will point to.
Returns:
a QNativePointer that is pointing to the specified array.

Qt Jambi Home