Commit cc5745db authored by schultz's avatar schultz

fixes #9 by recerating the opengl context after QMainWindow->show was

called
parent 745d2324
...@@ -98,6 +98,18 @@ ...@@ -98,6 +98,18 @@
//== IMPLEMENTATION ========================================================== //== IMPLEMENTATION ==========================================================
namespace {
void recreateContext()
{
QOpenGLContext* ctx = QOpenGLContext::currentContext();
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
ctx->setFormat(format);
ctx->create();
QOffscreenSurface* surface = new QOffscreenSurface();
ctx->makeCurrent(surface);
}
}
/** \brief Constuctor for the Core Widget ( This is stage 1 , call init for stage 2) /** \brief Constuctor for the Core Widget ( This is stage 1 , call init for stage 2)
* *
* Initialization is working the following way:\n * Initialization is working the following way:\n
...@@ -653,6 +665,7 @@ Core::init() { ...@@ -653,6 +665,7 @@ Core::init() {
coreWidget_->splitter_->restoreState (windowStates.value("Core/LogSplitter").toByteArray ()); coreWidget_->splitter_->restoreState (windowStates.value("Core/LogSplitter").toByteArray ());
coreWidget_->show(); coreWidget_->show();
recreateContext();
applyOptions(); applyOptions();
...@@ -671,6 +684,8 @@ Core::init() { ...@@ -671,6 +684,8 @@ Core::init() {
} else { } else {
coreWidget_->show(); coreWidget_->show();
recreateContext();
applyOptions(); applyOptions();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment