More likely something like:
public:
void paintGL(){
switch(_which){
case 0: drawCube(); break;
case 1: drawCone(); break;
case 2: drawSphere(); break;
default: drawTeaPot();
}
}
// ...
private:
int _which;
};
class MyGLWidget : public QGLWidget {
public:
MyGLWidget(int which, QWidget *p) : QGLWidget(p){ _which = which; }
void paintGL(){
switch(_which){
case 0: drawCube(); break;
case 1: drawCone(); break;
case 2: drawSphere(); break;
default: drawTeaPot();
}
}
// ...
private:
int _which;
};
To copy to clipboard, switch view to plain text mode
Bookmarks