I want to draw an ellipse when i click to pushbutton.
i write this signal-slots:
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(paintEvent()));
then as paintevent:
void MainWindow:aintEvent(QPaintEvent *pe)
{
QPainter painter(this);
painter.drawEllipse(20,20,100,100);
}
when i run program. it builds successfully.
but it draws ellipse automatically. program doesn't need to click pushbutton.
and gives that message "QPainter::begin: Paint device returned engine == 0, type: 1"
what should i do to perform painting when i click push button.
thank you very much
Bookmarks