QRect drawingRect()
virtual QRect drawingRect();
virtual void mouseMoveEvent(QMouseEvent *event);
static MyClass test;
#include <QGLWidget>class B;class A : public QGLWidget{ Q_OBJECT friend class B;public: A(QWidget* parrent = 0); virtual void test();private: virtual QString drawingRect();};class B : public A{ Q_OBJECTpublic: B(QWidget* parrent = 0); void test();private: QString drawingRect();};
A::A(QWidget* parrent) : QGLWidget( parrent ){//QGLFormat(QGL::SampleBuffers), parent ){}void A::test(){ QString val = drawingRect();}QString A::drawingRect(){ return QString("A class");}B::B(QWidget* parrent) : A(parrent){}void B::test(){ A::test(); QString valA = A::drawingRect(); QString val = drawingRect();}QString B::drawingRect(){ return QString("B class");}
int main(int argc, char *argv[]){ static MyClass test; test.drawingRect();}