QPainter.drawText() SIGSEGV Segmentation fault
问题 I'm trying to print a simple text message in a thermal printer through Qt5 printing methods. #include <QCoreApplication> #include <QDebug> #include <QtPrintSupport/QPrinterInfo> #include <QtPrintSupport/QPrinter> #include <QtGui/QPainter> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QPrinter printer(QPrinter::ScreenResolution); QPainter painter; painter.begin(&printer); painter.setFont(QFont("Tahoma",8)); painter.drawText(0,0,"Test"); painter.end(); return a.exec(); }