paintevent

Qt - creating QPainter

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 ch...

Paint on panel allowing auto scroll

Hi! I'm implementing an application which want to draw lines in the panel. But the panel must be auto scrolled as it size can be expand at run time. The panel paint method I have used is as below.When I run the program it draws lines, but when I scroll down the panel the lines get crashes.How can I avoid that? private void panel1_Paint(...