Hello,
I'm trying to display a line with QPainter with following code:
drawit.h:
Code:
#ifndef DRAWIT_H #define DRAWIT_H #include <QWidget> { Q_OBJECT public: protected: QPainter *paint; }; #endif
drawit.cpp:
Code:
#include <QtGui> #include "drawit.h" { } { paint->drawLine(10, 10, 50, 50); }
main.cpp:
Code:
#include <QApplication> #include "drawit.h" int main(int argc, char* argv[]) { DrawIt *drawIt = new DrawIt; drawIt->show(); return app.exec(); }
This gives the error "no 'void DrawIt::paintEvent(QPaintEvent *)' member function declared in class DrawIt
Where am i making the mistake? :confused:
Thx in advance,
Misko