Hello, i'm trying to rewrite method paintEvent in my programm and change it.
void MainWindow::paintEvent(QPaintEvent *event)
{
QRegion reg = this->bgPixmapHandle->rect();
QPainter painter(this);
painter.setClipRegion(reg);
painter.drawImage(bgPixmapHandle->rect(), bgPixmapHandle);
painter.end();
}
Here i try to change my bg image. But i got an error on line: QPainter painter(this);
Error: Variable 'QPainter painter' is initialized, though the type is incomplete
C++ and Qt.