PySide6.QtGui.QRhiScissor

class QRhiScissor

Specifies a scissor rectangle.

Details

Used with setScissor() . Setting a scissor rectangle is only possible with a QRhiGraphicsPipeline that has UsesScissor set.

QRhi assumes OpenGL-style scissor coordinates, meaning x and y are bottom-left. Negative width or height are not allowed. However, apart from that, the flexible OpenGL semantics apply: negative x and y, partially out of bounds rectangles, etc. will be handled gracefully, clamping as appropriate. Therefore, any rendering logic targeting OpenGL can feed scissor rectangles into QRhiScissor as-is, without any adaptation.

Note

This is a RHI API with limited compatibility guarantees, see QRhi for details.

Added in version 6.6.

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

__init__()

Constructs an empty scissor.

__init__(x, y, w, h)
Parameters:
  • x – int

  • y – int

  • w – int

  • h – int

Constructs a scissor with the rectangle specified by x, y, w, and h.

Note

x and y are assumed to be the bottom-left position. Negative w or h are not allowed, such scissor rectangles will be ignored by QRhiCommandBuffer . Other than that, the flexible OpenGL semantics apply: negative x and y, partially out of bounds rectangles, etc. will be handled gracefully, clamping as appropriate.

__ne__(b)
Parameters:

bQRhiScissor

Return type:

bool

__eq__(b)
Parameters:

bQRhiScissor

Return type:

bool

scissor()
Return type:

.std.arrayint,4

Returns the scissor position and size.

See also

setScissor()

setScissor(x, y, w, h)
Parameters:
  • x – int

  • y – int

  • w – int

  • h – int

Sets the scissor position and size to x, y, w, h.

Note

The position is always expected to be specified in a coordinate system that has its origin in the bottom-left corner, like OpenGL.

See also

scissor()