Bars3D QML Type
三维条形图。更多
Import Statement: | import QtGraphs |
Inherits: |
- 所有成员(包括继承成员)的列表
- Bars3D 是Qt Graphs QML Types for 3D 的一部分。
属性
- ambientLightStrength : real
- aspectRatio : real
- barSeriesMargin : size
- barSpacing : size
- barSpacingRelative : bool
- barThickness : real
- cameraPreset : Graphs3D.CameraPreset
- cameraTargetPosition : vector3d
- cameraXRotation : real
- cameraYRotation : real
- cameraZoomLevel : real
- columnAxis : Category3DAxis
- currentFps : int
- customItemList : list<Custom3DItem>
- floorLevel : real
- gridLineType : Graphs3D.GridLineType
- horizontalAspectRatio : real
- labelMargin : real
- lightColor : color
- lightStrength : real
- locale : locale
- margin : real
- maxCameraXRotation : real
(since 6.9)
- maxCameraYRotation : real
(since 6.9)
- maxCameraZoomLevel : real
- measureFps : bool
- minCameraXRotation : real
(since 6.9)
- minCameraYRotation : real
(since 6.9)
- minCameraZoomLevel : real
- msaaSamples : int
- multiSeriesUniform : bool
- optimizationHint : Graphs3D.OptimizationHint
- orthoProjection : bool
- polar : bool
- primarySeries : Bar3DSeries
- queriedGraphPosition : vector3d
- radialLabelOffset : real
- renderingMode : Graphs3D.RenderingMode
- rootNode : Node
(since 6.9)
- rotationEnabled : bool
- rowAxis : Category3DAxis
- scene : Scene3D
- selectedElement : Graphs3D.ElementType
- selectedSeries : Bar3DSeries
- selectionEnabled : bool
- selectionMode : Graphs3D.SelectionMode
- seriesList : list<Bar3DSeries>
- shadowQuality : Graphs3D.ShadowQuality
- shadowStrength : real
- theme : GraphsTheme
- transparencyTechnique : Graphs3D.TransparencyTechnique
(since 6.9)
- valueAxis : ValueAxis3D
- wrapCameraXRotation : bool
- wrapCameraYRotation : bool
- zoomAtTargetEnabled : bool
- zoomEnabled : bool
信号
- barSeriesMarginChanged(size margin)
- barSpacingChanged(size spacing)
- barSpacingRelativeChanged(bool relative)
- barThicknessChanged(real thicknessRatio)
- columnAxisChanged(Category3DAxis axis)
- doubleTapped(QEventPoint eventPoint, Qt::MouseButton button)
- dragged(QVector2D delta)
- floorLevelChanged(real level)
- longPressed()
- mouseMove(QPoint mousePos)
- multiSeriesUniformChanged(bool uniform)
- pinch(qreal delta)
- primarySeriesChanged(Bar3DSeries series)
- rowAxisChanged(Category3DAxis axis)
- selectedSeriesChanged(Bar3DSeries series)
- tapped(QEventPoint eventPoint, Qt::MouseButton button)
- valueAxisChanged(ValueAxis3D axis)
- wheel(QQuickWheelEvent *event)
方法
- qsizetype addCustomItem(Custom3DItem item)
- void addSeries(Bar3DSeries series)
- void clearSelection()
- void doPicking(QPoint point)
- void doPicking(QVector3D origin, QVector3D direction)
- bool hasSeries(Abstract3DSeries series)
- void insertSeries(int index, Bar3DSeries series)
- void releaseCustomItem(Custom3DItem item)
- void releaseCustomItem(Custom3DItem item)
- void removeCustomItem(Custom3DItem item)
- void removeCustomItemAt(vector3d position)
- void removeCustomItems()
- void removeSeries(Bar3DSeries series)
- Abstract3DAxis selectedAxis()
- Custom3DItem selectedCustomItem()
- qsizetype selectedCustomItemIndex()
- int selectedLabelIndex()
详细说明
该类型使开发人员能够使用Qt Quick 渲染 3D 条形图。
您需要导入Qt Graphs 模块才能使用该类型:
import QtGraphs
之后,您就可以在 qml 文件中使用 Bars3D:
import QtQuick import QtGraphs Item { width: 640 height: 480 Bars3D { width: parent.width height: parent.height Bar3DSeries { itemLabelFormat: "@colLabel, @rowLabel: @valueLabel" ItemModelBarDataProxy { itemModel: dataModel // Mapping model roles to bar series rows, columns, and values. rowRole: "year" columnRole: "city" valueRole: "expenses" } } } ListModel { id: dataModel ListElement{ year: "2022"; city: "Oulu"; expenses: "4200"; } ListElement{ year: "2022"; city: "Rauma"; expenses: "2100"; } ListElement{ year: "2022"; city: "Helsinki"; expenses: "7040"; } ListElement{ year: "2022"; city: "Tampere"; expenses: "4330"; } ListElement{ year: "2023"; city: "Oulu"; expenses: "3960"; } ListElement{ year: "2023"; city: "Rauma"; expenses: "1990"; } ListElement{ year: "2023"; city: "Helsinki"; expenses: "7230"; } ListElement{ year: "2023"; city: "Tampere"; expenses: "4650"; } } }
请参阅 "简单条形图",了解更全面的使用示例。
另请参阅 Bar3DSeries,ItemModelBarDataProxy,Scatter3D,Surface3D, 和Qt Graphs C++ 3D 类。
属性文档
ambientLightStrength : real |
整个图形的环境光强度。该值决定了无论光线位置如何,颜色在整个图形中显示的均匀度和亮度。该值必须介于0.0
和1.0
之间。
aspectRatio : real |
barSeriesMargin : size |
X 和 Z 维度系列列之间的边距。默认设置为(0.0, 0.0)
。合理值范围为 [0,1)。
barSpacing : size |
X 和 Z 尺寸的条间距。
默认设置为(1.0, 1.0)
。间距受barSpacingRelative 属性影响。
barSpacingRelative : bool |
间距是绝对间距还是相对于条形图厚度的间距。
如果true
,0.0
的值表示条形图横向排列,1.0
表示在条形图之间留出与一个条形图厚度等宽的空间,依此类推。预设为true
。
barThickness : real |
X 和 Z 尺寸之间的条形厚度比。1.0
表示条形图的宽度与深度相同,而0.5
则表示条形图的深度是宽度的两倍。
cameraPreset : Graphs3D.CameraPreset |
当前激活的摄像机预设,即Graphs3D.CameraPreset 。如果没有激活预设,则值为Graphs3D.CameraPreset.NoPreset
。
cameraTargetPosition : vector3d |
摄像机目标矢量 3d。默认为vector3d(0.0, 0.0, 0.0)
。
有效坐标值介于-1.0...1.0
之间,其中边缘值表示相应轴范围的边缘。任何超出此范围的值都会被边缘夹住。
cameraXRotation : real |
摄像机围绕目标点的 X 旋转角度(以当前基准位置为起点,单位为度)。
cameraYRotation : real |
摄像机围绕目标点的 Y 轴旋转角度(以度为单位,从当前基准位置开始)。
cameraZoomLevel : real |
摄像机缩放级别(百分比)。默认值为100.0
,表示摄像机没有缩放设置。该值受minCameraZoomLevel 和maxCameraZoomLevel 属性的限制。
另请参阅 minCameraZoomLevel 和maxCameraZoomLevel 。
columnAxis : Category3DAxis |
活动列轴。
如果没有给出轴,则会创建一个没有标签的临时默认轴。如果另一个轴被明确设置为相同方向,则该临时轴将被销毁。
currentFps : int |
启用 FPS 测量后,最后一秒的结果将存储在此只读属性中。激活测量后,该值至少需要一秒钟才能更新。
另请参阅 measureFps 。
customItemList : list<Custom3DItem> |
添加到图表中的Custom3DItem 项目列表。图形拥有已添加项目的所有权。
floorLevel : real |
以 Y 轴数据坐标表示的条形图层高。
实际层高将受 Y 轴最小值和最大值的限制。默认为零。
gridLineType : Graphs3D.GridLineType |
定义网格线类型是Graphs3D.GridLineType.Shader
还是Graphs3D.GridLineType.Geometry
。
该值会影响所有网格线。
另请参阅 Graphs3D.GridLineType 。
horizontalAspectRatio : real |
X 轴和 Z 轴之间的图形缩放比例。0.0
表示根据坐标轴范围自动缩放。默认值为0.0
。
注: 对Bars3D 没有影响,它通过barThickness 和barSpacing 属性处理水平面的缩放。极坐标图也忽略此属性。
另请参阅 aspectRatio,polar,Bars3D::barThickness, 和Bars3D::barSpacing 。
labelMargin : real |
该属性指定了轴标签放置的边距。
负值用于将标签置于绘图区域内,正值用于将标签置于绘图区域外。当值为负数时,将禁用标签自动旋转功能。默认值为0.1
locale : locale |
设置用于格式化各种数字标签的区域设置。默认为"C"
locale。
另请参阅 Value3DAxis::labelFormat 。
margin : real |
可绘图区域边缘与图形背景边缘之间留出空间的绝对值。
如果边距值为负数,边距将自动确定,并根据系列中项目的大小和图形类型而变化。如果图形纵横比未从默认值中更改,则该值将被解释为 Y 轴范围的一部分。默认值为-1.0
。
注意: 如果为散点图设置的边距小于自动确定的边距,可能会导致图形边缘的散点项与图 形背景重叠。
注: 在散点图和曲面图中,如果边距小于坐标轴标签尺寸,则会调整坐标轴边缘标签的位 置,以避免与相邻坐标轴的边缘标签重叠。
maxCameraXRotation : real |
摄像机围绕目标点的最大 X 旋转角度(单位:度)。默认值为180.0
此属性在 Qt 6.9 中引入。
maxCameraYRotation : real |
摄像机围绕目标点的最大 Y 旋转角度(度)。默认值为90.0
此属性在 Qt 6.9 中引入。
maxCameraZoomLevel : real |
设置允许的最大摄像机缩放级别。如果新的最大级别低于现有的最小级别,则最小级别也会调整为新的最大级别。如果当前的cameraZoomLevel 在新范围之外,也会进行调整。默认为500.0f
。
另请参阅 cameraZoomLevel 和minCameraZoomLevel 。
measureFps : bool |
如果true
,渲染将持续进行,而不是按需进行,并且currentFps 属性的值也会更新。默认为false
。
另请参阅 currentFps 。
minCameraXRotation : real |
摄像机围绕目标点的最小 X 旋转角度(度)。默认值为-180.0
此属性在 Qt 6.9 中引入。
minCameraYRotation : real |
摄像机围绕目标点的最小 Y 旋转角度(度)。默认值为0.0
此属性在 Qt 6.9 中引入。
minCameraZoomLevel : real |
设置允许的最小摄像机缩放级别。如果新的最小级别高于现有的最大级别,则最大级别也会调整为新的最小级别。如果当前的cameraZoomLevel 超出了新的范围,也会进行调整。minCameraZoomLevel 不能设置为低于1.0
。默认为10.0
。
另请参阅 cameraZoomLevel 和maxCameraZoomLevel 。
msaaSamples : int |
当renderingMode 为Indirect
时,多采样抗锯齿中使用的采样数目。当renderingMode 为DirectToBackground
时,此属性值为只读值,并返回窗口表面格式指定的采样数目。默认值为4
。
另请参阅 renderingMode 。
multiSeriesUniform : bool |
定义条形图是否按比例缩放,即使显示多个系列条形图。如果设置为true
,bar spacing 将仅正确应用于 X 轴。默认设置为false
。
optimizationHint : Graphs3D.OptimizationHint |
指定使用默认模式还是传统模式进行渲染优化。
默认模式使用实例渲染,可在大多数系统上以最佳性能提供完整的功能集。静态模式可优化图形渲染,是大型非变化数据集的理想选择。但在动态数据变化和项目旋转的情况下,该模式的运行速度较慢。选择模式未进行优化,因此不建议在海量数据集上使用静态模式。传统模式会单独渲染图形中的所有项目,而不会实例化。只有在默认模式不工作时,即目标系统不支持实例化时,才应使用该模式。默认值为Default 。
注意: 在某些环境下,使用静态优化的大型图形可能无法渲染,因为所有项目都是通过单次绘制调用渲染的,而不同的图形驱动程序支持不同的每次调用最大顶点数。这个问题主要出现在 32 位和 OpenGL ES2 平台上。要解决这个问题,可以选择顶点数较少的项目网格或使用点网格。
orthoProjection : bool |
如果true
,将使用正投影法显示图形。默认为false
。
注: 设置为true
时将禁用阴影。
polar : bool |
如果设置为true
,水平轴将变为极坐标轴。x 轴变为角度轴,z 轴变为径向轴。极轴模式不适用于条形图。
默认为false
。
另请参阅 orthoProjection 和radialLabelOffset 。
primarySeries : Bar3DSeries |
图形的主系列。如果没有明确设置行、列坐标轴标签,则用它来确定行、列坐标轴标签。
如果指定的序列尚未添加到图形中,将其设置为主序列也会将其隐式添加到图形中。
如果从图形中删除了主系列,该属性将重置为默认值。
如果序列为空,该属性将重置为默认值。默认为第一个添加的序列,如果没有序列添加到图表中,则默认为 0。
queriedGraphPosition: vector3d |
此只读属性包含使用Scene3D::graphPositionQuery 查询的每个轴的最新图形位置值。这些值已归一化为[-1, 1]
。如果查询到的位置超出了图形边界,则该值将不会反映真实位置,而是[-1, 1]
范围外的某个未定义位置。在进行查询之前,该值都是未定义的。
没有一个正确的三维坐标与特定的屏幕位置相匹配,因此为了保持一致,查询总是针对图形周围的一个不可见方框的内侧进行。
注意: 条形图只允许在图形底层查询图形位置,因此条形图的 y 值始终为零,只能在包含图形底层的屏幕位置进行有效查询。
另请参阅 Scene3D::graphPositionQuery 。
radialLabelOffset : real |
该属性指定径向极轴标签的归一化水平偏移。0.0
表示标签应绘制在 0 角度角轴网格线旁边。1.0
表示标签绘制在图形背景边缘的常规位置。如果极坐标属性值为false
,该属性将被忽略。默认值为1.0
。
另请参阅 polar 。
renderingMode : Graphs3D.RenderingMode |
图形的渲染方式。默认为Indirect
。
注意: 设置图形的antialiasing
属性没有任何作用。但是,如果当前渲染模式使用抗锯齿,则图形本身会设置该属性。
另请参阅 msaaSamples 和Graphs3D.RenderingMode 。
rootNode : Node |
返回指向三维图形根节点的指针。使用importScene 将 3D 图形注入到单独的View3D 中时,请使用此属性:
Bars3D { id: bars } View3D { importScene: bars.rootNode }
此属性在 Qt 6.9 中引入。
另请参阅 View3D 。
rotationEnabled : bool |
此输入处理程序是否允许图形旋转。
默认为true
。
rowAxis : Category3DAxis |
活动行轴。
如果没有给出轴,将创建一个没有标签的临时默认轴。如果明确将另一个轴设置为相同方向,则会销毁该临时轴。
selectedElement : Graphs3D.ElementType |
在图形中选择的元素。
该属性可用于查询所选元素的类型。该类型一直有效,直到在图形中做出新的选择并发出selectedElementChanged
信号。
例如,该信号可用于实现自定义输入处理,如轴处理示例所示。
另请参阅 selectedLabelIndex(),selectedAxis(),selectedCustomItemIndex(),selectedCustomItem(),Bars3D::selectedSeries,Scatter3D::selectedSeries,Scene3D::selectionQueryPosition, 和Graphs3D.ElementType 。
selectedSeries : Bar3DSeries |
选中的系列或null
。如果selectionMode 已设置SelectionMultiSeries
标志,则此属性将保留拥有选中条形图的系列。
selectionEnabled : bool |
此输入处理程序是否允许从图形中选择。
默认为true
。
selectionMode : Graphs3D.SelectionMode |
图形中的活动选择模式。Graphs3D.SelectionFlag 枚举值之一。
seriesList : list<Bar3DSeries> |
图形的系列。默认情况下,该属性包含一个空列表。要设置序列,可使用addSeries() 函数或将其定义为图形的子序列。
shadowQuality : Graphs3D.ShadowQuality |
阴影质量。Graphs3D.ShadowQuality 枚举值之一。
theme : GraphsTheme |
图形的活动主题。
另请参阅 GraphsTheme 。
transparencyTechnique : Graphs3D.TransparencyTechnique |
指定要使用的透明度技术。默认值为Default
。渲染透明表面图形时,请使用Approximate
或Accurate
。
常量 | 说明 |
---|---|
Default | 表示不使用与顺序无关的透明技术。提供最佳性能。当图形不包含透明度或条形图或散点图也使用实例化时使用,即optimizationHint 是 {QtGraphs3D::OptimizationHint::Default}。 |
Approximate | 表示图形尝试近似与阶无关的透明度。这种方法比Accurate 更快,而且可以在较旧的硬件上运行,但可能产生不准确的结果。当需要与阶次无关的透明度,但性能代价必须低于使用精确的与阶次无关的透明度时使用。 |
Accurate | 表示使用与阶次无关的精确透明度。在需要完美的透明度渲染时使用。 |
注意: 精确透明尚未实现,将在所需功能添加到QtQuick3D 后启用。
该属性在 Qt 6.9 中引入。
valueAxis : ValueAxis3D |
活动值轴。
如果没有给出坐标轴,则会创建一个没有标签和自动调整范围的临时默认坐标轴。如果将另一个轴明确设置为相同方向,则会销毁该临时轴。
wrapCameraXRotation : bool |
X 旋转轴中最小和最大限制的行为。默认情况下,X-旋转轴会从最小值绕到最大值,从最大值绕到最小值。
如果设置为true
,摄像机的 X 轴旋转将从最小值到最大值以及从最大值到最小值进行包络。如果设置为false
,摄像机的 X 轴旋转将限制在由最小值和最大值确定的扇形范围内。
wrapCameraYRotation : bool |
Y 轴旋转的最小值和最大值限制的行为。默认情况下,Y 轴旋转限制在最小值和最大值之间,没有任何包络。
如果true
,摄像机的 Y 轴旋转将从最小值到最大值以及从最大值到最小值进行包络。如果false
,摄像机的 Y 轴旋转将限制在由最小值和最大值确定的区域内。
zoomAtTargetEnabled : bool |
缩放是否应改变摄像机目标,以便图形的缩放点在缩放后保持在同一位置。
默认为true
。
zoomEnabled : bool |
此输入处理程序是否允许图形缩放。
默认为true
。
信号文档
barSeriesMarginChanged(size margin) |
当barSeriesMargin 变为margin 时,将发出此信号。
注: 相应的处理程序是onBarSeriesMarginChanged
。
barSpacingChanged(size spacing) |
当barSpacing 变更为spacing 时发出此信号。
注: 相应的处理程序是onBarSpacingChanged
。
barSpacingRelativeChanged(bool relative) |
当barSpacingRelative 变更为relative 时,发出该信号。
注: 相应的处理程序是onBarSpacingRelativeChanged
。
barThicknessChanged(real thicknessRatio) |
当barThickness 变更为thicknessRatio 时,发出此信号。
注: 相应的处理程序是onBarThicknessChanged
。
columnAxisChanged(Category3DAxis axis) |
当columnAxis 变更为axis 时,发出此信号。
注: 相应的处理程序是onColumnAxisChanged
。
doubleTapped(QEventPoint eventPoint, Qt::MouseButton button) |
当图形项在短时间内被点击两次时,将发出该信号。eventPoint 信号参数包含释放事件中有关被点击点的信息,而button 是被点击的mouse button ,或触摸屏上的NoButton
。
注: 相应的处理程序是onDoubleTapped
。
另请参阅 QEventPoint 、Qt::MouseButtons 和TapHandler::doubleTapped 。
dragged(QVector2D delta) |
当执行捏合手势时,图形上点群的平移发生变化时,就会发出该信号。delta 向量给出了平移的变化。
注: 相应的处理程序是onDragged
。
floorLevelChanged(real level) |
当floorLevel 变为level 时,将发出该信号。
注: 相应的处理程序是onFloorLevelChanged
。
longPressed() |
当parent
项目按下并保持的时间超过TapHandler::longPressThreshold 时,将发出该信号。
注: 相应的处理程序是onLongPressed
。
另请参阅 TapHandler::longPressed 。
mouseMove(QPoint mousePos) |
当图形接收到 mouseMove 事件时,就会发出该信号。mousePos 值给出了鼠标移动时的位置。
注: 相应的处理程序是onMouseMove
。
另请参见 QQuickItem::mouseMoveEvent 。
multiSeriesUniformChanged(bool uniform) |
当multiSeriesUniform 变为uniform 时,将发出该信号。
注: 相应的处理程序是onMultiSeriesUniformChanged
。
pinch(qreal delta) |
当执行捏合手势时图形上的比例因子发生变化时,将发出此信号。delta 值表示缩放比例的乘法变化。
注: 相应的处理程序是onPinch
。
另请参阅 PinchHandler::scaleChanged 。
primarySeriesChanged(Bar3DSeries series) |
当primarySeries 变为series 时,将发出该信号。
注: 相应的处理程序是onPrimarySeriesChanged
。
rowAxisChanged(Category3DAxis axis) |
当rowAxis 变更为axis 时会发出该信号。
注: 相应的处理程序是onRowAxisChanged
。
selectedSeriesChanged(Bar3DSeries series) |
当selectedSeries 变更为series 时,发出此信号。
注: 相应的处理程序是onSelectedSeriesChanged
。
tapped(QEventPoint eventPoint, Qt::MouseButton button) |
当图形项被点击一次时,将发出该信号。eventPoint 信号参数包含释放事件中有关被点击点的信息,而button 是被点击的mouse button ,或触摸屏上的NoButton
。
注: 相应的处理程序是onTapped
。
另请参见 QEventPoint,Qt::MouseButtons, 和TapHandler::singleTapped 。
valueAxisChanged(ValueAxis3D axis) |
当valueAxis 更改为axis 时,将发出此信号。
注: 相应的处理程序是onValueAxisChanged
。
wheel(QQuickWheelEvent *event) |
每次图形接收到event 类型的QWheelEvent 时,即每次移动滚轮或更新滚动手势时,都会发出该信号。
注: 相应的处理程序是onWheel
。
另请参阅 WheelEvent 和WheelHandler::wheel 。
方法文档
qsizetype addCustomItem(Custom3DItem item) |
向图形添加Custom3DItem item 。图形拥有添加项的所有权。
如果添加成功,则返回已添加项的索引;如果试图添加一个空项,则返回-1;如果试图添加一个已添加项,则返回该项的索引。
另请参阅 removeCustomItems()、removeCustomItem() 和removeCustomItemAt()。
void addSeries(Bar3DSeries series) |
将series 添加到图表中。图表可以包含多个序列,但只有一组坐标轴,因此所有序列的行和列必须匹配,这样可视化数据才有意义。如果图形有多个可见序列,在未明确设置坐标轴标签的情况下,只有第一个添加的序列才会在坐标轴上生成行或列标签。如果新添加的序列已指定了一个选定的柱形图,则该柱形图将突出显示,并且任何现有的选 择都将被清除。只有一个添加的序列可以有活动选区。
另请参阅 GraphsItem3D::hasSeries().
void clearSelection() |
清除所有附加系列的选区。
void doPicking(QPoint point) |
使用point 中的视图坐标对图形元素执行选取,选择第一个命中的项目。默认输入处理会在接收到 onTapped 事件时执行此操作。
另请参阅 selectedElement 。
void doPicking(QVector3D origin, QVector3D direction) |
从origin 开始并在direction 中对图形元素执行拾取,选择第一个命中的项目。
另请参阅 selectedElement 。
bool hasSeries(Abstract3DSeries series) |
返回series 是否已添加到图形中。
void insertSeries(int index, Bar3DSeries series) |
将series 插入系列列表中的index 位置。如果series 已添加到列表中,则将其移动到新的index 中。
注: 将序列移动到其旧索引之后的新index 时,列表中的新位置将按照序列仍在其旧索引中的情况计算,因此最终索引实际上是index 减一。
另请参阅 GraphsItem3D::hasSeries() 。
void releaseCustomItem(Custom3DItem item) |
void releaseCustomItem(Custom3DItem item) |
void removeCustomItem(Custom3DItem item) |
删除自定义item 。删除分配给它的资源。
void removeCustomItemAt(vector3d position) |
删除position 上的所有自定义项目。删除分配给它们的资源。
void removeCustomItems() |
删除所有自定义项目。删除为其分配的资源。
void removeSeries(Bar3DSeries series) |
从图形中删除series 。
另请参阅 GraphsItem3D::hasSeries() 。
Abstract3DAxis selectedAxis() |
在收到selectedElementChanged
信号后,可使用任何标签类型获取所选坐标轴。选择在下一个selectedElementChanged
信号发出前有效。
返回选中的轴或空值。
另请参阅 selectedElement 。
Custom3DItem selectedCustomItem() |
在收到selectedElementChanged
信号后,可使用ElementType.CustomItem 类型获取选定的自定义项。项目的所有权仍归图形所有。在下一个selectedElementChanged
信号发出之前,选择有效。
返回选中的自定义项目或 null。
另请参阅 selectedElement 。
qsizetype selectedCustomItemIndex() |
在收到selectedElementChanged
信号(类型为ElementType.CustomItem )后,可用于查询所选自定义项的索引。选择有效期至下一个selectedElementChanged
信号发出为止。
返回所选自定义项的索引或-1。
另请参阅 selectedElement 。
int selectedLabelIndex() |
在收到selectedElementChanged
信号后,可使用任何标签类型查询所选标签的索引。选择在下一个selectedElementChanged
信号发出前有效。
返回所选标签的索引或-1。
另请参阅 selectedElement 。
© 2025 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.