I am trying to draw line.
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
QPainter painter(&w);
painter.setPen(QPen(Qt::black, 12, Qt::DashDotLine, Qt::RoundCap));
painter.drawLine(0, 0, 200, 200);
return a.exec();
}
But there is nothing painting on the window. What is wrong?