[Qt-interest] QPlainTextEdit.setLineWrapMode affects other QPlainTextEdits showing same document

Wilbert Berendsen wbsoft at xs4all.nl
Sun Jan 9 19:53:19 CET 2011


Hi all,

this is my first post, first thanks for the incredibly nice Qt libraries, 
which I'm using via PyQt4.

Then my question. I have written a dedicated source code texteditor using 
QPlainTextEdit as a view for QTextDocuments. The editor can show the same 
document in multiple views/panes or windows. All this works very well.

But as soon as I setLineWrapMode(QPlainTextEdit.WidgetWidth) on one of the 
views (QPlainTextEdit), it affects the layout of the same document in other 
views (even though the other views do not set their lineWrapMode property 
accordingly). The document lines in other views are broken as if that widget 
were the same width as the one setLineWrapMode was called for.

I understand that setting the linewrapmode affects the default QTextOption of 
the document.

But is there a way a QPlainTextEdit can show its lines wrapped, without 
affecting the display of the same document in other QPlainTextEdit instances?

Thanks in advance for any help or hints,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
        -- Mahatma Gandhi



More information about the Qt-interest-old mailing list