Qt Qml图表视图条形图系列在悬停事件上检索鼠标位置
我想检索鼠标位置时,任何酒吧是悬停,但我无法实现。这是我的qml代码。实际上,我想在鼠标指针旁边显示一个文本,上面写着悬停条的百分比值Qt Qml图表视图条形图系列在悬停事件上检索鼠标位置,qt,qml,qtcharts,Qt,Qml,Qtcharts,我想检索鼠标位置时,任何酒吧是悬停,但我无法实现。这是我的qml代码。实际上,我想在鼠标指针旁边显示一个文本,上面写着悬停条的百分比值 ChartView { property int hovered_bar_idx : -1 anchors { left : parent.left right : parent.right rightMargin : 10 bot
ChartView {
property int hovered_bar_idx : -1
anchors {
left : parent.left
right : parent.right
rightMargin : 10
bottom : parent.bottom
}
id : chart
height : 450
title : "Staves Statuses"
legend.alignment: Qt.AlignBottom
antialiasing : true
backgroundColor : "black"
legend.visible : false
BarSeries {
id : mySeries
barWidth: 0.85
axisY : ValueAxis { max : 1.0; min : 0.0; }
axisX : BarCategoryAxis {
id : axis_x;
categories : sys_hardware_display.categories;
gridVisible : false
}
onHovered : {
console.log( "s : " + status + " idx : " + index )
// I want to retrieve position of mouse here.
}
BarSet {
id : stave_values
label : "Staves"
color : "#00FF00"
borderWidth : 0
}
}
}
寻找相同的,但目前似乎没有为BarSet/BarSeries实现鼠标位置。寻找相同的,但目前似乎没有为BarSet/BarSeries实现鼠标位置。