On Tue, Mar 2, 2010 at 9:09 PM, Aaron J. Seigo <span dir="ltr"><<a href="mailto:aseigo@kde.org">aseigo@kde.org</a>></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>
> Ok, when I added<br>
> self.layout.setPreferredWidth(120)<br>
> that displays it correctly, but now it doesn't expand or contract at all<br>
> horizontally. It does expand and contract vertically, however. What should<br>
> I add so that the height and the width of the image scale relative to each<br>
> other?<br>
<br>
</div>in theory, KeepAspectRatio, but in practice that's not paid attention to by<br>
the panel. you'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't work. Do I need to completely re-implement drawing the pixmap in paintEvent? <br>