<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Dynamic Qframe]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">In my application I have a openGL window that I have added to a QGridLayout as a widget and this QGridLayout is set as a layout for a QFrame. On run-time I need to remove this OpenGL window from the QFrame and show it separately from main window by right clicking on it. and the reveres ;  I need to add it back to the QFrame as a widget of a QGridLayout.</p>
<p dir="auto">this is just a part of test code to see if I can add the OpenGL widget to the layout and remove it afterwards and show it on a separate window:</p>
<p dir="auto">@<br />
QFrame*    m_editFrame;<br />
QGridLayout* layout = new QGridLayout;</p>
<p dir="auto">.<br />
.<br />
.<br />
m_canvas = new CanvasRender(0, layout); // OpenGL context</p>
<p dir="auto">layout-&gt;addWidget(m_canvas, 6, 1);<br />
//layout-&gt;removeWidget(m_canvas);</p>
<p dir="auto">m_editFrame-&gt;setLayout(layout);<br />
layout-&gt;removeWidget(m_canvas);</p>
<p dir="auto">m_editFrame-&gt; setLayout(layout);<br />
m_editFrame-&gt;installEventFilter(this);</p>
<p dir="auto">initialize();<br />
m_canvas-&gt;show();<br />
@</p>
<p dir="auto">if I call this line  @layout-&gt;removeWidget(m_canvas); @ exactly after adding the widget to layout then it works fine. otherwise the openGL window (which is inherited from QGLWidget) is separated from layout but not the Qframe and it sticks to the frame and you can't move it around. I have search a lot but couldn't find a solution. I will be glad for any help! :)</p>
]]></description><link>https://forum.qt.io/topic/29557/dynamic-qframe</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 17:33:23 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/29557.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 17 Jul 2013 18:43:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dynamic Qframe on Thu, 18 Jul 2013 09:44:18 GMT]]></title><description><![CDATA[<p dir="auto">You're welcome,</p>
<p dir="auto">Since it's all good, don't forget to update the thread's title to solved so other forum users may know a solution has been found :)</p>
]]></description><link>https://forum.qt.io/post/186945</link><guid isPermaLink="true">https://forum.qt.io/post/186945</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 18 Jul 2013 09:44:18 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic Qframe on Thu, 18 Jul 2013 08:36:37 GMT]]></title><description><![CDATA[<p dir="auto">hi,</p>
<p dir="auto">Thanks! yeah that was the problem and now it's fixed!</p>
]]></description><link>https://forum.qt.io/post/186940</link><guid isPermaLink="true">https://forum.qt.io/post/186940</guid><dc:creator><![CDATA[saghi.sharif]]></dc:creator><pubDate>Thu, 18 Jul 2013 08:36:37 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic Qframe on Wed, 17 Jul 2013 20:23:54 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">If I'm not mistaken, your CanvasRender is still parented to your QFrame, set it's parent to 0 after removing it and you should be able to move it around.</p>
]]></description><link>https://forum.qt.io/post/186855</link><guid isPermaLink="true">https://forum.qt.io/post/186855</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 17 Jul 2013 20:23:54 GMT</pubDate></item></channel></rss>