QAbstract3DSeries Class
The QAbstract3DSeries class is a base class for all 3D data series. More...
Header: | #include <QAbstract3DSeries> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
qmake: | QT += graphs |
In QML: | Abstract3DSeries |
Inherits: | QObject |
Inherited By: |
- List of all members, including inherited members
- QAbstract3DSeries is part of Qt Graphs C++ Classes for 3D.
Public Types
enum class | Mesh { UserDefined, Bar, Cube, Pyramid, Cone, …, Point } |
enum class | SeriesType { None, Bar, Scatter, Surface } |
Properties
|
|
Public Functions
virtual | ~QAbstract3DSeries() override |
QColor | baseColor() const |
QLinearGradient | baseGradient() const |
QGraphsTheme::ColorStyle | colorStyle() const |
bool | isItemLabelVisible() const |
bool | isMeshSmooth() const |
bool | isVisible() const |
QString | itemLabel() |
QString | itemLabelFormat() const |
QAbstract3DSeries::Mesh | mesh() const |
QQuaternion | meshRotation() const |
QColor | multiHighlightColor() const |
QLinearGradient | multiHighlightGradient() const |
QString | name() const |
void | setBaseColor(QColor color) |
void | setBaseGradient(const QLinearGradient &gradient) |
void | setColorStyle(QGraphsTheme::ColorStyle style) |
void | setItemLabelFormat(const QString &format) |
void | setItemLabelVisible(bool visible) |
void | setMesh(QAbstract3DSeries::Mesh mesh) |
void | setMeshAxisAndAngle(QVector3D axis, float angle) |
void | setMeshRotation(const QQuaternion &rotation) |
void | setMeshSmooth(bool enable) |
void | setMultiHighlightColor(QColor color) |
void | setMultiHighlightGradient(const QLinearGradient &gradient) |
void | setName(const QString &name) |
void | setSingleHighlightColor(QColor color) |
void | setSingleHighlightGradient(const QLinearGradient &gradient) |
void | setUserDefinedMesh(const QString &fileName) |
void | setVisible(bool visible) |
QColor | singleHighlightColor() const |
QLinearGradient | singleHighlightGradient() const |
QAbstract3DSeries::SeriesType | type() const |
QString | userDefinedMesh() const |
Signals
void | baseColorChanged(QColor color) |
void | baseGradientChanged(const QLinearGradient &gradient) |
void | colorStyleChanged(QGraphsTheme::ColorStyle style) |
void | itemLabelChanged(const QString &label) |
void | itemLabelFormatChanged(const QString &format) |
void | itemLabelVisibleChanged(bool visible) |
void | meshChanged(QAbstract3DSeries::Mesh mesh) |
void | meshRotationChanged(const QQuaternion &rotation) |
void | meshSmoothChanged(bool enabled) |
void | multiHighlightColorChanged(QColor color) |
void | multiHighlightGradientChanged(const QLinearGradient &gradient) |
void | nameChanged(const QString &name) |
void | singleHighlightColorChanged(QColor color) |
void | singleHighlightGradientChanged(const QLinearGradient &gradient) |
void | userDefinedMeshChanged(const QString &fileName) |
void | visibleChanged(bool visible) |
Detailed Description
There are inherited classes for each supported series type: QBar3DSeries, QScatter3DSeries, and QSurface3DSeries.
For more information, see Qt Graphs Data Handling with 3D.
Member Type Documentation
enum class QAbstract3DSeries::Mesh
Predefined mesh types. All styles are not usable with all graphs types.
Constant | Value | Description |
---|---|---|
QAbstract3DSeries::Mesh::UserDefined | 0 | User defined mesh, set via QAbstract3DSeries::userDefinedMesh property. |
QAbstract3DSeries::Mesh::Bar | 1 | Basic rectangular bar. |
QAbstract3DSeries::Mesh::Cube | 2 | Basic cube. |
QAbstract3DSeries::Mesh::Pyramid | 3 | Four-sided pyramid. |
QAbstract3DSeries::Mesh::Cone | 4 | Basic cone. |
QAbstract3DSeries::Mesh::Cylinder | 5 | Basic cylinder. |
QAbstract3DSeries::Mesh::BevelBar | 6 | Slightly beveled (rounded) rectangular bar. |
QAbstract3DSeries::Mesh::BevelCube | 7 | Slightly beveled (rounded) cube. |
QAbstract3DSeries::Mesh::Sphere | 8 | Sphere. |
QAbstract3DSeries::Mesh::Minimal | 9 | The minimal 3D mesh: a triangular pyramid. Usable only with Q3DScatterWidgetItem. |
QAbstract3DSeries::Mesh::Arrow | 10 | Arrow pointing upwards. |
QAbstract3DSeries::Mesh::Point | 11 | 2D point. Usable only with Q3DScatterWidgetItem. Shadows do not affect this style. Color style QGraphsTheme::ColorStyle::ObjectGradient is not supported by this style. |
enum class QAbstract3DSeries::SeriesType
Type of the series.
Constant | Value | Description |
---|---|---|
QAbstract3DSeries::SeriesType::None | 0 | No series type. |
QAbstract3DSeries::SeriesType::Bar | 1 | Series type for Q3DBarsWidgetItem. |
QAbstract3DSeries::SeriesType::Scatter | 2 | Series type for Q3DScatterWidgetItem. |
QAbstract3DSeries::SeriesType::Surface | 3 | Series type for Q3DSurfaceWidgetItem. |
Property Documentation
baseColor : QColor
This property holds the base color of the series.
Access functions:
QColor | baseColor() const |
void | setBaseColor(QColor color) |
Notifier signal:
void | baseColorChanged(QColor color) |
See also colorStyle and QGraphsTheme::seriesColors.
baseGradient : QLinearGradient
This property holds the base gradient of the series.
Access functions:
QLinearGradient | baseGradient() const |
void | setBaseGradient(const QLinearGradient &gradient) |
Notifier signal:
void | baseGradientChanged(const QLinearGradient &gradient) |
See also colorStyle and QGraphsTheme::seriesGradients.
colorStyle : QGraphsTheme::ColorStyle
This property holds the color style for the series.
Access functions:
QGraphsTheme::ColorStyle | colorStyle() const |
void | setColorStyle(QGraphsTheme::ColorStyle style) |
Notifier signal:
void | colorStyleChanged(QGraphsTheme::ColorStyle style) |
See also QGraphsTheme::ColorStyle.
[read-only]
itemLabel : const QString
This property holds the formatted item label.
If there is no selected item or the selected item is not visible, returns an empty string.
Access functions:
QString | itemLabel() |
Notifier signal:
void | itemLabelChanged(const QString &label) |
See also itemLabelFormat.
itemLabelFormat : QString
This property holds the label format for data items in this series.
This format is used for single item labels, for example, when an item is selected. How the format is interpreted depends on series type: QBar3DSeries, QScatter3DSeries, QSurface3DSeries.
Access functions:
QString | itemLabelFormat() const |
void | setItemLabelFormat(const QString &format) |
Notifier signal:
void | itemLabelFormatChanged(const QString &format) |
itemLabelVisible : bool
This property holds the visibility of item labels in the graph.
If true
, item labels are drawn as floating labels in the graph. Otherwise, item labels are not drawn. To show the item label in an external control, this property is set to false
. Defaults to true
.
Access functions:
bool | isItemLabelVisible() const |
void | setItemLabelVisible(bool visible) |
Notifier signal:
void | itemLabelVisibleChanged(bool visible) |
See also itemLabelFormat and itemLabel.
mesh : QAbstract3DSeries::Mesh
This property holds the mesh of the items in the series.
For QSurface3DSeries, this property holds the selection pointer.
If the mesh is MeshUserDefined, then the userDefinedMesh property must also be set for items to render properly. The default value depends on the graph type.
Access functions:
QAbstract3DSeries::Mesh | mesh() const |
void | setMesh(QAbstract3DSeries::Mesh mesh) |
Notifier signal:
void | meshChanged(QAbstract3DSeries::Mesh mesh) |
meshRotation : QQuaternion
This property holds the mesh rotation that is applied to all items of the series.
The rotation should be a normalized QQuaternion. For those series types that support item specific rotation, the rotations are multiplied together. QBar3DSeries ignores any rotation that is not around the y-axis. QSurface3DSeries applies the rotation only to the selection pointer. Defaults to no rotation.
Access functions:
QQuaternion | meshRotation() const |
void | setMeshRotation(const QQuaternion &rotation) |
Notifier signal:
void | meshRotationChanged(const QQuaternion &rotation) |
meshSmooth : bool
This property holds whether smooth versions of predefined meshes are used.
If true
, smooth versions set via the mesh property are used. This property does not affect custom meshes used when the mesh is set to MeshUserDefined. Defaults to false
.
Access functions:
bool | isMeshSmooth() const |
void | setMeshSmooth(bool enable) |
Notifier signal:
void | meshSmoothChanged(bool enabled) |
multiHighlightColor : QColor
This property holds the multiple item highlight color of the series.
Access functions:
QColor | multiHighlightColor() const |
void | setMultiHighlightColor(QColor color) |
Notifier signal:
void | multiHighlightColorChanged(QColor color) |
See also colorStyle and QGraphsTheme::multiHighlightColor.
multiHighlightGradient : QLinearGradient
This property holds the multiple item highlight gradient of the series.
Access functions:
QLinearGradient | multiHighlightGradient() const |
void | setMultiHighlightGradient(const QLinearGradient &gradient) |
Notifier signal:
void | multiHighlightGradientChanged(const QLinearGradient &gradient) |
See also colorStyle and QGraphsTheme::multiHighlightGradient.
name : QString
This property holds the series name.
The series name can be used in item label format with the tag @seriesName
.
Access functions:
QString | name() const |
void | setName(const QString &name) |
Notifier signal:
void | nameChanged(const QString &name) |
See also itemLabelFormat.
singleHighlightColor : QColor
This property holds the single item highlight color of the series.
Access functions:
QColor | singleHighlightColor() const |
void | setSingleHighlightColor(QColor color) |
Notifier signal:
void | singleHighlightColorChanged(QColor color) |
See also colorStyle and QGraphsTheme::singleHighlightColor.
singleHighlightGradient : QLinearGradient
This property holds the single item highlight gradient of the series.
Access functions:
QLinearGradient | singleHighlightGradient() const |
void | setSingleHighlightGradient(const QLinearGradient &gradient) |
Notifier signal:
void | singleHighlightGradientChanged(const QLinearGradient &gradient) |
See also colorStyle and QGraphsTheme::singleHighlightGradient.
[read-only]
type : const QAbstract3DSeries::SeriesType
This property holds the type of the series.
Access functions:
QAbstract3DSeries::SeriesType | type() const |
userDefinedMesh : QString
This property holds the filename for a user defined custom mesh for objects.
The custom mesh is used when mesh is MeshUserDefined.
Note: The file needs to be in the QtQuick3D mesh format. Use the balsam
conversion tool to create a mesh from other 3D model formats.
Access functions:
QString | userDefinedMesh() const |
void | setUserDefinedMesh(const QString &fileName) |
Notifier signal:
void | userDefinedMeshChanged(const QString &fileName) |
visible : bool
This property holds the visibility of the series.
If this property is false
, the series is not rendered. Defaults to true
.
Access functions:
bool | isVisible() const |
void | setVisible(bool visible) |
Notifier signal:
void | visibleChanged(bool visible) |
Member Function Documentation
[override virtual noexcept]
QAbstract3DSeries::~QAbstract3DSeries()
Deletes the abstract 3D series.
[invokable]
void QAbstract3DSeries::setMeshAxisAndAngle(QVector3D axis, float angle)
A convenience function to construct a mesh rotation quaternion from axis and angle.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also meshRotation.
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.