permalink view source

QEnhancedTextItem (QtWidgets.QGraphicsSimpleTextItem)

A text item giving explicit control over positioning and scale.

This is a modified QGraphicsSimpleTextItem which acts mostly like its superclass, with the following extensions:

  • It can be given a rendering offset which forces a painting offset indicated by a point vector.
  • It can be given a scaling factor which triggers a hard scale on top of its font size. Scaling is performed relative to the origin.
  • It can be clipped to render any horizontal slice of its image.

__init__ (self, *args, origin_offset=None, scale_factor=1, clip_start_x=None, clip_width=None, **kwargs) permalink view source


origin_offset (QPointF): The offset of the glyph's origin from (0, 0)

scale_factor (float): A hard scaling factor.

clip_start_x (Unit or None): The local starting position for the clipping region. Use None to render from the start.

clip_width (Unit or None): The width of the clipping region. Use None to render to the end