PDA

View Full Version : qglwidget and constructor question on mac



john_god
17th June 2010, 01:51
I have a aplication that draws 2D and 3D graphs with QGLWidget. It works good on windows and linux, but the 3D graphs fail on Mac (just bought myself a Macbook :) ). 2D works good but in 3D appears a blank window with nothing draw.
There is one major difference between graphs 2D and 3D, the 2D graph class is derived from QGLWidget, and the 3D class, however, is derived from a base class wich is derived from QGLWidget


graph 2D

class GLGraph : public QGLWidget
{
Q_OBJECT

public:
GLGraph();
~GLGraph();
.....


graph 3D


#include "graph3d_base_glwidget.h"

class GLGraph3D_fxy : public Graph3D_Base_GLWidget
{
Q_OBJECT

public:

GLGraph3D_fxy();
~GLGraph3D_fxy();

virtual void paintGL();
...

3D graph base class

#include <QGLWidget>
#include "graph3Dclass/graph3d.h"
#include "gui/graf3d_dlg.h"
....

class Graph3D_Base_GLWidget : public QGLWidget
{
Q_OBJECT

public:
Graph3D_Base_GLWidget();
~Graph3D_Base_GLWidget();

virtual void initializeGL();
virtual void paintGL()
.....

virtual void resizeGL(int width, int height);

void AutoRotate();
.......

Also I I've been checking QGLWidget in Qt Assistant documentation and I didn't understand the constructor

class MyGLDrawer : public QGLWidget
{
Q_OBJECT // must include this if you use Qt signals/slots

public:
MyGLDrawer(QWidget *parent) //????
: QGLWidget(parent) {} //???????

protected:

void initializeGL()
{
// Set up the rendering context, define display lists etc.:
...

Any ideias on this 3D blank window?