- Qt 6.12
- Qt Graphs
- QML Types
- QtGraphs
- Scene3D
- Qt Graphs | Commercial or GPLv3

# Scene3D QML Type (Uncreatable)

Scene3D type provides description of the 3D scene being visualized. More...

Import Statement: | `import QtGraphs`
In C++: | Q3DScene

Note: This is an uncreatable type. It cannot be instantiated in QML.

- List of all members, including inherited members
- Scene3D is part of Qt Graphs QML Types for 3D.

## Properties

- devicePixelRatio : real
- graphPositionQuery : point
- invalidSelectionPoint : point
- primarySubViewport : rect
- secondarySubViewport : rect
- secondarySubviewOnTop : bool
- selectionQueryPosition : point
- slicingActive : bool

## Signals

- devicePixelRatioChanged(qreal pixelRatio)
- graphPositionQueryChanged(point position)
- primarySubViewportChanged(rect subViewport)
- secondarySubViewportChanged(rect subViewport)
- secondarySubviewOnTopChanged(bool isSecondaryOnTop)
- selectionQueryPositionChanged(point position)
- slicingActiveChanged(bool isSlicingActive)
- viewportChanged(rect viewport)

## Detailed Description

The 3D scene contains a single active camera and a single active light source. Visualized data is assumed to be at a fixed location.

The 3D scene also keeps track of the viewport in which graph rendering is done, the primary subviewport inside the viewport where the main 3D graphs view resides and the secondary subviewport where the 2D sliced view of the data resides.

Also the scene has flag for tracking if the secondary 2D slicing view is currently active or not.

Note: Not all graphs support the secondary 2D slicing view.

## Property Documentation

### devicePixelRatio : real

The current device pixel ratio that is used when mapping input coordinates to pixel coordinates.

### graphPositionQuery : point

The coordinates for the user input that should be processed by the scene as a graph position query. If this property is set to value other than invalidSelectionPoint, the graph tries to match a graph position to the given point within the primary viewport. After the rendering pass, this property is returned to its default state of invalidSelectionPoint. The queried graph position can be read from the GraphsItem3D::queriedGraphPosition property after the next render pass.

There is no single correct 3D coordinate to match a particular screen position, so to be consistent, the queries are always done against the inner sides of an invisible box surrounding the graph.

Note: Bar graphs allow graph position queries only at the graph floor level.

See also GraphsItem3D::queriedGraphPosition.

### invalidSelectionPoint : point `[read-only]`

A constant property providing an invalid point for selection.

### primarySubViewport : rect

The current subviewport rectangle inside the viewport where the primary view of the graphs is targeted.

If the primary sub viewport has not been explicitly set, it will be one fifth of the viewport.

Note: Setting primarySubViewport larger than or outside of viewport resizes viewport accordingly.

### secondarySubViewport : rect

The secondary viewport is used for drawing the 2D slice view in some graphs. If it has not been explicitly set, it will be equal to the size of the viewport.

Note: If the secondary sub viewport is larger than or outside of the viewport, the viewport is resized accordingly.

### secondarySubviewOnTop : bool

Defines whether the 2D slicing view or the 3D view is drawn on top.

### selectionQueryPosition : point

The coordinates for the user input that should be processed by the scene as a selection. If this property is set to a value other than invalidSelectionPoint, the graph tries to select a data item at the given point within the primary viewport. After the rendering pass, the property is returned to its default state of invalidSelectionPoint.

### slicingActive : bool

Defines whether the 2D slicing view is currently active. If `true`, Graphs3D::selectionMode must have either the Graphs3D.SelectionRow or Graphs3D.SelectionColumn set to a valid selection.

Note: Not all graphs support the 2D slicing view.

## Signal Documentation

### devicePixelRatioChanged(qreal pixelRatio)

This signal is emitted when devicePixelRatio changes to pixelRatio.

Note: The corresponding handler is `onDevicePixelRatioChanged`.

### graphPositionQueryChanged(point position)

This signal is emitted when graphPositionQuery changes to position.

Note: The corresponding handler is `onGraphPositionQueryChanged`.

### primarySubViewportChanged(rect subViewport)

This signal is emitted when primarySubViewport changes to subViewport.

Note: The corresponding handler is `onPrimarySubViewportChanged`.

### secondarySubViewportChanged(rect subViewport)

This signal is emitted when secondarySubViewport changes to subViewport.

Note: The corresponding handler is `onSecondarySubViewportChanged`.

### secondarySubviewOnTopChanged(bool isSecondaryOnTop)

This signal is emitted when secondarySubviewOnTop changes to isSecondaryOnTop.

Note: The corresponding handler is `onSecondarySubviewOnTopChanged`.

### selectionQueryPositionChanged(point position)

This signal is emitted when selectionQueryPosition changes to position.

Note: The corresponding handler is `onSelectionQueryPositionChanged`.

### slicingActiveChanged(bool isSlicingActive)

This signal is emitted when slicingActive changes to isSlicingActive.

Note: The corresponding handler is `onSlicingActiveChanged`.

### viewportChanged(rect viewport)

This signal is emitted when viewport changes to viewport.

Note: The corresponding handler is `onViewportChanged`.