QAbstract3DGraph

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

Inheritance diagram of PySide6.QtDataVisualization.QAbstract3DGraph

Inherited by: Q3DSurface, Q3DScatter, Q3DBars

Synopsis

Functions

Virtual functions

Detailed Description

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);
class PySide6.QtDataVisualization.QAbstract3DGraph
PySide6.QtDataVisualization.QAbstract3DGraph.SelectionFlag

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

  • QAbstract3DGraph.SelectionMultiSeries

  • 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 .

PySide6.QtDataVisualization.QAbstract3DGraph.ShadowQuality

Quality of shadows.

Constant

Description

QAbstract3DGraph.ShadowQualityNone

Shadows are disabled.

QAbstract3DGraph.ShadowQualityLow

Shadows are rendered in low quality.

QAbstract3DGraph.ShadowQualityMedium

Shadows are rendered in medium quality.

QAbstract3DGraph.ShadowQualityHigh

Shadows are rendered in high quality.

QAbstract3DGraph.ShadowQualitySoftLow

Shadows are rendered in low quality with softened edges.

QAbstract3DGraph.ShadowQualitySoftMedium

Shadows are rendered in medium quality with softened edges.

QAbstract3DGraph.ShadowQualitySoftHigh

Shadows are rendered in high quality with softened edges.

PySide6.QtDataVisualization.QAbstract3DGraph.ElementType

Type of an element in the graph.

Constant

Description

QAbstract3DGraph.ElementNone

No defined element.

QAbstract3DGraph.ElementSeries

A series (that is, an item in a series).

QAbstract3DGraph.ElementAxisXLabel

The x-axis label.

QAbstract3DGraph.ElementAxisYLabel

The y-axis label.

QAbstract3DGraph.ElementAxisZLabel

The z-axis label.

QAbstract3DGraph.ElementCustomItem

A custom item.

PySide6.QtDataVisualization.QAbstract3DGraph.OptimizationHint

The optimization hint for rendering.

Constant

Description

QAbstract3DGraph.OptimizationDefault

Provides the full feature set at a reasonable performance.

QAbstract3DGraph.OptimizationStatic

Optimizes the rendering of static data sets at the expense of some features.

PySide6.QtDataVisualization.QAbstract3DGraph.activeInputHandler()
Return type

PySide6.QtDataVisualization.QAbstract3DInputHandler

PySide6.QtDataVisualization.QAbstract3DGraph.activeInputHandlerChanged(inputHandler)
Parameters

inputHandlerPySide6.QtDataVisualization.QAbstract3DInputHandler

PySide6.QtDataVisualization.QAbstract3DGraph.activeTheme()
Return type

PySide6.QtDataVisualization.Q3DTheme

See also

setActiveTheme()

PySide6.QtDataVisualization.QAbstract3DGraph.activeThemeChanged(theme)
Parameters

themePySide6.QtDataVisualization.Q3DTheme

PySide6.QtDataVisualization.QAbstract3DGraph.addCustomItem(item)
Parameters

itemPySide6.QtDataVisualization.QCustom3DItem

Return type

int

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

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

Items are rendered in the order they have been inserted. The rendering order needs to be taken into account when having solid and transparent items.

PySide6.QtDataVisualization.QAbstract3DGraph.addInputHandler(inputHandler)
Parameters

inputHandlerPySide6.QtDataVisualization.QAbstract3DInputHandler

Adds the given inputHandler to the graph. The input handlers added via 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.

PySide6.QtDataVisualization.QAbstract3DGraph.addTheme(theme)
Parameters

themePySide6.QtDataVisualization.Q3DTheme

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

PySide6.QtDataVisualization.QAbstract3DGraph.aspectRatio()
Return type

float

See also

setAspectRatio()

PySide6.QtDataVisualization.QAbstract3DGraph.aspectRatioChanged(ratio)
Parameters

ratio – float

PySide6.QtDataVisualization.QAbstract3DGraph.clearSelection()

Clears selection from all attached series.

PySide6.QtDataVisualization.QAbstract3DGraph.currentFps()
Return type

float

PySide6.QtDataVisualization.QAbstract3DGraph.currentFpsChanged(fps)
Parameters

fps – float

PySide6.QtDataVisualization.QAbstract3DGraph.customItems()
Return type

Returns the list of all added custom items.

See also

addCustomItem()

PySide6.QtDataVisualization.QAbstract3DGraph.hasContext()
Return type

bool

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.

PySide6.QtDataVisualization.QAbstract3DGraph.horizontalAspectRatio()
Return type

float

PySide6.QtDataVisualization.QAbstract3DGraph.horizontalAspectRatioChanged(ratio)
Parameters

ratio – float

PySide6.QtDataVisualization.QAbstract3DGraph.inputHandlers()
Return type

Returns the list of all added input handlers.

PySide6.QtDataVisualization.QAbstract3DGraph.isOrthoProjection()
Return type

bool

PySide6.QtDataVisualization.QAbstract3DGraph.isPolar()
Return type

bool

PySide6.QtDataVisualization.QAbstract3DGraph.isReflection()
Return type

bool

PySide6.QtDataVisualization.QAbstract3DGraph.locale()
Return type

PySide6.QtCore.QLocale

See also

setLocale()

PySide6.QtDataVisualization.QAbstract3DGraph.localeChanged(locale)
Parameters

localePySide6.QtCore.QLocale

PySide6.QtDataVisualization.QAbstract3DGraph.margin()
Return type

float

See also

setMargin()

PySide6.QtDataVisualization.QAbstract3DGraph.marginChanged(margin)
Parameters

margin – float

PySide6.QtDataVisualization.QAbstract3DGraph.measureFps()
Return type

bool

See also

setMeasureFps()

PySide6.QtDataVisualization.QAbstract3DGraph.measureFpsChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.QAbstract3DGraph.optimizationHints()
Return type

OptimizationHints

PySide6.QtDataVisualization.QAbstract3DGraph.optimizationHintsChanged(hints)
Parameters

hintsOptimizationHints

PySide6.QtDataVisualization.QAbstract3DGraph.orthoProjectionChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.QAbstract3DGraph.polarChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.QAbstract3DGraph.queriedGraphPosition()
Return type

PySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QAbstract3DGraph.queriedGraphPositionChanged(data)
Parameters

dataPySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QAbstract3DGraph.radialLabelOffset()
Return type

float

PySide6.QtDataVisualization.QAbstract3DGraph.radialLabelOffsetChanged(offset)
Parameters

offset – float

PySide6.QtDataVisualization.QAbstract3DGraph.reflectionChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.QAbstract3DGraph.reflectivity()
Return type

float

PySide6.QtDataVisualization.QAbstract3DGraph.reflectivityChanged(reflectivity)
Parameters

reflectivity – float

PySide6.QtDataVisualization.QAbstract3DGraph.releaseCustomItem(item)
Parameters

itemPySide6.QtDataVisualization.QCustom3DItem

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.

PySide6.QtDataVisualization.QAbstract3DGraph.releaseInputHandler(inputHandler)
Parameters

inputHandlerPySide6.QtDataVisualization.QAbstract3DInputHandler

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.

PySide6.QtDataVisualization.QAbstract3DGraph.releaseTheme(theme)
Parameters

themePySide6.QtDataVisualization.Q3DTheme

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.

PySide6.QtDataVisualization.QAbstract3DGraph.removeCustomItem(item)
Parameters

itemPySide6.QtDataVisualization.QCustom3DItem

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

PySide6.QtDataVisualization.QAbstract3DGraph.removeCustomItemAt(position)
Parameters

positionPySide6.QtGui.QVector3D

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

PySide6.QtDataVisualization.QAbstract3DGraph.removeCustomItems()

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

PySide6.QtDataVisualization.QAbstract3DGraph.renderToImage([msaaSamples=0[, imageSize=QSize()]])
Parameters
Return type

PySide6.QtGui.QImage

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 the rendered image.

Note

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

PySide6.QtDataVisualization.QAbstract3DGraph.scene()
Return type

PySide6.QtDataVisualization.Q3DScene

PySide6.QtDataVisualization.QAbstract3DGraph.selectedAxis()
Return type

PySide6.QtDataVisualization.QAbstract3DAxis

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 the pointer to the selected axis, or null.

See also

selectedElement

PySide6.QtDataVisualization.QAbstract3DGraph.selectedCustomItem()
Return type

PySide6.QtDataVisualization.QCustom3DItem

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

Returns the pointer to the selected custom item, or null.

See also

selectedElement

PySide6.QtDataVisualization.QAbstract3DGraph.selectedCustomItemIndex()
Return type

int

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

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

See also

selectedElement

PySide6.QtDataVisualization.QAbstract3DGraph.selectedElement()
Return type

ElementType

PySide6.QtDataVisualization.QAbstract3DGraph.selectedElementChanged(type)
Parameters

typeElementType

PySide6.QtDataVisualization.QAbstract3DGraph.selectedLabelIndex()
Return type

int

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 the index of the selected label, or -1.

See also

selectedElement

PySide6.QtDataVisualization.QAbstract3DGraph.selectionMode()
Return type

SelectionFlags

PySide6.QtDataVisualization.QAbstract3DGraph.selectionModeChanged(mode)
Parameters

modeSelectionFlags

PySide6.QtDataVisualization.QAbstract3DGraph.setActiveInputHandler(inputHandler)
Parameters

inputHandlerPySide6.QtDataVisualization.QAbstract3DInputHandler

Sets inputHandler as the active input handler used in the graph. Implicitly calls addInputHandler() to transfer ownership of inputHandler to this graph.

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

PySide6.QtDataVisualization.QAbstract3DGraph.setActiveTheme(theme)
Parameters

themePySide6.QtDataVisualization.Q3DTheme

Sets theme as the active theme to be used for the graph. Implicitly calls addTheme() to transfer the ownership of the theme to this graph.

If 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.

See also

activeTheme()

PySide6.QtDataVisualization.QAbstract3DGraph.setAspectRatio(ratio)
Parameters

ratio – float

See also

aspectRatio()

PySide6.QtDataVisualization.QAbstract3DGraph.setHorizontalAspectRatio(ratio)
Parameters

ratio – float

PySide6.QtDataVisualization.QAbstract3DGraph.setLocale(locale)
Parameters

localePySide6.QtCore.QLocale

See also

locale()

PySide6.QtDataVisualization.QAbstract3DGraph.setMargin(margin)
Parameters

margin – float

See also

margin()

PySide6.QtDataVisualization.QAbstract3DGraph.setMeasureFps(enable)
Parameters

enable – bool

See also

measureFps()

PySide6.QtDataVisualization.QAbstract3DGraph.setOptimizationHints(hints)
Parameters

hintsOptimizationHints

PySide6.QtDataVisualization.QAbstract3DGraph.setOrthoProjection(enable)
Parameters

enable – bool

PySide6.QtDataVisualization.QAbstract3DGraph.setPolar(enable)
Parameters

enable – bool

See also

isPolar()

PySide6.QtDataVisualization.QAbstract3DGraph.setRadialLabelOffset(offset)
Parameters

offset – float

PySide6.QtDataVisualization.QAbstract3DGraph.setReflection(enable)
Parameters

enable – bool

See also

isReflection()

PySide6.QtDataVisualization.QAbstract3DGraph.setReflectivity(reflectivity)
Parameters

reflectivity – float

See also

reflectivity()

PySide6.QtDataVisualization.QAbstract3DGraph.setSelectionMode(mode)
Parameters

modeSelectionFlags

See also

selectionMode()

PySide6.QtDataVisualization.QAbstract3DGraph.setShadowQuality(quality)
Parameters

qualityShadowQuality

See also

shadowQuality()

PySide6.QtDataVisualization.QAbstract3DGraph.shadowQuality()
Return type

ShadowQuality

PySide6.QtDataVisualization.QAbstract3DGraph.shadowQualityChanged(quality)
Parameters

qualityShadowQuality

PySide6.QtDataVisualization.QAbstract3DGraph.shadowsSupported()
Return type

bool

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

PySide6.QtDataVisualization.QAbstract3DGraph.themes()
Return type

Returns the list of all added themes.

See also

addTheme()