Question

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.

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top