diff --git a/qt/lc_qglwidget.cpp b/qt/lc_qglwidget.cpp index db6f54c2..3aacab08 100644 --- a/qt/lc_qglwidget.cpp +++ b/qt/lc_qglwidget.cpp @@ -20,9 +20,9 @@ void lcGLWidget::MakeCurrent() void lcGLWidget::Redraw() { - QGLWidget* Widget = (QGLWidget*)mWidget; + lcQGLWidget* Widget = (lcQGLWidget*)mWidget; - QTimer::singleShot(0, Widget, SLOT(updateGL())); + Widget->mUpdateTimer.start(0); } void* lcGLWidget::GetExtensionAddress(const char* FunctionName) @@ -119,6 +119,9 @@ lcQGLWidget::lcQGLWidget(QWidget *parent, lcQGLWidget *share, lcGLWidget *owner, widget = owner; widget->mWidget = this; + mUpdateTimer.setSingleShot(true); + connect(&mUpdateTimer, SIGNAL(timeout()), this, SLOT(updateGL())); + widget->MakeCurrent(); GL_InitializeSharedExtensions(widget); widget->OnInitialUpdate(); diff --git a/qt/lc_qglwidget.h b/qt/lc_qglwidget.h index 2bb24b24..0be4180f 100644 --- a/qt/lc_qglwidget.h +++ b/qt/lc_qglwidget.h @@ -25,6 +25,8 @@ public: #endif } + QTimer mUpdateTimer; + protected: void initializeGL(); void resizeGL(int x, int h);