<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div>In my case I have another strange issue that I still havent been able to identify the reason.</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">My child qglwidget can have animation, fired by a timer, if the user presses a button. </div><div>Everything works ok if I only have one instance of the parent widget. </div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">However, creating 2 instances of the parent widget, and starting the animating on both, I will get
 warnings on the application output: </div><div><span style="color: rgb(170, 0, 170); font-family: Courier; font-size: 10pt;"><br></span></div><div style="color: rgb(170, 0, 170); font-size: 13px; font-family: Courier; background-color: transparent; font-style: normal;"><span style="color: rgb(170, 0, 170); font-family: Courier; font-size: 10pt;">QOpenGLBuffer::bind: buffer is not valid in the current context</span></div><div style="color: rgb(170, 0, 170); font-size: 10pt; font-family: Courier; background-color: transparent; font-style: normal;"><span style="color: rgb(170, 0, 170); font-family: Courier; font-size: 10pt;"><br></span></div><div style="color: rgb(170, 0, 170); font-size: 13px; font-family: Courier; background-color: transparent; font-style: normal;"><span style="color: rgb(170, 0, 170); font-family: Courier; font-size: 10pt;"><span style="color: rgb(0, 0, 0); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
 Grande', sans-serif; font-size: 16px;">and the animation of one of the instances freezes and the images get swapped between the 2 widgets (that is very strange since all the data that feed the animation is exclusive to each object).</span><br></span></div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> Em Sexta-feira, 29 de Novembro de 2013 10:09, Csaba Csernai <csernai.csaba@gmail.com> escreveu:<br> </font> </div> 
 <div class="y_msg_container"><div id="yiv9904886522"><div><div dir="ltr"><div><div><div>Thanks your tip. I thought about it, but the problem is that many other object created that are depending on shaders and also all the configuration, data uploading, etc. are handled before the first showEvent occurring.<br clear="none">
</div>It is possible to make a workaround, but really it would be a hell of a work. That's why I am hoping it will be fixed in the next release maybe, if it's an error.<br clear="none"><br clear="none"></div>Best regards,<br clear="none"></div> Csaba Csernai<br clear="none">
</div><div class="yiv9904886522gmail_extra"><br clear="none"><br clear="none"><div class="yiv9904886522gmail_quote">2013/11/29 joao morgado <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:joaodeusmorgado@yahoo.com" target="_blank" href="mailto:joaodeusmorgado@yahoo.com">joaodeusmorgado@yahoo.com</a>></span><br clear="none"><div class="yiv9904886522yqt8590944423" id="yiv9904886522yqt13697"><blockquote class="yiv9904886522gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="font-size: 12pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"><div><span>Hi </span></div><div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;">
<span><br clear="none"></span></div><div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"><span>I had the same similar issue, I was using a parent widget, with buttons and a frame with a child qglwidget derived class.</span></div>
<div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;">What I did was to create a
 method in the child qglwidget derived class to initialize the shaders, and I only calls this method inside the showEvent() of the parent widget class.</div><div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;">
<br clear="none"></div><div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;">Regards</div><div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;">
Joao de Deus</div><div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></div><div style="display:block;">
 <br clear="none"> <br clear="none"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;">
 <div dir="ltr"> <font face="Arial"> Em Sexta-feira, 29 de Novembro de 2013 6:58, Csaba Csernai <<a rel="nofollow" shape="rect" ymailto="mailto:csernai.csaba@gmail.com" target="_blank" href="mailto:csernai.csaba@gmail.com">csernai.csaba@gmail.com</a>> escreveu:<br clear="none"> </font> </div>  <div>
<div><div class="yiv9904886522h5"><div><div dir="ltr"><div><div>Hi everyone!<br clear="none"><br clear="none"></div>I would like to ask your help in some Qt 5 matter. I think it's somewhat related to QTBUG-31451, but not sure.<br clear="none"><br clear="none"></div>When I create a QGLWidget with a parent which not yet visible, then it seems to fail to compile shaders although QGLContext is valid( at least the isValid function returns true).<br clear="none">


<div><div><div><div><div><div><div><div>e.g.: there is a tab widget, which is visible, and from code we add another tab, so that it contains a QWidget and inside the QWidget, there is a QGLWidget( yeah, i kno w it's messed up, but that's it). So when we create the QGLWidget with the QWidget parent, the QWidget is not visible, and - as far as i discovered - it has no window handle.<br clear="none">

<br clear="none">It worked fine, in 4.8, and i compile with msvc 11.0.<br clear="none">
<br clear="none"></div><div>My question is that is it a bug or did I miss something? Would someone point me in the right direction?Should i post my findings to the mentioned bug thread or create a new one?<br clear="none"><br clear="none"></div><div></div><div>

Thanks. <br clear="none">
</div><div>Bye,<br clear="none"><br clear="none"><div>-- <br clear="none">Csaba Csernai<br clear="none">C/C++ Software Developer<br clear="none">Mediso Medical Imaging Systems Ltd.<br clear="none">Hungary, H-1022 Budapest,<br clear="none">Alsótörökvész 14.<br clear="none">
</div></div></div></div></div></div></div></div></div></div></div><br clear="none"></div></div>_______________________________________________<br clear="none">Development mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:Development@qt-project.org" target="_blank" href="mailto:Development@qt-project.org">Development@qt-project.org</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://lists.qt-project.org/mailman/listinfo/development">http://lists.qt-project.org/mailman/listinfo/development</a><br clear="none"><br clear="none"><br clear="none"></div>  </div> </div>  </div> </div></div></blockquote></div></div><br clear="none"><br clear="all">
<br clear="none">-- <br clear="none">Csaba Csernai<br clear="none">C/C++ Software Developer<br clear="none">Mediso Medical Imaging Systems Ltd.<br clear="none">Hungary, H-1022 Budapest,<br clear="none">Alsótörökvész 14.<br clear="none">
</div></div></div><br><br></div>  </div> </div>  </div> </div></body></html>