PySide6.QtGui.QRhiViewport¶
- class QRhiViewport¶
Specifies a viewport rectangle.
Details
Used with
setViewport().QRhiassumes OpenGL-style viewport coordinates, meaning x and y are bottom-left. Negative width or height are not allowed.Typical usage is like the following:
const QSize outputSizeInPixels = swapchain->currentPixelSize(); const QRhiViewport viewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height()); cb->beginPass(swapchain->currentFrameRenderTarget(), Qt::black, { 1.0f, 0 }); cb->setGraphicsPipeline(ps); cb->setViewport(viewport); // ...
Note
This is a RHI API with limited compatibility guarantees, see
QRhifor details.Added in version 6.6.
Synopsis¶
Methods¶
def
__init__()def
maxDepth()def
minDepth()def
__ne__()def
__eq__()def
setMaxDepth()def
setMinDepth()def
setViewport()def
viewport()
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 a viewport description with an empty rectangle and a depth range of 0.0f - 1.0f.
See also
- __init__(x, y, w, h[, minDepth=0.0f[, maxDepth=1.0f]])
- Parameters:
x – float
y – float
w – float
h – float
minDepth – float
maxDepth – float
Constructs a viewport description with the rectangle specified by
x,y,w,hand the depth rangeminDepthandmaxDepth.Note
xandyare assumed to be the bottom-left position.wandhshould not be negative, the viewport will be ignored bysetViewport()otherwise.See also
- maxDepth()¶
- Return type:
float
Returns the maxDepth value of the depth range of the viewport.
See also
- minDepth()¶
- Return type:
float
Returns the minDepth value of the depth range of the viewport.
See also
- __ne__(b)¶
- Parameters:
b –
QRhiViewport- Return type:
bool
- __eq__(b)¶
- Parameters:
b –
QRhiViewport- Return type:
bool
- setMaxDepth(maxDepth)¶
- Parameters:
maxDepth – float
Sets the
maxDepthof the depth range of the viewport. By default this is set to 1.0f.See also
- setMinDepth(minDepth)¶
- Parameters:
minDepth – float
Sets the
minDepthof the depth range of the viewport. By default this is set to 0.0f.See also
- setViewport(x, y, w, h)¶
- Parameters:
x – float
y – float
w – float
h – float
Sets the viewport’s position and size to
x,y,w, andh.Note
Viewports are specified in a coordinate system that has its origin in the bottom-left.
See also
- viewport()¶
- Return type:
.std.arrayfloat,4
Returns the viewport x, y, width, and height.
See also