PDA

View Full Version : setVisible textblock in QTextEdit



corrado
23rd April 2010, 16:23
Hi everyone,

i tried to hide textblock's in QTextEdit, but it doesn't work:


block = textedit.document().begin()
block.setVisible(False)


This code works fine for QPlainTextEdit, but not for QTextEdit. In documentation i haven't found any mention of how it should work for QTextEdit, just following:

void QTextBlock::setVisible ( bool visible ) Sets the block's visibility to visible.

This function was introduced in Qt 4.4.

See also isVisible().

How can i hide block's in QTextEdit?

Thank you in advance

JohannesMunk
25th April 2010, 12:15
Hi Corrado!

Some time ago I ran into the same problem. We couldn't find a solution then, except using QPlainTextEdit..

http://www.qtcentre.org/threads/26531-QTextBlock-setVisible%28false%29-has-no-effect-unresolved?highlight=

If you can, just leave it and wait for the trolls to come up with a fix for that!

Johannes

corrado
27th April 2010, 04:04
Thanks, i saw your theme. I have to use QTextEdit because only it supports margin settings