I try to write a simple program to print out a line from a printer.
Following is my code:
QPrinter printer(QPrinter::HighResolution);
QPainter painter(&printer);
painter.setPen(QColor(0,0,0));
painter.drawLine(10,10,100,100);
painter.end();
But somehow, the program crash with error message: Access violation reading location.
Can anyone tell me what's wrong with the code?
Bookmarks