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

Types

enum class CameraPreset { NoPreset, FrontLow, Front, FrontHigh, LeftLow, …, DirectlyBelow }
enum class ElementType { None, Series, AxisXLabel, AxisYLabel, AxisZLabel, CustomItem }
enum class OptimizationHint { Default, Legacy }

Functions

int qDefaultSurfaceFormat(bool antialias)

Detailed Description

Type Documentation

enum class QtGraphs3D::CameraPreset

Predefined positions for camera.

ConstantValueDescription
QtGraphs3D::CameraPreset::NoPreset0Used to indicate a preset has not been set, or the scene has been rotated freely.
QtGraphs3D::CameraPreset::FrontLow1 
QtGraphs3D::CameraPreset::Front2 
QtGraphs3D::CameraPreset::FrontHigh3 
QtGraphs3D::CameraPreset::LeftLow4 
QtGraphs3D::CameraPreset::Left5 
QtGraphs3D::CameraPreset::LeftHigh6 
QtGraphs3D::CameraPreset::RightLow7 
QtGraphs3D::CameraPreset::Right8 
QtGraphs3D::CameraPreset::RightHigh9 
QtGraphs3D::CameraPreset::BehindLow10 
QtGraphs3D::CameraPreset::Behind11 
QtGraphs3D::CameraPreset::BehindHigh12 
QtGraphs3D::CameraPreset::IsometricLeft13 
QtGraphs3D::CameraPreset::IsometricLeftHigh14 
QtGraphs3D::CameraPreset::IsometricRight15 
QtGraphs3D::CameraPreset::IsometricRightHigh16 
QtGraphs3D::CameraPreset::DirectlyAbove17 
QtGraphs3D::CameraPreset::DirectlyAboveCW4518 
QtGraphs3D::CameraPreset::DirectlyAboveCCW4519 
QtGraphs3D::CameraPreset::FrontBelow20In Q3DBarsWidgetItem from FrontBelow onward these only work for graphs including negative values. They act as Preset...Low for positive-only values.
QtGraphs3D::CameraPreset::LeftBelow21 
QtGraphs3D::CameraPreset::RightBelow22 
QtGraphs3D::CameraPreset::BehindBelow23 
QtGraphs3D::CameraPreset::DirectlyBelow24Acts as FrontLow for positive-only bars.

enum class QtGraphs3D::ElementType

Type of an element in the graph.

ConstantValueDescription
QtGraphs3D::ElementType::None0No defined element.
QtGraphs3D::ElementType::Series1An item in a series.
QtGraphs3D::ElementType::AxisXLabel2The x-axis label.
QtGraphs3D::ElementType::AxisYLabel3The y-axis label.
QtGraphs3D::ElementType::AxisZLabel4The z-axis label.
QtGraphs3D::ElementType::CustomItem5A custom item.

enum class QtGraphs3D::OptimizationHint

The optimization hint for rendering.

ConstantValueDescription
QtGraphs3D::OptimizationHint::Default0Provides the full feature set with instancing at a good performance.
QtGraphs3D::OptimizationHint::Legacy1Provides the full feature set at a reasonable performance. To be used if OptimizationHint.Default performs poorly or does not work.

Function Documentation

int 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));