No, I don't use OpenGL to draw the background. I do use painter and here is the code:
{
painter->save();
painter->setBrush(Qt::black);
painter->drawRect(rect);
painter->drawPixmap(0,0, theForm->getBackground()); // getBackground() returns a pixmap
painter->restore();
}
{
return backgroundImage; // This is an image stored in a classes QPixmap variable.
}
void Override::drawBackground(QPainter *painter, const QRectF &rect)
{
painter->save();
painter->setBrush(Qt::black);
painter->drawRect(rect);
painter->drawPixmap(0,0, theForm->getBackground()); // getBackground() returns a pixmap
painter->restore();
}
QPixmap theForm::getBackground()
{
return backgroundImage; // This is an image stored in a classes QPixmap variable.
}
To copy to clipboard, switch view to plain text mode
Bookmarks