[PyQt] Expansion of a QTextEdit when writing on it

Gerardo Gutierrez muzgash.lists at gmail.com
Sun Jun 27 08:35:45 BST 2010


Hi.

I have a slot which expands a QTextEdit when I write on it, but it's based
on the block count.

height=cell.fontMetrics().height()*(block_count+1)
cell.setGeometry(0,cell.pos().y(),cell.width(),height)

I've just realized that I need to do something else when the width of this
QTextEdit is smaller than the length of the line (block).
I mean, the QTextEdit doesn't expand when I write a very long line which
surpass the width of the QTextEdit, it just add a new line, but no a new
block.

Any ideas?

Thanks in advance.



Best regards.
--
Gerardo Gutiérrez Gutiérrez <http://he1.udea.edu.co/gweb>
Physics student
Universidad de Antioquia
Computational physics and astrophysics group
(FACom<http://urania.udea.edu.co/sites/sites.php>
)
Computational science and development
branch(FACom-dev<http://urania.udea.edu.co/sites/facom-dev/>
)
Usuario Linux #492295
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100627/6b310588/attachment.html>


More information about the PyQt mailing list