{
p.
setPen(QPen(Qt
::red,
5));
p.fillRect(rect(), Qt::white);
p.drawText(0,0,width(), height(),Qt::AlignCenter || Qt::TextWordWrap, "THIS IS THE AREA WHERE I DRAW IMG");
p.
setCompositionMode(QPainter::CompositionMode_Source);
p.
fillRect(rect
().
adjusted(0,
0,
-width
()/2,
-height
()/2),
QColor(255,
255,
255,
1));
}
void MyWidget::paintEvent ( QPaintEvent * )
{
QPainter p(this);
p.setPen(QPen(Qt::red,5));
p.fillRect(rect(), Qt::white);
p.drawText(0,0,width(), height(),Qt::AlignCenter || Qt::TextWordWrap, "THIS IS THE AREA WHERE I DRAW IMG");
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(rect().adjusted(0,0,-width()/2,-height()/2), QColor(255,255,255,1));
}
To copy to clipboard, switch view to plain text mode
Bookmarks