mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Avoid duplicate draw messages.
This commit is contained in:
parent
d95d0ac68a
commit
08631abe78
2 changed files with 7 additions and 2 deletions
|
@ -20,9 +20,9 @@ void lcGLWidget::MakeCurrent()
|
||||||
|
|
||||||
void lcGLWidget::Redraw()
|
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)
|
void* lcGLWidget::GetExtensionAddress(const char* FunctionName)
|
||||||
|
@ -119,6 +119,9 @@ lcQGLWidget::lcQGLWidget(QWidget *parent, lcQGLWidget *share, lcGLWidget *owner,
|
||||||
widget = owner;
|
widget = owner;
|
||||||
widget->mWidget = this;
|
widget->mWidget = this;
|
||||||
|
|
||||||
|
mUpdateTimer.setSingleShot(true);
|
||||||
|
connect(&mUpdateTimer, SIGNAL(timeout()), this, SLOT(updateGL()));
|
||||||
|
|
||||||
widget->MakeCurrent();
|
widget->MakeCurrent();
|
||||||
GL_InitializeSharedExtensions(widget);
|
GL_InitializeSharedExtensions(widget);
|
||||||
widget->OnInitialUpdate();
|
widget->OnInitialUpdate();
|
||||||
|
|
|
@ -25,6 +25,8 @@ public:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTimer mUpdateTimer;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initializeGL();
|
void initializeGL();
|
||||||
void resizeGL(int x, int h);
|
void resizeGL(int x, int h);
|
||||||
|
|
Loading…
Add table
Reference in a new issue