<html><body><div style="color:#000; background-color:#fff; font-family:tahoma, new york, times, serif;font-size:10pt"><div>Let <i>self.win</i> be your widget, then <i>self.win.sizeHint()</i> returns the ideal or recommended size of your widget. </div><div><i>self.win.minimumSizeHint()</i> returns the minimum recommended size. you can set these to resize your widget.</div><div><br></div> <div style="font-size: 10pt; font-family: tahoma, 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Tom Bennett <tom.bennett@mail.zyzhu.net><br> <b><span style="font-weight: bold;">To:</span></b> pyqt@riverbankcomputing.com <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, November 24, 2011 9:43 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [PyQt] Resizing window
to smartly fit the contents<br> </font> <br>
<div id="yiv783707975"><div>Hi,</div><div> </div><div>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. </div>
<div> </div><div>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.</div>
<div> </div><div>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.</div>
<div> </div><div>I am wondering wat can be done to achieve this.</div><div> </div><div>Thanks,</div><div>Tom</div>
</div><br>_______________________________________________<br>PyQt mailing list <a ymailto="mailto:PyQt@riverbankcomputing.com" href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br><a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br><br> </div> </div> </div></body></html>