2017-03-25 39 views
0

QtcustomPlot을 사용하고 있지만 Y 축을 클래스 QCPAxisTickerTime에 의해 날짜/시간 축으로 변경하려고하면이 오류가 발생합니다. 나는 QSharedPointer 라이브러리를 포함했다. 모두가 그 사실을 알고 나를 도우십시오.QCPAxisTickerTime 오류

저는 Qt5.8.0 및 QCustomPlot 버전 2.0.0 베타를 사용하고 있습니다.

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

고맙습니다.

+0

일부 코드도 공유해야합니다. –

+0

QCustomPlot v1.3.2를 사용할 때 동일한 문제가 발생했습니다. 2.0.0 베타 버전으로 전환 한 후에 올바른 버전인지 확인하기 위해 제대로 작동했습니다. qcustomplot.cpp를 열고 'QCPAxisTickerTime'을 찾습니다. – Fanckush

답변

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); 

이것은 나를 위해 일했습니다.