Q3DSViewerSettings Class | OpenGL Runtime 2.7.0

OpenGL Runtime | OpenGL Runtime | C++ Classes | Q3DSViewerSettings

Qt 3D Studio OpenGL Runtime 2.7 Manual

# Q3DSViewerSettings Class

Qt 3D Studio presentation viewer settings. More...

Header: | #include <Q3DSViewerSettings>
Since: | Qt 3D Studio 2.0
Instantiated By: | ViewerSettings
Inherits: | QObject

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

## Public Types

enum | ScaleMode { ScaleModeFit, ScaleModeFill, ScaleModeCenter }
enum | ShadeMode { ShadeModeShaded, ShadeModeShadedWireframe }
enum | StereoMode { StereoModeMono, StereoModeTopBottom, StereoModeLeftRight, StereoModeAnaglyphRedCyan, StereoModeAnaglyphGreenMagenta }

## Properties

- matteColor : QColor
- matteEnabled : bool
- scaleMode : ScaleMode
- showRenderStats : bool

- skipFramesInterval : int
- stereoEyeSeparation : double
- stereoMode : StereoMode
- stereoProgressiveEnabled : bool

- 1 property inherited from QObject

## Public Functions

bool | isShowRenderStats() const
void | load(const QString &group, const QString &organization = QString(), const QString &application = QString())
QColor | matteColor() const
bool | matteEnabled() const
void | save(const QString &group, const QString &organization = QString(), const QString &application = QString())
Q3DSViewerSettings::ScaleMode | scaleMode() const
int | skipFramesInterval() const
double | stereoEyeSeparation() const
Q3DSViewerSettings::StereoMode | stereoMode() const
bool | stereoProgressiveEnabled() const

- 31 public functions inherited from QObject

## Public Slots

void | setMatteColor(const QColor &color)
void | setMatteEnabled(bool enabled)
void | setScaleMode(Q3DSViewerSettings::ScaleMode mode)
void | setShowRenderStats(bool show)
void | setSkipFramesInterval(int interval)
void | setStereoEyeSeparation(double separation)
void | setStereoMode(Q3DSViewerSettings::StereoMode mode)
void | setStereoProgressiveEnabled(bool enabled)

- 1 public slot inherited from QObject

## Signals

void | matteColorChanged(const QColor &color)
void | matteEnabledChanged(bool enabled)
void | scaleModeChanged(Q3DSViewerSettings::ScaleMode mode)
void | shadeModeChanged(Q3DSViewerSettings::ShadeMode mode)
void | showRenderStatsChanged(bool show)
void | skipFramesIntervalChanged(int interval)
void | stereoEyeSeparationChanged(double separation)
void | stereoModeChanged(Q3DSViewerSettings::StereoMode mode)
void | stereoProgressiveEnabledChanged(bool enabled)

- 2 signals inherited from QObject

## Static Public Members

const QMetaObject | staticMetaObject

- 9 static public members inherited from QObject

### Additional Inherited Members

- 9 protected functions inherited from QObject

## Detailed Description

Qt 3D Studio presentation viewer settings.

Q3DSViewerSettings provides properties to define presentation-independent viewer settings.

Note: This class should not be instantiated directly when working with the C++ APIs. Q3DSSurfaceViewer creates a Q3DSViewerSettings instance implicitly. This can be queried via Q3DSSurfaceViewer::settings().

## Member Type Documentation

### enum Q3DSViewerSettings::ScaleMode

This enumeration specifies the possible scaling modes.

Constant | Value | Description
--- | --- | ---
`Q3DSViewerSettings::ScaleModeFit` | `0` | Scales the presentation to fit the output area.
`Q3DSViewerSettings::ScaleModeFill` | `1` | Scales the presentation to completely fill the output area. This is the default.
`Q3DSViewerSettings::ScaleModeCenter` | `2` | Centers the presentation in the output area without scaling it.

### enum Q3DSViewerSettings::ShadeMode

This enumeration specifies the possible shading modes.

Constant | Value | Description
--- | --- | ---
`Q3DSViewerSettings::ShadeModeShaded` | `0` | Shades the surfaces normally. This is the default.
`Q3DSViewerSettings::ShadeModeShadedWireframe` | `1` | Renders wireframe on top of shaded surfaces.

### enum Q3DSViewerSettings::StereoMode

This enumeration specifies the possible stereoscopic viewing modes.

Constant | Value | Description
--- | --- | ---
`Q3DSViewerSettings::StereoModeMono` | `0` | This is the default value.
`Q3DSViewerSettings::StereoModeTopBottom` | `1` |
`Q3DSViewerSettings::StereoModeLeftRight` | `2` |
`Q3DSViewerSettings::StereoModeAnaglyphRedCyan` | `3` |
`Q3DSViewerSettings::StereoModeAnaglyphGreenMagenta` | `4` |

This enum was introduced or modified in Qt 3D Studio 2.5.

## Property Documentation

### matteColor : QColor

Specifies the matte color.

Access functions:

QColor | matteColor() const
void | setMatteColor(const QColor &color)

Notifier signal:

void | matteColorChanged(const QColor &color)

### matteEnabled : bool

Specifies if the empty area around the presentation (applicable when scaleMode is set to ScaleModeCenter or ScaleModeFit) should be filled with a custom color.

The default value is `false`.

Access functions:

bool | matteEnabled() const
void | setMatteEnabled(bool enabled)

Notifier signal:

void | matteEnabledChanged(bool enabled)

See also matteColor.

### scaleMode : ScaleMode

Specifies the scaling mode.

Constant | Description
--- | ---
`ScaleModeFit` | Scales the presentation to fit the output area.
`ScaleModeFill` | Scales the presentation to completely fill the output area.
`ScaleModeCenter` | Centers the presentation in the output area without scaling it.

Access functions:

Q3DSViewerSettings::ScaleMode | scaleMode() const
void | setScaleMode(Q3DSViewerSettings::ScaleMode mode)

Notifier signal:

void | scaleModeChanged(Q3DSViewerSettings::ScaleMode mode)

### showRenderStats : bool

When this property is `true`, the simple profile view is displayed in-scene, on top of the 3D content.

Note: This feature can be disabled at build time, in which case this property has no effect.

Default value is `false`.

Access functions:

bool | isShowRenderStats() const
void | setShowRenderStats(bool show)

Notifier signal:

void | showRenderStatsChanged(bool show)

### skipFramesInterval : int

Sets interval for skipping frame rendering. The default value is 0 meaning all frames are rendered. Setting this to 1 renders every other frame (30fps on 60Hz screen), 2 every third frame (20fps on 60Hz screen) etc. This property allows slowing down 3D rendering while keeping QtQuick UI rendering intact, decreasing the CPU/GPU usage.

This property was introduced in Qt 3D Studio 2.7.

Access functions:

int | skipFramesInterval() const
void | setSkipFramesInterval(int interval)

Notifier signal:

void | skipFramesIntervalChanged(int interval)

### stereoEyeSeparation : double

Specifies the eye (camera) separation of stereo rendering. Value is the amount left and right eye cameras move in x-coordinate values away from center. Bigger separation increases the 3D effect. Optimal value depends on viewed presentation.

This has only effect when stereo mode is set to something else than default `StereoModeMono`.

This property was introduced in Qt 3D Studio 2.5.

Access functions:

double | stereoEyeSeparation() const
void | setStereoEyeSeparation(double separation)

Notifier signal:

void | stereoEyeSeparationChanged(double separation)

### stereoMode : StereoMode

Specifies the stereo mode. The default value `is` StereoModeMono where the view is rendered normally, as suitable for 2D displays. Other available modes target different 3D stereo rendering types.

Constant | Description
--- | ---
`StereoModeMono` | Renders presentation normally in mono.
`StereoModeTopBottom` | Renders presentation in stereoscopic top-bottom mode.
`StereoModeLeftRight` | Renders presentation in stereoscopic left-right mode.
`StereoModeAnaglyphRedCyan` | Renders presentation in anaglyph red-cyan mode.
`StereoModeAnaglyphGreenMagenta` | Renders presentation in anaglyph green-magenta mode.

The default value is `StereoModeMono`.

This property was introduced in Qt 3D Studio 2.5.

Access functions:

Q3DSViewerSettings::StereoMode | stereoMode() const
void | setStereoMode(Q3DSViewerSettings::StereoMode mode)

Notifier signal:

void | stereoModeChanged(Q3DSViewerSettings::StereoMode mode)

### stereoProgressiveEnabled : bool

Enables progressive rendering in stereoscopic modes. In this mode, only single eye per frame is rendered. Left eye for odd frames and right for even frames. This halves the maximum animation frame rate (meaning e.g. 30fps on 60Hz screen) while decreasing CPU/GPU usage.

Note: This property has only effect when stereo mode is set to `StereoModeTopBottom` or `StereoModeLeftRight`.

This property was introduced in Qt 3D Studio 2.7.

Access functions:

bool | stereoProgressiveEnabled() const
void | setStereoProgressiveEnabled(bool enabled)

Notifier signal:

void | stereoProgressiveEnabledChanged(bool enabled)

## Member Function Documentation

### void Q3DSViewerSettings::load(const QString &group, const QString &organization = QString(), const QString &application = QString())

Loads previously saved viewer settings using group, organization and application.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### void Q3DSViewerSettings::save(const QString &group, const QString &organization = QString(), const QString &application = QString())

Persistently saves the viewer settings using group, organization and application.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[signal]` void Q3DSViewerSettings::shadeModeChanged(Q3DSViewerSettings::ShadeMode mode)

Emitted when shade mode is changed.