Qt 5.7 | Qt Data Visualization | C++ Classes | QAbstract3DGraph

Qt 5.7.1 Reference Documentation

# QAbstract3DGraph Class

The QAbstract3DGraph class provides a window and render loop for graphs. More...

Header: | #include <QAbstract3DGraph>
Since: | QtDataVisualization 1.0
Inherited By: | Q3DBars, Q3DScatter, and Q3DSurface

- List of all members, including inherited members

## Public Types

enum | ElementType { ElementNone, ElementSeries, ElementAxisXLabel, ElementAxisYLabel, ElementAxisZLabel, ElementCustomItem }
enum | OptimizationHint { OptimizationDefault, OptimizationStatic }
flags | OptimizationHints
enum | SelectionFlag { SelectionNone, SelectionItem, SelectionRow, SelectionItemAndRow, ..., SelectionMultiSeries }
flags | SelectionFlags
enum | ShadowQuality { ShadowQualityNone, ShadowQualityLow, ShadowQualityMedium, ShadowQualityHigh, ..., ShadowQualitySoftHigh }

## Properties

activeInputHandler : QAbstract3DInputHandler * activeTheme : Q3DTheme * aspectRatio : qreal currentFps : const qreal horizontalAspectRatio : qreal locale : QLocale margin : qreal measureFps : bool optimizationHints : OptimizationHints orthoProjection : bool | polar : bool queriedGraphPosition : const QVector3D radialLabelOffset : float reflection : bool reflectivity : qreal scene : Q3DScene * const selectedElement : const ElementType selectionMode : SelectionFlags shadowQuality : ShadowQuality

## Public Functions

virtual | ~QAbstract3DGraph()
QAbstract3DInputHandler * | activeInputHandler() const
Q3DTheme * | activeTheme() const
int | addCustomItem(QCustom3DItem *item)
void | addInputHandler(QAbstract3DInputHandler *inputHandler)
void | addTheme(Q3DTheme *theme)
qreal | aspectRatio() const
void | clearSelection()
qreal | currentFps() const
QList<QCustom3DItem *> | customItems() const
bool | hasContext() const
qreal | horizontalAspectRatio() const
QList<QAbstract3DInputHandler *> | inputHandlers() const
bool | isOrthoProjection() const
bool | isPolar() const
bool | isReflection() const
QLocale | locale() const
qreal | margin() const
bool | measureFps() const
OptimizationHints | optimizationHints() const
QVector3D | queriedGraphPosition() const
float | radialLabelOffset() const
qreal | reflectivity() const
void | releaseCustomItem(QCustom3DItem *item)
void | releaseInputHandler(QAbstract3DInputHandler *inputHandler)
void | releaseTheme(Q3DTheme *theme)
void | removeCustomItem(QCustom3DItem *item)
void | removeCustomItemAt(const QVector3D &position)
void | removeCustomItems()
QImage | renderToImage(int msaaSamples = 0, const QSize &imageSize = QSize())
Q3DScene * | scene() const
QAbstract3DAxis * | selectedAxis() const
QCustom3DItem * | selectedCustomItem() const
int | selectedCustomItemIndex() const
ElementType | selectedElement() const
int | selectedLabelIndex() const
SelectionFlags | selectionMode() const
void | setActiveInputHandler(QAbstract3DInputHandler *inputHandler)
void | setActiveTheme(Q3DTheme *theme)
void | setAspectRatio(qreal ratio)
void | setHorizontalAspectRatio(qreal ratio)
void | setLocale(const QLocale &locale)
void | setMargin(qreal margin)
void | setMeasureFps(bool enable)
void | setOptimizationHints(OptimizationHints hints)
void | setOrthoProjection(bool enable)
void | setPolar(bool enable)
void | setRadialLabelOffset(float offset)
void | setReflection(bool enable)
void | setReflectivity(qreal reflectivity)
void | setSelectionMode(SelectionFlags mode)
void | setShadowQuality(ShadowQuality quality)
ShadowQuality | shadowQuality() const
virtual bool | shadowsSupported() const
QList<Q3DTheme *> | themes() const

## Signals

void | activeInputHandlerChanged(QAbstract3DInputHandler *inputHandler)
void | activeThemeChanged(Q3DTheme *theme)
void | aspectRatioChanged(qreal ratio)
void | currentFpsChanged(qreal fps)
void | horizontalAspectRatioChanged(qreal ratio)
void | localeChanged(const QLocale &locale)
void | marginChanged(qreal margin)
void | measureFpsChanged(bool enabled)
void | optimizationHintsChanged(QAbstract3DGraph::OptimizationHints hints)
void | orthoProjectionChanged(bool enabled)
void | polarChanged(bool enabled)
void | queriedGraphPositionChanged(const QVector3D &data)
void | radialLabelOffsetChanged(float offset)
void | reflectionChanged(bool enabled)
void | reflectivityChanged(qreal reflectivity)
void | selectedElementChanged(QAbstract3DGraph::ElementType type)
void | selectionModeChanged(QAbstract3DGraph::SelectionFlags mode)
void | shadowQualityChanged(QAbstract3DGraph::ShadowQuality quality)

## Related Non-Members

QSurfaceFormat | qDefaultSurfaceFormat(bool antialias = true)

## Detailed Description

The QAbstract3DGraph class provides a window and render loop for graphs.

This class subclasses a QWindow and provides render loop for graphs inheriting it.

You should not need to use this class directly, but one of its subclasses instead.

Anti-aliasing is turned on by default on C++, except in OpenGL ES2 environments, where anti-aliasing is not supported by Qt Data Visualization. To specify non-default anti-aliasing for a graph, give a custom surface format as a constructor parameter. You can use the convenience function `QtDataVisualization::qDefaultSurfaceFormat()` to create the surface format object.

Note: QAbstract3DGraph sets window flag `Qt::FramelessWindowHint` on by default. If you want to display graph windows as standalone windows with regular window frame, clear this flag after constructing the graph. For example:

      Q3DBars *graphWindow = new Q3DBars;
      graphWindow->setFlags(graphWindow->flags() ^ Qt::FramelessWindowHint);

See also Q3DBars, Q3DScatter, Q3DSurface, and Qt Data Visualization C++ Classes.

## Member Type Documentation

### enum QAbstract3DGraph::ElementType

Type of an element in the graph.

Constant | Value | Description
--- | --- | ---
`QAbstract3DGraph::ElementNone` | `0` | No defined element.
`QAbstract3DGraph::ElementSeries` | `1` | A series (i.e. an item in a series).
`QAbstract3DGraph::ElementAxisXLabel` | `2` | X axis label.
`QAbstract3DGraph::ElementAxisYLabel` | `3` | Y axis label.
`QAbstract3DGraph::ElementAxisZLabel` | `4` | Z axis label.
`QAbstract3DGraph::ElementCustomItem` | `5` | Custom item.

This enum was introduced or modified in QtDataVisualization 1.1.

### enum QAbstract3DGraph::OptimizationHint
flags QAbstract3DGraph::OptimizationHints

The optimization hint for rendering.

Constant | Value | Description
--- | --- | ---
`QAbstract3DGraph::OptimizationDefault` | `0` | Provides the full feature set at a reasonable performance.
`QAbstract3DGraph::OptimizationStatic` | `1` | Optimizes the rendering of static data sets at the expense of some features.

This enum was introduced or modified in Qt Data Visualization 1.1.

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

### enum QAbstract3DGraph::SelectionFlag
flags QAbstract3DGraph::SelectionFlags

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

Constant | Value | Description
--- | --- | ---
`QAbstract3DGraph::SelectionNone` | `0` | Selection mode disabled.
`QAbstract3DGraph::SelectionItem` | `1` | Selection highlights a single item.
`QAbstract3DGraph::SelectionRow` | `2` | Selection highlights a single row.
`QAbstract3DGraph::SelectionItemAndRow` | `SelectionItem | SelectionRow` | Combination flag for highlighting both item and row with different colors.
`QAbstract3DGraph::SelectionColumn` | `4` | Selection highlights a single column.
`QAbstract3DGraph::SelectionItemAndColumn` | `SelectionItem | SelectionColumn` | Combination flag for highlighting both item and column with different colors.
`QAbstract3DGraph::SelectionRowAndColumn` | `SelectionRow | SelectionColumn` | Combination flag for highlighting both row and column.
`QAbstract3DGraph::SelectionItemRowAndColumn` | `SelectionItem | SelectionRow | SelectionColumn` | Combination flag for highlighting item, row, and column.
`QAbstract3DGraph::SelectionSlice` | `8` | 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 `SelectionRow` or `SelectionColumn` must also be set, but not both. Slicing is supported by Q3DBars and Q3DSurface 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
`QAbstract3DGraph::SelectionMultiSeries` | `16` | 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. Multi-series selection is not supported for Q3DScatter.

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

### enum QAbstract3DGraph::ShadowQuality

Quality of shadows.

Constant | Value | Description
--- | --- | ---
`QAbstract3DGraph::ShadowQualityNone` | `0` | Shadows are disabled.
`QAbstract3DGraph::ShadowQualityLow` | `1` | Shadows are rendered in low quality.
`QAbstract3DGraph::ShadowQualityMedium` | `2` | Shadows are rendered in medium quality.
`QAbstract3DGraph::ShadowQualityHigh` | `3` | Shadows are rendered in high quality.
`QAbstract3DGraph::ShadowQualitySoftLow` | `4` | Shadows are rendered in low quality with softened edges.
`QAbstract3DGraph::ShadowQualitySoftMedium` | `5` | Shadows are rendered in medium quality with softened edges.
`QAbstract3DGraph::ShadowQualitySoftHigh` | `6` | Shadows are rendered in high quality with softened edges.

## Property Documentation

### activeInputHandler : QAbstract3DInputHandler *

The active inputHandler used in the graph. Implicitly calls addInputHandler() to transfer ownership of the inputHandler to this graph.

If the inputHandler is null, no input handler will be active after this call.

Access functions:

QAbstract3DInputHandler * | activeInputHandler() const
void | setActiveInputHandler(QAbstract3DInputHandler *inputHandler)

Notifier signal:

void | activeInputHandlerChanged(QAbstract3DInputHandler *inputHandler)

See also addInputHandler() and releaseInputHandler().

### activeTheme : Q3DTheme *

The active theme to be used for the graph. Implicitly calls addTheme() to transfer ownership of the theme to this graph. If the theme is null, a temporary default theme is created. This temporary theme is destroyed if any theme is explicitly set later. Properties of the theme can be modified even after setting it, and the modifications take effect immediately.

Access functions:

Q3DTheme * | activeTheme() const
void | setActiveTheme(Q3DTheme *theme)

Notifier signal:

void | activeThemeChanged(Q3DTheme *theme)

### aspectRatio : qreal

The aspect ratio is the ratio of the graph scaling between the longest axis on the horizontal plane and the Y-axis. Defaults to `2.0`.

Note: Has no effect on Q3DBars.

This property was introduced in QtDataVisualization 1.1.

Access functions:

qreal | aspectRatio() const
void | setAspectRatio(qreal ratio)

Notifier signal:

void | aspectRatioChanged(qreal ratio)

See also horizontalAspectRatio.

### currentFps : const qreal

When fps measuring is enabled, the results for the last second are stored in this read-only property. It takes at least a second before this value updates after measurement is activated.

This property was introduced in QtDataVisualization 1.1.

Access functions:

qreal | currentFps() const

Notifier signal:

void | currentFpsChanged(qreal fps)

See also measureFps.

### horizontalAspectRatio : qreal

The horizontal aspect ratio is the ratio of the graph scaling between the X and Z axes. Value of 0.0 indicates automatic scaling according to axis ranges. Defaults to `0.0`.

Note: Has no effect on Q3DBars, which handles scaling on the horizontal plane via barThickness and barSpacing properties. Polar graphs also ignore this property.

This property was introduced in QtDataVisualization 1.2.

Access functions:

qreal | horizontalAspectRatio() const
void | setHorizontalAspectRatio(qreal ratio)

Notifier signal:

void | horizontalAspectRatioChanged(qreal ratio)

See also aspectRatio, polar, Q3DBars::barThickness, and Q3DBars::barSpacing.

### locale : QLocale

Sets the locale used for formatting various numeric labels. Defaults to `"C"` locale.

This property was introduced in QtDataVisualization 1.2.

Access functions:

QLocale | locale() const
void | setLocale(const QLocale &locale)

Notifier signal:

void | localeChanged(const QLocale &locale)

See also QValue3DAxis::labelFormat.

### margin : qreal

This property contains the absolute value used for graph margin. The graph margin is the space left between the edge of the plottable graph area and the edge of the graph background. If the margin value is negative, the margins are determined automatically and can vary according to size of the items in the series and the type of the graph. The value is interpreted as a fraction of Y-axis range, provided the graph aspect ratios have not beed changed from the defaults. Defaults to `-1.0`.

Note: Having smaller than the automatically determined margin on scatter graph can cause the scatter items at the edges of the graph to overlap with the graph background.

Note: On scatter and surface graphs, if the margin is comparatively small to the axis label size, the positions of the edge labels of the axes are adjusted to avoid overlap with the edge labels of the neighboring axes.

This property was introduced in QtDataVisualization 1.2.

Access functions:

qreal | margin() const
void | setMargin(qreal margin)

Notifier signal:

void | marginChanged(qreal margin)

### measureFps : bool

If `true`, the rendering is done continuously instead of on demand, and currentFps property is updated. Defaults to `false`.

This property was introduced in QtDataVisualization 1.1.

Access functions:

bool | measureFps() const
void | setMeasureFps(bool enable)

Notifier signal:

void | measureFpsChanged(bool enabled)

See also currentFps.

### optimizationHints : OptimizationHints

Defines if the rendering optimization is default or static. Default mode provides the full feature set at reasonable performance. Static mode optimizes graph rendering and is ideal for large non-changing data sets. It is slower with dynamic data changes and item rotations. Selection is not optimized, so using it with massive data sets is not advisable. Static works only on the Scatter graph. Defaults to `OptimizationDefault`.

Note: On some environments, large graphs using static optimization may not render, because all of the items are rendered using a single draw call, and different graphics drivers have different maximum vertice counts per call that they support. This is mostly an issue on 32bit and/or OpenGL ES2 platforms. To work around this issue, choose an item mesh with low vertex count or use the point mesh.

Access functions:

OptimizationHints | optimizationHints() const
void | setOptimizationHints(OptimizationHints hints)

Notifier signal:

void | optimizationHintsChanged(QAbstract3DGraph::OptimizationHints hints)

See also QAbstract3DSeries::mesh.

### orthoProjection : bool

If `true`, orthographic projection will be used for displaying the graph.

Note: Orthographic projection can be used to create 2D graphs by replacing the default input handler with one that doesn't allow rotating the graph and setting the camera to view the graph directly from the side or from the top. Also, axis labels typically need to be rotated when viewing the graph from the sides. Defaults to `false`.

Note: Shadows will be disabled when set to `true`.

This property was introduced in QtDataVisualization 1.1.

Access functions:

bool | isOrthoProjection() const
void | setOrthoProjection(bool enable)

Notifier signal:

void | orthoProjectionChanged(bool enabled)

See also QAbstract3DAxis::labelAutoRotation and Q3DCamera::cameraPreset.

### polar : bool

If `true`, the horizontal axes are changed into polar axes. The X axis becomes the angular axis and the Z axis becomes the radial axis. Polar mode is not available for bar graphs.

Defaults to `false`.

This property was introduced in QtDataVisualization 1.2.

Access functions:

bool | isPolar() const
void | setPolar(bool enable)

Notifier signal:

void | polarChanged(bool enabled)

See also orthoProjection and radialLabelOffset.

### queriedGraphPosition : const QVector3D

This read-only property contains the latest graph position values along each axis queried using Q3DScene::graphPositionQuery. The values are normalized to range `[-1, 1]`. If the queried position was outside the graph bounds, the values will not reflect the real position, but will instead be some undefined position outside the range `[-1, 1]`. The value will be undefined before any queries are made.

There isn't a single correct 3D coordinate to match to each specific 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 only allow querying graph position at the graph floor level, so the Y-value is always zero for bar graphs and the valid queries can be only made at screen positions that contain the floor of the graph.

This property was introduced in QtDataVisualization 1.2.

Access functions:

QVector3D | queriedGraphPosition() const

Notifier signal:

void | queriedGraphPositionChanged(const QVector3D &data)

See also Q3DScene::graphPositionQuery.

### radialLabelOffset : float

This property specifies the normalized horizontal offset for the axis labels of the radial polar axis. The value 0.0 indicates the labels should be drawn next to the 0-angle angular axis grid line. The value 1.0 indicates the labels are drawn on their normal place at the edge of the graph background. This property is ignored if polar property value is `false`. Defaults to 1.0.

This property was introduced in QtDataVisualization 1.2.

Access functions:

float | radialLabelOffset() const
void | setRadialLabelOffset(float offset)

Notifier signal:

void | radialLabelOffsetChanged(float offset)

See also polar.

### reflection : bool

Sets floor reflections on or off. Defaults to `false`.

Note: Affects only Q3DBars.

Note: In Q3DBars graphs holding both positive and negative values, reflections are not supported for custom items that intersect the floor plane. In that case, reflections should be turned off to avoid incorrect rendering.

Note: If using custom surface format, stencil buffer needs to be defined (QSurfaceFormat::setStencilBufferSize()) for reflections to work.

This property was introduced in QtDataVisualization 1.2.

Access functions:

bool | isReflection() const
void | setReflection(bool enable)

Notifier signal:

void | reflectionChanged(bool enabled)

See also reflectivity.

### reflectivity : qreal

Adjusts floor reflectivity, larger number being more reflective. Valid range is `[0...1]`. Defaults to `0.5`.

Note: Affects only Q3DBars.

This property was introduced in QtDataVisualization 1.2.

Access functions:

qreal | reflectivity() const
void | setReflectivity(qreal reflectivity)

Notifier signal:

void | reflectivityChanged(qreal reflectivity)

See also reflection.

### scene : Q3DScene * const

This property is read-only and contains the Q3DScene pointer that can be used to manipulate the scene and access the scene elements, such as the active camera.

Access functions:

Q3DScene * | scene() const

### selectedElement : const ElementType

Can be used to query the selected element type. Type is valid until the next `selectedElementChanged` signal.

`selectedElementChanged` signal is emitted when a selection is made in the graph.

Signal can be used for example for implementing custom input handlers, as demonstrated in this example.

This property was introduced in QtDataVisualization 1.1.

Access functions:

ElementType | selectedElement() const

Notifier signal:

void | selectedElementChanged(QAbstract3DGraph::ElementType type)

See also selectedLabelIndex(), selectedAxis(), selectedCustomItemIndex(), selectedCustomItem(), Q3DBars::selectedSeries(), Q3DScatter::selectedSeries(), Q3DSurface::selectedSeries(), and Q3DScene::setSelectionQueryPosition().

### selectionMode : SelectionFlags

Sets selection mode to a combination of SelectionFlags. It is preset to `SelectionItem` by default. Different graph types support different selection modes. See SelectionFlags documentation for details.

Access functions:

SelectionFlags | selectionMode() const
void | setSelectionMode(SelectionFlags mode)

Notifier signal:

void | selectionModeChanged(QAbstract3DGraph::SelectionFlags mode)

### shadowQuality : ShadowQuality

Sets the shadow quality to one of the ShadowQuality enum values. It is preset to `ShadowQualityMedium` by default.

Note: If setting the shadow quality to a certain level fails, the level is lowered until it is successfully set. The `shadowQualityChanged` signal is emitted for each time a change is done.

Access functions:

ShadowQuality | shadowQuality() const
void | setShadowQuality(ShadowQuality quality)

Notifier signal:

void | shadowQualityChanged(QAbstract3DGraph::ShadowQuality quality)

## Member Function Documentation

### `[virtual]` QAbstract3DGraph::~QAbstract3DGraph()

Destroys QAbstract3DGraph.

### int QAbstract3DGraph::addCustomItem(QCustom3DItem *item)

Adds a QCustom3DItem item to the graph. Graph takes ownership of the added item.

Returns index to the added item if add was successful, -1 if trying to add a null item, and index of the item if trying to add an already added item.

This function was introduced in QtDataVisualization 1.1.

See also removeCustomItems(), removeCustomItem(), removeCustomItemAt(), and customItems().

### void QAbstract3DGraph::addInputHandler(QAbstract3DInputHandler *inputHandler)

Adds the given inputHandler to the graph. The input handlers added via addInputHandler are not taken in to use directly. Only the ownership of the inputHandler is given to the graph. The inputHandler must not be null or already added to another graph.

See also releaseInputHandler() and setActiveInputHandler().

### void QAbstract3DGraph::addTheme(Q3DTheme *theme)

Adds the given theme to the graph. The themes added via addTheme are not taken in to use directly. Only the ownership of the a theme is given to the graph. The theme must not be null or already added to another graph.

See also releaseTheme() and setActiveTheme().

### void QAbstract3DGraph::clearSelection()

Clears selection from all attached series.

### QList<QCustom3DItem *> QAbstract3DGraph::customItems() const

Returns list of all added custom items.

This function was introduced in QtDataVisualization 1.2.

See also addCustomItem().

### bool QAbstract3DGraph::hasContext() const

Returns `true` if the OpenGL context of the graph has been successfully initialized. Trying to use a graph when the context initialization has failed typically results in a crash. A common reason for a context initialization failure is lack of sufficient platform support for OpenGL.

### QList<QAbstract3DInputHandler *> QAbstract3DGraph::inputHandlers() const

Returns list of all added input handlers.

See also addInputHandler().

### void QAbstract3DGraph::releaseCustomItem(QCustom3DItem *item)

Gets ownership of given item back and removes the item from the graph.

Note: If the same item is added back to the graph, the texture or the texture file needs to be re-set.

This function was introduced in QtDataVisualization 1.1.

See also QCustom3DItem::setTextureImage() and QCustom3DItem::setTextureFile().

### void QAbstract3DGraph::releaseInputHandler(QAbstract3DInputHandler *inputHandler)

Releases the ownership of the inputHandler back to the caller, if it was added to this graph. If the released inputHandler is in use there will be no input handler active after this call.

If the default input handler is released and added back later, it behaves as any other input handler would.

See also addInputHandler() and setActiveInputHandler().

### void QAbstract3DGraph::releaseTheme(Q3DTheme *theme)

Releases the ownership of the theme back to the caller, if it was added to this graph. If the released theme is in use, a new default theme will be created and set active.

If the default theme is released and added back later, it behaves as any other theme would.

See also addTheme() and setActiveTheme().

### void QAbstract3DGraph::removeCustomItem(QCustom3DItem *item)

Removes the custom item. Deletes the resources allocated to it.

This function was introduced in QtDataVisualization 1.1.

### void QAbstract3DGraph::removeCustomItemAt(const QVector3D &position)

Removes all custom items at position. Deletes the resources allocated to them.

This function was introduced in QtDataVisualization 1.1.

### void QAbstract3DGraph::removeCustomItems()

Removes all custom items. Deletes the resources allocated to them.

This function was introduced in QtDataVisualization 1.1.

### QImage QAbstract3DGraph::renderToImage(int msaaSamples = 0, const QSize &imageSize = QSize())

Renders current frame to an image of imageSize. Default size is the window size. Image is rendered with antialiasing level given in msaaSamples. Default level is `0`.

Returns rendered image.

Note: OpenGL ES2 does not support anitialiasing, so msaaSamples is always forced to `0`.

This function was introduced in QtDataVisualization 1.1.

### QAbstract3DAxis *QAbstract3DGraph::selectedAxis() const

Can be used to get the selected axis after receiving `selectedElementChanged` signal with any label type. Selection is valid until the next `selectedElementChanged` signal.

Returns pointer to the selected axis, or null.

This function was introduced in QtDataVisualization 1.1.

See also selectedElement.

### QCustom3DItem *QAbstract3DGraph::selectedCustomItem() const

Can be used to get the selected custom item after receiving `selectedElementChanged` signal with QAbstract3DGraph::ElementCustomItem type. Ownership of the item remains with the graph. Selection is valid until the next `selectedElementChanged` signal.

Returns pointer to the selected custom item, or null.

This function was introduced in QtDataVisualization 1.1.

See also selectedElement.

### int QAbstract3DGraph::selectedCustomItemIndex() const

Can be used to query the index of the selected custom item after receiving `selectedElementChanged` signal with QAbstract3DGraph::ElementCustomItem type. Selection is valid until the next `selectedElementChanged` signal.

Returns index of the selected custom item, or -1.

This function was introduced in QtDataVisualization 1.1.

See also selectedElement.

### int QAbstract3DGraph::selectedLabelIndex() const

Can be used to query the index of the selected label after receiving `selectedElementChanged` signal with any label type. Selection is valid until the next `selectedElementChanged` signal.

Returns index of the selected label, or -1.

This function was introduced in QtDataVisualization 1.1.

See also selectedElement.

### `[virtual]` bool QAbstract3DGraph::shadowsSupported() const

Returns true if shadows are supported with the current configuration. OpenGL ES2 configurations do not support shadows.

### QList<Q3DTheme *> QAbstract3DGraph::themes() const

Returns list of all added themes.

See also addTheme().

## Related Non-Members

### `[static]` QSurfaceFormat QtDataVisualization::qDefaultSurfaceFormat(bool antialias = true)

This convenience function can be used to create a custom surface format suitable for use by Qt Data Visualization 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 <QtDataVisualization/qutils.h>

      // ...

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

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

      #include <QtDataVisualization/qutils.h>

      // ...

      QQuickView viewer;
      viewer.setFormat(QtDataVisualization::qDefaultSurfaceFormat());

Note: Antialiasing is not supported in OpenGL ES2 environments.