I have chart with differrent series. I need to save current ChartView as image. I tried to do it as:
QPixmap p(this->size());
QImage* image= new QImage;
QPainter *painter= new QPainter(this);
chartView->render(painter);
if(!image->save("test.png"))
qDebug()<<"ERROR";
I have next error: "QPainter::begin: Paint device returned engine == 0, type: 1"
you can use grab and save functions
grap image and than save it
chartWidget.grab().save("test2.png")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With