Solved QPaintEvent error incomplete type
-
I get a compile error of incomplete type when compiling:
void MyFirstWidget::paintEvent(QPaintEvent * e)
{
QRect rw = this->rect();
QPainter painter(this);
QRect r = e->rect();if (drawValue == 1) painter.drawLine(1 , 1, 1000, 1000);
}
-
Hi! You probably forgot
#include <QPaintEvent>
. -
You are correct I forgot the #include <QPaintEvent> Thanks, that fixed it. My C++ is rusty.
-
@ofmrew How do I mark it as resolved?
-
There is the button "Topic Tools", and then: "Mark as solved". See https://forum.qt.io/topic/71830 for a short visual help.