0

我正在使用 QtcustomPlot,但是当我尝试通过 QCPAxisTickerTime 类将 Y 轴更改为日期时间轴时,出现此错误。我包括 QSharedPointer 库。大家都知道吗,请帮助我。

我正在使用 Qt5.8.0 和 QCustomPlot 版本 2.0.0 beta。

error: ‘QCPAxisTickerTime’ was not declared in this scope    
QSharedPointer<QCPAxisTickerTime> timeTicker(new QCPAxisTickerTime);

太感谢了。

4

1 回答 1

0
QSharedPointer<QCPAxisTickerTime> timeTicker(new QCPAxisTickerTime);
timeTicker->setTimeFormat("%h:%m:%s");
trend->CustomPlot->xAxis->setTicker(timeTicker);

QSharedPointer<QCPAxisTickerTime> timeTicker2(new QCPAxisTickerTime);
timeTicker2->setTimeFormat("%h:%m:%s");
trend->CustomPlot->yAxis->setTicker(timeTicker2);

This worked for me.

于 2018-02-23T05:43:46.907 回答