[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] QWidget.adjustSize
From:       Christian Caron <ccaron () fattoc ! com>
Date:       2009-08-30 2:48:33
Message-ID: BF021F3E-8FC7-46B0-A74A-1531E826FB9E () fattoc ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

I often find myself doing things like:

self.layout().addWidget(self.widget)
QTimer.singleShot(1, self.adjustSize)

It seems I need to let the event loop finish doing its business before  
attempting to adjust the size of the containing widget.
I'm guessing that the child widget aren't yet visible and thus their  
sizeHints are getting ignored.

Anyway, is there a cleaner way of achieving the same thing? The  
delayed update feels like a kludge to me.

Thanks,
Christian
[Attachment #5 (unknown)]

<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space; ">Hello,<div><br></div><div>I often find \
myself doing things like:</div><div><br></div><div><div><font \
class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" \
style="font-size: 14px;">self.layout().addWidget(self.widget)</span></font></div><div><font \
class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" \
style="font-size: 14px;">QTimer.singleShot(1, self.adjustSize) &nbsp; \
&nbsp;</span></font> &nbsp;</div><div><br></div><div>It seems I need to let the event \
loop finish doing its business before attempting to adjust the size of the containing \
widget.</div><div>I'm guessing that the child widget aren't yet visible and thus \
their sizeHints are getting ignored.</div><div><br></div><div>Anyway, is there a \
cleaner way of achieving the same thing? The delayed update feels like a kludge to \
me.</div><div><br></div><div>Thanks,</div><div>Christian</div></div></body></html>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic