in my progrm i am using 4frames(UI). I use show/hide frames using buttons. I have two draw a line in the 3rd frame. I have used the code
{
linepen.setWidth(25);
linepen.setCapStyle(Qt::RoundCap);
painter.
setRenderHint(QPainter::Antialiasing,
true);
painter.setPen(linepen);
painter.drawLine(point,point2);
}
void MainWindow::paintEvent(QPaintEvent *e)
{
QPainter painter(this);
QPen linepen(Qt::red);
linepen.setWidth(25);
linepen.setCapStyle(Qt::RoundCap);
painter.setRenderHint(QPainter::Antialiasing,true);
painter.setPen(linepen);
painter.drawLine(point,point2);
}
To copy to clipboard, switch view to plain text mode
since i have used the painter(this) the drawing is done on the main window so i cannot see the line on the frame. since frames(with background images) are placed over the main window.
Now i try to use painter(ui->frame3)
But it doesn't work. pls help me, thanks in advance
Bookmarks