Qt Jambi Home

com.trolltech.qt.gui
Class QStyleOptionGraphicsItem

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.QStyleOptionGraphicsItem
All Implemented Interfaces:
QtJambiInterface

public class QStyleOptionGraphicsItem
extends QStyleOption

The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.

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.

For an example demonstrating how style options can be used, see the Styles example.

See Also:
QStyleOption, QGraphicsItem::paint

Nested Class Summary
static class QStyleOptionGraphicsItem.StyleOptionType
          This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass.
static class QStyleOptionGraphicsItem.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.AbstractSignal, 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
  QStyleOptionGraphicsItem()
          Constructs a QStyleOptionGraphicsItem.
protected QStyleOptionGraphicsItem(int version)
          
  QStyleOptionGraphicsItem(QStyleOptionGraphicsItem other)
          Constructs a copy of other.
 
Method Summary
 QRectF exposedRect()
          Returns the exposed rectangle, in item coordinates.
static QStyleOptionGraphicsItem fromNativePointer(QNativePointer nativePointer)
          This function returns the QStyleOptionGraphicsItem instance pointed to by nativePointer
 double levelOfDetail()
          Returns a simple metric for determining an item's level of detail.
 QMatrix matrix()
          Returns the complete transformation matrix for the item.
static QNativePointer nativePointerArray(QStyleOptionGraphicsItem[] array)
          This function returns a QNativePointer that is pointing to the specified QStyleOptionGraphicsItem array.
 void setExposedRect(QRectF exposedRect)
          Sets the exposed rectangle, in item coordinates to exposedRect.
 void setLevelOfDetail(double levelOfDetail)
          Sets a simple metric for determining an item's level of detail to levelOfDetail.
 void setMatrix(QMatrix matrix)
          Sets the complete transformation matrix for the item to matrix.
 
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

QStyleOptionGraphicsItem

public QStyleOptionGraphicsItem(QStyleOptionGraphicsItem other)

Constructs a copy of other.


QStyleOptionGraphicsItem

public QStyleOptionGraphicsItem()

Constructs a QStyleOptionGraphicsItem. The levelOfDetail parameter is initialized to 1.


QStyleOptionGraphicsItem

protected QStyleOptionGraphicsItem(int version)

Method Detail

setExposedRect

public final void setExposedRect(QRectF exposedRect)

Sets the exposed rectangle, in item coordinates to exposedRect.

Make use of this rectangle to speed up item drawing when only parts of the item are exposed. If the whole item is exposed, this rectangle will be the same as QGraphicsItem::boundingRect().

See Also:
exposedRect

exposedRect

public final QRectF exposedRect()

Returns the exposed rectangle, in item coordinates.

Make use of this rectangle to speed up item drawing when only parts of the item are exposed. If the whole item is exposed, this rectangle will be the same as QGraphicsItem::boundingRect().

See Also:
setExposedRect

setMatrix

public final void setMatrix(QMatrix matrix)

Sets the complete transformation matrix for the item to matrix.

This matrix is the sum of the item's scene matrix and the matrix of the painter used for drawing the item. It is provided for convenience, allowing anvanced level-of-detail metrics that can be used to speed up item drawing.

To find the dimentions of an item in screen coordinates (i.e., pixels), you can use the mapping functions of QMatrix, such as QMatrix::map().

See Also:
matrix, QStyleOptionGraphicsItem::levelOfDetail

matrix

public final QMatrix matrix()

Returns the complete transformation matrix for the item.

This matrix is the sum of the item's scene matrix and the matrix of the painter used for drawing the item. It is provided for convenience, allowing anvanced level-of-detail metrics that can be used to speed up item drawing.

To find the dimentions of an item in screen coordinates (i.e., pixels), you can use the mapping functions of QMatrix, such as QMatrix::map().

See Also:
setMatrix, QStyleOptionGraphicsItem::levelOfDetail

setLevelOfDetail

public final void setLevelOfDetail(double levelOfDetail)

Sets a simple metric for determining an item's level of detail to levelOfDetail.

This simple metric provides an easy way to determine the level of detail for an item. Its value represents the maximum value of the height and width of a unity rectangle, mapped using the complete transformation matrix of the painter used to draw the item. By default, if no transformations are applied, its value is 1. If zoomed out 1:2, the level of detail will be 0.5, and if zoomed in 2:1, its value is 2.

For more advanced level-of-detail metrics, use QStyleOptionGraphicsItem::matrix directly.

See Also:
levelOfDetail, QStyleOptionGraphicsItem::matrix

levelOfDetail

public final double levelOfDetail()

Returns a simple metric for determining an item's level of detail.

This simple metric provides an easy way to determine the level of detail for an item. Its value represents the maximum value of the height and width of a unity rectangle, mapped using the complete transformation matrix of the painter used to draw the item. By default, if no transformations are applied, its value is 1. If zoomed out 1:2, the level of detail will be 0.5, and if zoomed in 2:1, its value is 2.

For more advanced level-of-detail metrics, use QStyleOptionGraphicsItem::matrix directly.

See Also:
setLevelOfDetail, QStyleOptionGraphicsItem::matrix

fromNativePointer

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

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

nativePointerArray

public static QNativePointer nativePointerArray(QStyleOptionGraphicsItem[] array)
This function returns a QNativePointer that is pointing to the specified QStyleOptionGraphicsItem 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