[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt]  Expansion of a QTextEdit when writing on it
From:       Gerardo Gutierrez <muzgash.lists () gmail ! com>
Date:       2010-06-27 7:35:45
Message-ID: AANLkTik6G1CLKtDEyAunu97oM-vkTaZSHZP4bK-HXGvr () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

<div>Hi.</div><div><br></div><div>I have a slot which expands a QTextEdit when I \
write on it, but it&#39;s based on the block \
count.</div><div><br></div><div>height=cell.fontMetrics().height()*(block_count+1)<br> \
cell.setGeometry(0,cell.pos().y(),cell.width(),height)<br> \
</div><div><br></div><div>I&#39;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).</div><div>I mean, the QTextEdit doesn&#39;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.</div> <div><br></div><div>Any ideas?</div><div><br></div><div>Thanks in \
advance.</div><div><br></div><div><font color="#888888"><br><br>Best \
regards.<br>--<br><a href="http://he1.udea.edu.co/gweb" target="_blank">Gerardo \
Gutiérrez Gutiérrez</a><br> Physics student<br>Universidad de \
Antioquia<br>Computational physics and astrophysics group (<a \
href="http://urania.udea.edu.co/sites/sites.php" target="_blank">FACom</a>)<br>


Computational science and development branch(<a \
href="http://urania.udea.edu.co/sites/facom-dev/" \
target="_blank">FACom-dev</a>)<br>Usuario Linux #492295</font><br><br> <br>
<br></div>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic