Ok,<br><br>I found the problem. Nowhere you set the size of MyGraphicsWidget, so the layout can&#39;t know about its size, and more you never set the preferredSize so it use the default which is arbitrary small. Take a look on the doc for setPreferredSize, setMinimumSize, setMaximumSize and the overload of sizeHint for custom sizeHints.<br>
<br>Btw :<br><br>QSizeF s = parentWidget()-&gt;size()<br><br>That is not a good approach in the paint event.<br><br><div class="gmail_quote">2009/2/25 Petri Damstén <span dir="ltr">&lt;<a href="mailto:petri.damsten@gmail.com">petri.damsten@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Wednesday 25 February 2009 12:05:52 Dong Tiger wrote:<br>
&gt; 2008/12/30 Alexis Ménard &lt;<a href="mailto:menard@kde.org">menard@kde.org</a>&gt;<br>
&gt;<br>
&gt; &gt; Unfortunately you can&#39;t it is a bug in Qt.<br>
&gt; &gt;<br>
&gt; &gt; You can take a look to the task tracker of Qt Number 231114 and 211500. I<br>
&gt; &gt; guess it is what you try to solve. The fix is in 4.4 branch (so scheduled<br>
&gt; &gt; for 4.4.4) and in 4.5.<br>
&gt;<br>
&gt; I still can&#39;t get this work even with latest Qt4.5. I&#39;ve attached code of a<br>
&gt; sample plasmoid which demonstrate the problem. You are welcomed to try it<br>
&gt; out. Right click on the applet to modify its child widget size.<br>
&gt;<br>
&gt; &gt; As a workaround you have to manage the resize of your applet by hand when<br>
&gt; &gt; the size of the layout change.<br>
&gt;<br>
&gt; The question is how can I do it? When the embedded QGraphicsWidget need to<br>
&gt; enlarge, say from 200x200 to 400x400, how can I decide what the applet size<br>
&gt; should be?<br>
<br>
</div>Does this work?<br>
<font color="#888888"><br>
Petri<br>
<br>
</font><br>_______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
<br></blockquote></div><br>