#include <QtGui/QApplication>
#include <QtOpenGL/QGLWidget>
#include <QtCore/QDebug>
{
public:
protected:
void paintGL() // why paintGL() is called twice
{
static int i = 0;
qDebug() << ++i;
}
};
int main(int argc, char **argv)
{
GLWidget widget;
widget.show();
return app.exec();
}
#include <QtGui/QApplication>
#include <QtOpenGL/QGLWidget>
#include <QtCore/QDebug>
class GLWidget : public QGLWidget
{
public:
GLWidget(QWidget * parent = 0) : QGLWidget(parent) {}
protected:
void paintGL() // why paintGL() is called twice
{
static int i = 0;
qDebug() << ++i;
}
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
GLWidget widget;
widget.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
output:
1
2
Bookmarks