[PyQt] Self-adjusting QTextEdit (PyQt4)
wildemar at freakmail.de
Sat Apr 26 13:49:11 BST 2008
I'm trying to write a notecard application, somewhat in the vein of
Evernote --- basically a succession of little textboxes, one per note,
stacked above one another. To that end I'd like a QTextEdit (or similar)
that adjusts its height (with given width) so that it always shows all
its text, never more, never less.
This is what I've come up with (complete runable example attached):
def __init__(self, parent=None):
self.connect(self, core.SIGNAL("textChanged()"), self.updateGeometry)
policy = gui.QSizePolicy(gui.QSizePolicy.MinimumExpanding,
def heightForWidth(self, w):
This does not work as I hoped, naturally. :(
How would I go about this?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3002 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080426/1a4b3805/minimal.py
More information about the PyQt