- Qt 6.8
- Qt Graphs
- Qt Graphs C++ Classes for 3D
- QtGraphs3D Namespace
- Qt Graphs | Commercial or GPLv3

# QtGraphs3D Namespace

The QtGraphs3D module provides enums used by QtGraphs' 3D API. More...

Header: | `#include <QtGraphs3D>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Graphs)` `target_link_libraries(mytarget PRIVATE Qt6::Graphs)`
qmake: | `QT += graphs`

- QtGraphs3D is part of Qt Graphs C++ Classes for 3D.

## Types

enum class | CameraPreset { NoPreset, FrontLow, Front, FrontHigh, LeftLow, …, DirectlyBelow }
enum class | ElementType { None, Series, AxisXLabel, AxisYLabel, AxisZLabel, CustomItem }
enum class | OptimizationHint { Default, Legacy }
enum class | SelectionFlag { None, Item, Row, ItemAndRow, Column, …, MultiSeries }
flags | SelectionFlags
enum class | ShadowQuality { None, Low, Medium, High, SoftLow, …, SoftHigh }

## Functions

QSurfaceFormat | qDefaultSurfaceFormat(bool antialias)

## Detailed Description

## Type Documentation

### enum class QtGraphs3D::CameraPreset

Predefined positions for camera.

Constant | Value | Description
--- | --- | ---
`QtGraphs3D::CameraPreset::NoPreset` | `0` | Used to indicate a preset has not been set, or the scene has been rotated freely.
`QtGraphs3D::CameraPreset::FrontLow` | `1` |
`QtGraphs3D::CameraPreset::Front` | `2` |
`QtGraphs3D::CameraPreset::FrontHigh` | `3` |
`QtGraphs3D::CameraPreset::LeftLow` | `4` |
`QtGraphs3D::CameraPreset::Left` | `5` |
`QtGraphs3D::CameraPreset::LeftHigh` | `6` |
`QtGraphs3D::CameraPreset::RightLow` | `7` |
`QtGraphs3D::CameraPreset::Right` | `8` |
`QtGraphs3D::CameraPreset::RightHigh` | `9` |
`QtGraphs3D::CameraPreset::BehindLow` | `10` |
`QtGraphs3D::CameraPreset::Behind` | `11` |
`QtGraphs3D::CameraPreset::BehindHigh` | `12` |
`QtGraphs3D::CameraPreset::IsometricLeft` | `13` |
`QtGraphs3D::CameraPreset::IsometricLeftHigh` | `14` |
`QtGraphs3D::CameraPreset::IsometricRight` | `15` |
`QtGraphs3D::CameraPreset::IsometricRightHigh` | `16` |
`QtGraphs3D::CameraPreset::DirectlyAbove` | `17` |
`QtGraphs3D::CameraPreset::DirectlyAboveCW45` | `18` |
`QtGraphs3D::CameraPreset::DirectlyAboveCCW45` | `19` |
`QtGraphs3D::CameraPreset::FrontBelow` | `20` | In Q3DBarsWidgetItem from FrontBelow onward these only work for graphs including negative values. They act as Preset...Low for positive-only values.
`QtGraphs3D::CameraPreset::LeftBelow` | `21` |
`QtGraphs3D::CameraPreset::RightBelow` | `22` |
`QtGraphs3D::CameraPreset::BehindBelow` | `23` |
`QtGraphs3D::CameraPreset::DirectlyBelow` | `24` | Acts as FrontLow for positive-only bars.

### enum class QtGraphs3D::ElementType

Type of an element in the graph.

Constant | Value | Description
--- | --- | ---
`QtGraphs3D::ElementType::None` | `0` | No defined element.
`QtGraphs3D::ElementType::Series` | `1` | An item in a series.
`QtGraphs3D::ElementType::AxisXLabel` | `2` | The x-axis label.
`QtGraphs3D::ElementType::AxisYLabel` | `3` | The y-axis label.
`QtGraphs3D::ElementType::AxisZLabel` | `4` | The z-axis label.
`QtGraphs3D::ElementType::CustomItem` | `5` | A custom item.

### enum class QtGraphs3D::OptimizationHint

The optimization hint for rendering.

Constant | Value | Description
--- | --- | ---
`QtGraphs3D::OptimizationHint::Default` | `0` | Provides the full feature set with instancing at a good performance.
`QtGraphs3D::OptimizationHint::Legacy` | `1` | Provides the full feature set at a reasonable performance. To be used if OptimizationHint.Default performs poorly or does not work.

### enum class QtGraphs3D::SelectionFlag
flags QtGraphs3D::SelectionFlags

Item selection modes. Values of this enumeration can be combined with OR operator.

Constant | Value | Description
--- | --- | ---
`QtGraphs3D::SelectionFlag::None` | `0x00` | Selection mode disabled.
`QtGraphs3D::SelectionFlag::Item` | `0x01` | Selection highlights a single item.
`QtGraphs3D::SelectionFlag::Row` | `0x02` | Selection highlights a single row.
`QtGraphs3D::SelectionFlag::ItemAndRow` | `Item | Row` | Combination flag for highlighting both item and row with different colors.
`QtGraphs3D::SelectionFlag::Column` | `0x04` | Selection highlights a single column.
`QtGraphs3D::SelectionFlag::ItemAndColumn` | `Item | Column` | Combination flag for highlighting both item and column with different colors.
`QtGraphs3D::SelectionFlag::RowAndColumn` | `Row | Column` | Combination flag for highlighting both row and column.
`QtGraphs3D::SelectionFlag::ItemRowAndColumn` | `Item | Row | Column` | Combination flag for highlighting item, row, and column.
`QtGraphs3D::SelectionFlag::Slice` | `0x08` | Setting this mode flag indicates that the graph should take care of the slice view handling automatically. If you wish to control the slice view yourself via Q3DScene, do not set this flag. When setting this mode flag, either `Row` or `Column` must also be set, but not both. Slicing is supported by Q3DBarsWidgetItem and Q3DSurfaceWidgetItem only. When this flag is set, slice mode is entered in the following situations: When selection is changed explicitly via series API to a visible item When selection is changed by clicking on the graph When the selection mode changes and the selected item is visible
`QtGraphs3D::SelectionFlag::MultiSeries` | `0x10` | Setting this mode means that items for all series at same position are highlighted, instead of just the selected item. The actual selection in the other series doesn't change. When setting this mode flag, one or more of the basic selection flags (`Item`, `Row`, or `Column`) must also be set. Multi-series selection is not supported for Q3DScatterWidgetItem.

The SelectionFlags type is a typedef for QFlags<SelectionFlag>. It stores an OR combination of SelectionFlag values.

### enum class QtGraphs3D::ShadowQuality

Quality of shadows.

Constant | Value | Description
--- | --- | ---
`QtGraphs3D::ShadowQuality::None` | `0` | Shadows are disabled.
`QtGraphs3D::ShadowQuality::Low` | `1` | Shadows are rendered in low quality.
`QtGraphs3D::ShadowQuality::Medium` | `2` | Shadows are rendered in medium quality.
`QtGraphs3D::ShadowQuality::High` | `3` | Shadows are rendered in high quality.
`QtGraphs3D::ShadowQuality::SoftLow` | `4` | Shadows are rendered in low quality with softened edges.
`QtGraphs3D::ShadowQuality::SoftMedium` | `5` | Shadows are rendered in medium quality with softened edges.
`QtGraphs3D::ShadowQuality::SoftHigh` | `6` | Shadows are rendered in high quality with softened edges.

## Function Documentation

### QSurfaceFormat qDefaultSurfaceFormat(bool antialias)

This convenience function can be used to create a custom surface format suitable for use by Qt Graphs graphs.

The antialias parameter specifies whether or not antialiasing is activated.

Give the surface format returned by this function to the graph constructor (C++) or set it as the window format for QQuickView (QML) before calling `show()` on it.

For example, disable antialiasing on C++ application:

     #include <QtGraphs/qutils.h>

     // ...

     Q3DBars *graph = new Q3DBars(qDefaultSurfaceFormat(false));

For example, enable antialiasing for direct rendering modes on QML application:

     #include <QtGraphs/qutils.h>

     // ...

     QQuickView viewer;
     viewer.setFormat(qDefaultSurfaceFormat(true));