On Tue, Mar 2, 2010 at 9:09 PM, Aaron J. Seigo <span dir="ltr">&lt;<a href="mailto:aseigo@kde.org">aseigo@kde.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On March 2, 2010, Antony Loebs wrote:<br>

&gt; Ok, when I added<br>
&gt; self.layout.setPreferredWidth(120)<br>
&gt; that displays it correctly, but now it doesn&#39;t expand or contract at all<br>
&gt; horizontally. It does expand and contract vertically, however. What should<br>
&gt; I add so that the height and the width of the image scale relative to each<br>
&gt; other?<br>
<br>
</div>in theory, KeepAspectRatio, but in practice that&#39;s not paid attention to by<br>
the panel. you&#39;ll need to keep the pixmap in ratio in your paint event.<br></blockquote></div><br>Hmm...I added the following <br>def paintEvent(self, event):<br>    size = self.geometry()<br>    height = size.height()<br>
    self.resize(height * 4, height)<br><br>But that doesn&#39;t work. Do I need to completely re-implement drawing the pixmap in paintEvent? <br>