문제

I want to rotate my marker in my plot but i cant. Here is my code to adding images to plot:

    QPixmap pixmap("myImage");

    QwtSymbol *symbol = new QwtSymbol;
    symbol->setPixmap(pixmap);

    marker = new QwtPlotMarker;
    marker->setSymbol( symbol);
    marker->attach(this);

I tried to rotate with QTransform but i couldnt achive. Is there any trick to solve this problem?

Thanks.

도움이 되었습니까?

해결책

I found this method to solve this problem.

QPixmap pixmap("myPic");
QMatrix rm;
rm.rotate(angle);
pixmap = pixmap.transformed(rm);

QwtPlotMarker *marker = new QwtPlotMarker;
marker->setSymbol( symbol);
marker->attach(myPlot);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top