Sorry, that previous email should have explained that within the main QFrame I am attempting to lay everything out using gridlayout.<br><br><div class="gmail_quote">On Thu, Sep 9, 2010 at 2:06 PM, Peter Milliken <span dir="ltr"><<a href="mailto:peter.milliken@gmail.com">peter.milliken@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Probably not. The code snippet might be a bad example. I am attempting to create a QFrame in the MainWindow and populate it with a number of pairs of lQLabel/QLineEdit. One of the "pairs" needs to be a QLabel/QTextEdit and unfortunately as soon as I add that the grid seems to 'explode' - in the vertical direction. I just want a QTextEdit sized about 3 or 4 times the height of a QLineEdit.<div>
<br></div><div>Thanks for the suggestion</div><div>Peter<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Thu, Sep 9, 2010 at 1:58 PM, Algis Kabaila <span dir="ltr"><<a href="mailto:akabaila@pcug.org.au" target="_blank">akabaila@pcug.org.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>On Thursday 09 September 2010 13:03:14 Peter Milliken wrote:<br>
> I cannot work out how to (re)size a QTextEdit widget. I have tried various<br>
> methods, without success. I show one method in the following code snippet,<br>
> I would appreciate it if somebody could point out my error :-)<br>
><br>
> Thanks<br>
> Peter<br>
><br>
> from PyQt4.QtCore import *<br>
> from PyQt4.QtGui import *<br>
> import PyQt4.Qt as Qt<br>
> import sys<br>
><br>
> class Test(QMainWindow):<br>
> def __init__ (self, parent = None):<br>
> super(Test, self).__init__(parent)<br>
> self.frame = QFrame()<br>
> self.setCentralWidget(self.frame)<br>
> grid = QGridLayout()<br>
> grid.addWidget(QLabel("Desc:"), 0, 0)<br>
> self.description = QTextEdit()<br>
> currentSize = self.description.size()<br>
> print currentSize<br>
> currentSize.scale(50,25, Qt.IgnoreAspectRatio)<br>
> self.description.resize(currentSize)<br>
> grid.addWidget(self.description, 0, 1)<br>
> self.frame.setLayout(grid)<br>
><br>
> if __name__ == '__main__':<br>
><br>
> app = QApplication(sys.argv)<br>
><br>
> Gui = Test()<br>
> Gui.show()<br>
> app.exec_()<br>
<br>
</div></div>Would the following satisfy your immediate needs?<br>
<div><br>
from PyQt4.QtGui import *<br>
import PyQt4.Qt as Qt<br>
import sys<br>
<br>
class Test(QMainWindow):<br>
def __init__ (self, parent = None):<br>
super(Test, self).__init__(parent)<br>
</div> self.resize(600, 300) # Added statement<br>
<div><div></div><div> self.frame = QFrame()<br>
self.setCentralWidget(self.frame)<br>
grid = QGridLayout()<br>
grid.addWidget(QLabel("Desc:"), 0, 0)<br>
self.description = QTextEdit()<br>
currentSize = self.description.size()<br>
# print currentSize<br>
# currentSize.scale(50,25, Qt.IgnoreAspectRatio)<br>
self.description.resize(currentSize)<br>
grid.addWidget(self.description, 0, 1)<br>
self.frame.setLayout(grid)<br>
if __name__ == '__main__':<br>
app = QApplication(sys.argv)<br>
Gui = Test()<br>
Gui.show()<br>
app.exec_()<br>
<br>
</div></div><font color="#888888">--<br>
OldAl<br>
<a href="mailto:akabaila@pcug.org.au" target="_blank">akabaila@pcug.org.au</a><br>
</font></blockquote></div><br></div></div></div>
</blockquote></div><br>