qt error: variable `QPainter painter' has initializer but incomplete type

/home/yx/QTproject/helloWorld/mainwindow.cpp:39: error: variable ‘QPainter painter’ has initializer but incomplete type QPainter painter(this);

 QPainter painter(this);//这句话报错

这里写图片描述
^
解决方案:在.cpp文件中添加#include”qpainter.h”

猜你喜欢

转载自blog.csdn.net/qq_31674679/article/details/80150058
今日推荐