[PyQt] Resizing window to smartly fit the contents

Tom Bennett tom.bennett at mail.zyzhu.net
Thu Nov 24 07:43:36 GMT 2011


Hi,

I have a window that contains a composite widget that in turn contains some
basic widgets and a table view. Depending on different situations, the
table view can have a little or a lot data.

What I want is for the window to show a reasonable default size when it
comes up. In other words, when there is a little data, don't show a huge
window; when there is a lot of data, don't show a tiny window.

To make things more complicated, there has to be some minimum and maximum
size. For example, the window size cannot be bigger than the screen size.
But using the screen size is not exactly right, because the desktop system
occupies part of the screen. For example, on Windows, the bottom area of
the main screen is reserved for the system task bar, and should not be
covered by my window, whereas on the second screen usuallt one can occupy
the whole screen size.

I am wondering wat can be done to achieve this.

Thanks,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20111124/18b23424/attachment.html>


More information about the PyQt mailing list