QSGClipNode Class | QtQuick 5.3

- Qt 5.3
- Qt Quick
- C++ Classes
- QSGClipNode
- Qt 5.3.2 Reference Documentation

# QSGClipNode Class

The QSGClipNode class implements the clipping functionality in the scene graph. More...

Header: | `#include <QSGClipNode>`
qmake: | `QT += quick`
Inherits: | QSGBasicGeometryNode.

- List of all members, including inherited members

## Public Functions

| QSGClipNode()
| ~QSGClipNode()
QRectF | clipRect() const
bool | isRectangular() const
void | setClipRect(const QRectF & rect)
void | setIsRectangular(bool rectHint)

- 3 public functions inherited from QSGBasicGeometryNode
- 20 public functions inherited from QSGNode

## Detailed Description

The QSGClipNode class implements the clipping functionality in the scene graph.

Clipping applies to the node's subtree and can be nested. Multiple clip nodes will be accumulated by intersecting all their geometries. The accumulation happens as part of the rendering.

Clip nodes must have a geometry before they can be added to the scene graph.

Clipping is usually implemented by using the stencil buffer.

Note: All classes with QSG prefix should be used solely on the scene graph's rendering thread. See Scene Graph and Rendering for more information.

## Member Function Documentation

### QSGClipNode::QSGClipNode()

Creates a new QSGClipNode without a geometry.

The clip node must have a geometry before it can be added to the scene graph.

### QSGClipNode::~QSGClipNode()

Deletes this QSGClipNode.

If the flag QSGNode::OwnsGeometry is set, the geometry will also be deleted.

### QRectF QSGClipNode::clipRect() const

Returns the clip rect of this node.

See also setClipRect().

### bool QSGClipNode::isRectangular() const

Returns if this clip node has a rectangular clip.

See also setIsRectangular().

### void QSGClipNode::setClipRect(const QRectF & rect)

Sets the clip rect of this clip node to rect.

When a rectangular clip is set in combination with setIsRectangular the renderer may in some cases use a more optimal clip method.

See also clipRect().

### void QSGClipNode::setIsRectangular(bool rectHint)

Sets whether this clip node has a rectangular clip to rectHint.

This is an optimization hint which means that the renderer can use scissoring instead of stencil, which is significantly faster.

When this hint is set and it is applicable, the clip region will be generated from clipRect() rather than geometry().

See also isRectangular().