Im trying to convert some data from QVector to QBitmap. How can I do this? I have a QVector of QPointF, and Im trying to convert that data to redraw on QPixmap.
QVector<QPointF> data;
QPixmap pixMap;
EDIT
I've made something like this. Why it isn't work?
QPainter *painter = new QPainter(&pixMap);
for(int i = 1; i < data.last().x(); i++){
painter->setPen(QPen(Qt::black, 2));
painter->drawPolyline(this->data.data(), this->data.size());
}
delete painter;
setPixmap(pixMap);
You can just draw into a pixmap using
QPainter
:QPainter
docs have loads of examples on how to draw stuff using QPainter, brushes, pens...