QRenderSurfaceSelector Class | Qt 3D 5.13.0

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

Qt 5.13.0 Reference Documentation

# QRenderSurfaceSelector Class

(Qt3DRender::QRenderSurfaceSelector)

Provides a way of specifying the render surface. More...

Header: | #include <QRenderSurfaceSelector>
qmake: | QT += 3drender
Since: | Qt 5.7
Instantiated By: | RenderSurfaceSelector
Inherits: | Qt3DRender::QFrameGraphNode

This class was introduced in Qt 5.7.

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

## Properties

- externalRenderTargetSize : QSize
- surface : QObject*
- surfacePixelRatio : float

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

## Public Functions

| QRenderSurfaceSelector(Qt3DCore::QNode *parent = nullptr)
QSize | externalRenderTargetSize() const
QObject * | surface() const
float | surfacePixelRatio() const

- 1 public function inherited from Qt3DRender::QFrameGraphNode
- 13 public functions inherited from Qt3DCore::QNode
- 30 public functions inherited from QObject

## Public Slots

void | setExternalRenderTargetSize(const QSize &size)
void | setSurface(QObject *surfaceObject)
void | setSurfacePixelRatio(float ratio)

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

## Signals

void | externalRenderTargetSizeChanged(const QSize &size)
void | surfaceChanged(QObject *surface)
void | surfacePixelRatioChanged(float ratio)

- 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

The Qt3DRender::QRenderSurfaceSelector can be used to select the surface, where Qt3D renders the content. The surface can either be window surface or offscreen surface. The externalRenderTargetSize is used to specify the actual size of the surface when offscreen surface is used.

When DPI scaling is used by the system, the logical surface size, which is used by mouse events, and the actual 'physical' size of the surface can differ. The surfacePixelRatio is the factor to convert the logical size to the physical size.

See also QWindow, QOffscreenSurface, and QSurface.

## Property Documentation

### externalRenderTargetSize : QSize

Holds the size of the external render target.

Access functions:

QSize | externalRenderTargetSize() const
void | setExternalRenderTargetSize(const QSize &size)

Notifier signal:

void | externalRenderTargetSizeChanged(const QSize &size)

### surface : QObject*

Holds the surface

Access functions:

QObject * | surface() const
void | setSurface(QObject *surfaceObject)

Notifier signal:

void | surfaceChanged(QObject *surface)

### surfacePixelRatio : float

Holds the surfacePixelRatio of the surface.

Access functions:

float | surfacePixelRatio() const
void | setSurfacePixelRatio(float ratio)

Notifier signal:

void | surfacePixelRatioChanged(float ratio)

## Member Function Documentation

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

Constructs QRenderSurfaceSelector with given parent.

### `[slot]` void QRenderSurfaceSelector::setExternalRenderTargetSize(const QSize &size)

Sets render target size if different than underlying surface size. Tells picking the correct size.

Note: Setter function for property externalRenderTargetSize.

See also externalRenderTargetSize().

### `[slot]` void QRenderSurfaceSelector::setSurface(QObject *surfaceObject)

Sets surfaceObject.

Note: Setter function for property surface.

See also surface().