[PyQt] Help on resizing a custom widget

skawaii skawaii at gmail.com
Tue Aug 28 21:54:15 BST 2007



David Boddie wrote:
> 
> It sounds like you have a widget in a dialog, but you're not using a
> layout manager, so nothing is resizing the widget. I wrote a tutorial
> for EuroPython last year that covered the basic principles of PyQt:
> 
> http://indico.cern.ch/contributionDisplay.py?contribId=33&sessionId=41&confId=44
> 

Thanks for the reply and for pointing me into the right direction. Your
tutorial is very good and got me started.

The problem I'm having with the built-in layout managers is that I have a
very specific layout that I want and the managers are wrecking it. Well,
they're doing what they're supposed to do. So it looks like I'll be
reimplementing QWidget::resizeEvent() and Qwidget::event(), as per
http://doc.trolltech.com/4.3.0/layout.html#manual-layout.

I have a question regarding QWidget::event(). The docs say to reimplement
event() to handle QEvent::LayoutRequest. That's straightforward, but how do
I want to handle that request? Should I be returning something there and, if
so, what do I return for a manual layout?



> Newcomers to PyQt who prefer printed materials should note that a book on
> PyQt programming will be available in the near future:
> 
>   http://qtrac.eu/pyqtbook.html
> 

I did indeed notice that book in my searches...was flabbergasted when I
realized that it hadn't been published yet. :confused:

-- 
View this message in context: http://www.nabble.com/Help-on-resizing-a-custom-widget-tf4337591.html#a12375767
Sent from the PyQt mailing list archive at Nabble.com.



More information about the PyQt mailing list