Qt5OpenGL: fix flickering on resize

This commit is contained in:
wmayer
2017-03-15 17:28:45 +01:00
parent 2ba7d8e632
commit 2ec2ea5ac0

View File

@@ -176,6 +176,7 @@ public:
logger->startLogging(QOpenGLDebugLogger::SynchronousLogging);
}
#endif
connect(this, &CustomGLWidget::resized, this, &CustomGLWidget::slotResized);
}
bool event(QEvent *e)
{
@@ -199,6 +200,14 @@ public:
{
qDebug() << message;
}
void showEvent(QShowEvent*)
{
update(); // force update when changing window mode
}
void slotResized()
{
update(); // fixes flickering on some systems
}
};
#else
class CustomGLWidget : public QGLWidget {