That is: QWidget: before constructing a QApplication qpaintdevice
Solution: add the corresponding program in the main function, as follows
#include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); ... return a.exec(); }