Obsolete Members for QStyleOptionGraphicsItem

The following members of class QStyleOptionGraphicsItem are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Variables

(obsolete) qreal levelOfDetail
(obsolete) QMatrix matrix

Member Variable Documentation

qreal QStyleOptionGraphicsItem::levelOfDetail

Use QStyleOptionGraphicsItem::levelOfDetailFromTransform() together with QPainter::worldTransform() instead.

QMatrix QStyleOptionGraphicsItem::matrix

This variable holds the complete transformation matrix for the item

The QMatrix provided through this member does include information about any perspective transformations applied to the view or item. To get the correct transformation matrix, use QPainter::transform() on the painter passed into the QGraphicsItem::paint() implementation.

This matrix is the combination 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 dimensions of an item in screen coordinates (i.e., pixels), you can use the mapping functions of QMatrix, such as QMatrix::map().

This member is only initialized for items that have the QGraphicsItem::ItemUsesExtendedStyleOption flag set.

See also QStyleOptionGraphicsItem::levelOfDetailFromTransform().

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
create apps
create games
cross platform
native performance
3rd party services
game network
level editor
easiest to learn
biggest time saving
best support