【发布时间】:2023-04-09 11:56:01
【问题描述】:
QObject::connect 返回 true,当我手动发出信号时,会在插槽中命中断点,但是当我将鼠标悬停在 QCandlestickSet 上时,不会发出信号。
我从图表中删除了所有其他自定义绘图,以确保没有任何东西覆盖烛台,但信号仍然没有触发。
“chartView”属于“ChartView”类型,它派生自“QChartView”。
“系列”的类型为“QCandlestickSeries”。
连接:
QObject::connect(this->series, SIGNAL(hovered(bool, QCandlestickSet *)), this->chartView, SLOT(displayCandleValues(bool, QCandlestickSet *)));
插槽:
void ChartView::displayCandleValues(bool status, QCandlestickSet *candle)
{
qint32 x = 0; // A breakpoint is set on this line and is triggered when calling 'emit this->series->hovered(false, Q_NULLPTR);'
}
提前谢谢你。
编辑:
当我单击蜡烛时,不会发出信号,但当我双击蜡烛时,会发出信号,并触发断点。
【问题讨论】: