brown.interface.qt.q_clipping_path

classes

permalink view source

QClippingPath (QtWidgets.QGraphicsPathItem)

A QGraphicsPathItem extension supporting horizontal path clipping.

Works exactly like a QGraphicsPathItem except that it renders a horizontal slice of the path.

__init__ (qt_path, clip_start_x, clip_width) permalink view source

arguments:

qt_path (QPainterPath): The path for the item. This value should be the same as in QGraphicsPathItem.__init__()

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

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

static methods

calculate_clipping_area (bounding_rect, clip_start_x, clip_width, extra_padding) permalink view source

Create a QRectF giving the painting area for the object.

arguments:

bounding_rect (QRectF): The full shape's bounding rectangle

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

extra_padding (float): Extra area padding to be added to all sides of the clipping area. This might be useful, for instance, for making sure thick pen strokes render completely.

returns:

QRectF

calculate_bounding_rect (bounding_rect, clip_start_x, clip_width, extra_padding) permalink view source

Create a QRectF giving the bounding rect for the path.

arguments:

bounding_rect (QRectF): The full shape's bounding rectangle

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

extra_padding (float): Extra area padding to be added to all sides of the clipping area. This might be useful, for instance, for making sure thick pen strokes render completely.

returns:

QRectF

methods

paint (painter, *args, **kwargs) permalink view source

Paint with automatic clipping.

This is overridden from QGraphicsPathItem.paint()