QCullFace Class | Qt 3D 5.13.0

Qt 5.13 | Qt 3D | C++ Classes | QCullFace

Qt 5.13.0 Reference Documentation

# QCullFace Class

(Qt3DRender::QCullFace)

The QCullFace class specifies whether front or back face culling is enabled. More...

Header: | #include <QCullFace>
qmake: | QT += 3drender
Since: | Qt 5.7
Instantiated By: | CullFace
Inherits: | Qt3DRender::QRenderState

This class was introduced in Qt 5.7.

- List of all members, including inherited members
- Obsolete members

## Public Types

enum | CullingMode { NoCulling, Front, Back, FrontAndBack }

## Properties

- mode : CullingMode

- 3 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject

## Public Functions

| QCullFace(Qt3DCore::QNode *parent = nullptr)
Qt3DRender::QCullFace::CullingMode | mode() const

- 13 public functions inherited from Qt3DCore::QNode
- 30 public functions inherited from QObject

## Public Slots

void | setMode(Qt3DRender::QCullFace::CullingMode mode)

- 3 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject

## Signals

void | modeChanged(Qt3DRender::QCullFace::CullingMode mode)

- 4 signals inherited from Qt3DCore::QNode
- 2 signals inherited from QObject

## Related Non-Members

typedef | QNodePtr
typedef | QNodeVector
typedef | QObjectList
QList<T> | qFindChildren(const QObject *obj, const QRegExp &regExp)
Qt3DCore::QNodeId | qIdForNode(Qt3DCore::QNode *node)
Qt3DCore::QNodeIdVector | qIdsForNodes(const T &nodes)
T | qobject_cast(QObject *object)
T | qobject_cast(const QObject *object)

## Macros

| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
| Q_CLASSINFO(Name, Value)
| Q_DISABLE_COPY(Class)
| Q_DISABLE_COPY_MOVE(Class)
| Q_DISABLE_MOVE(Class)
| Q_EMIT
| Q_ENUM(...)
| Q_ENUM_NS(...)
| Q_FLAG(...)
| Q_FLAG_NS(...)
| Q_GADGET
| Q_INTERFACES(...)
| Q_INVOKABLE
| Q_NAMESPACE
| Q_OBJECT
| Q_PROPERTY(...)
| Q_REVISION
| Q_SET_OBJECT_NAME(Object)
| Q_SIGNAL
| Q_SIGNALS
| Q_SLOT
| Q_SLOTS

### Additional Inherited Members

- 9 static public members inherited from QObject
- 2 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject

## Detailed Description

QCullFace sets whether the front or back facets are culled. Facets include triangles, quadrilaterals, polygons and rectangles.

It can be added by calling the addRenderState() method on a QRenderPass:

      // using namespace Qt3DRender;

      QRenderPass *renderPass = new QRenderPass();

      // Create a front face culling render state
      QCullFace *cullFront = new QCullFace();
      cullFront->setMode(QCullFace::Front);

      // Add the render state to the render pass
      renderPass->addRenderState(cullFront);

Or by calling the addRenderState() method on a QRenderStateSet:

      // using namespace Qt3DRender;

      QRenderStateSet *renderStateSet = new QRenderStateSet();

      // Create a front face culling render state
      QCullFace *cullFront = new QCullFace();
      cullFront->setMode(QCullFace::Front);

      // Add the render state to the render pass
      renderStateSet->addRenderState(cullFront);

See also QFrontFace.

## Member Type Documentation

### enum QCullFace::CullingMode

This enumeration specifies values for the culling mode.

Constant | Value | Description
--- | --- | ---
`Qt3DRender::QCullFace::NoCulling` | `0x0` | Culling is disabled
`Qt3DRender::QCullFace::Front` | `0x0404` | Culling is enabled for front facing polygons
`Qt3DRender::QCullFace::Back` | `0x0405` | Culling is enabled for back facing polygons
`Qt3DRender::QCullFace::FrontAndBack` | `0x0408` | Culling is enabled for all polygons, points and lines are drawn

## Property Documentation

### mode : CullingMode

Holds the culling mode used by QCullFace. Default is set to QCullFace.Back.

Access functions:

Qt3DRender::QCullFace::CullingMode | mode() const
void | setMode(Qt3DRender::QCullFace::CullingMode mode)

Notifier signal:

void | modeChanged(Qt3DRender::QCullFace::CullingMode mode)

## Member Function Documentation

### QCullFace::QCullFace(Qt3DCore::QNode *parent = nullptr)

Constructs a new QCullFace::QCullFace instance with parent as parent.