How can I get the right tranformed Painter of my GraphicsView extended class ?
To draw a temporal item not added to the scene, I have to write :
QPainter painter
(this
->viewport
());
// this is the 'widget' `painter
QTransform AFT=QTransform(this->matrix());
AFT.translate(w_temp_item->pos().x(),w_temp_item->pos().y() );
painter.setTransform(AFT);
A_Gview2D::paintEvent(QPaintEvent *event) {
QPainter painter(this->viewport()); // this is the 'widget' `painter
QTransform AFT=QTransform(this->matrix());
AFT.translate(w_temp_item->pos().x(),w_temp_item->pos().y() );
painter.setTransform(AFT);
To copy to clipboard, switch view to plain text mode
Is any other way to get the right painter ?
Any idea ? Thanks
Bookmarks