More likely something like:

Qt Code:
  1. class MyGLWidget : public QGLWidget {
  2. public:
  3. MyGLWidget(int which, QWidget *p) : QGLWidget(p){ _which = which; }
  4. void paintGL(){
  5. switch(_which){
  6. case 0: drawCube(); break;
  7. case 1: drawCone(); break;
  8. case 2: drawSphere(); break;
  9. default: drawTeaPot();
  10. }
  11. }
  12. // ...
  13. private:
  14. int _which;
  15. };
To copy to clipboard, switch view to plain text mode