| Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 1 | |
Hi Trolls, in Qt4.4-tp1 (Linux, openSuse 10.2, KDE-3.5.8) I find problems with the display in QPlainTextEdit. When I have text in it and simply write something when the cursor is in the mid of a word, the line is not redrawn properly and I don't see the newly entered text. Also it seems the QSyntaxHighlighter does not work with that class (or maybe it's just the display of the resulting formats) Another problem is with the QTextBlockFormat: When I do some QTextBlockFormat format = paraBgCursor.blockFormat(); format.setBackground(bg); paraBgCursor.setBlockFormat(format); the result is what you see in the attachment: it just colors the first few pixels (QTextEdit colored the whole width of the text) -- [ signature omitted ]
On Thursday 20 December 2007 06:49:15 pm Martin Koller wrote: > Hi Trolls, > > in Qt4.4-tp1 (Linux, openSuse 10.2, KDE-3.5.8) I find problems with the > display in QPlainTextEdit. > When I have text in it and simply write something when the cursor is in the > mid of a word, the line is not redrawn properly and I don't see the newly > entered text. > > Also it seems the QSyntaxHighlighter does not work with that class > (or maybe it's just the display of the resulting formats) > > Another problem is with the QTextBlockFormat: > When I do some > QTextBlockFormat format = paraBgCursor.blockFormat(); > format.setBackground(bg); > paraBgCursor.setBlockFormat(format); > the result is what you see in the attachment: it just colors the first few > pixels (QTextEdit colored the whole width of the text) With my current 4.4 build I cannot reproduce either of them. Insertion of text works as do background block formats. It seems like some QTextDocument breakage slipped into the tech preview, please try a more recent snapshot instead. Matthias To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Hi Matthias, On Friday 21 December 2007, Matthias Ettrich wrote: > With my current 4.4 build I cannot reproduce either of them. Insertion of > text works as do background block formats. It seems like some QTextDocument > breakage slipped into the tech preview, please try a more recent snapshot > instead. I found the problem with the syntax highlighter to be my mistake, as I converted my widget from QTextEdit to QPlainTextEdit but QSyntaxHighlighther has no constructor with QPlainTextEdit but only with QTextEdit ... So I now solved it by explicitely setting the document. But the wrong display when entering text is still there (using snapshot 20071220) - see attached screenshot (I enetered "abcdefghijk", positioned the cursor after "a" and entered "123"). Only after selecting the line I see all characters (see attached screenshot) I found the culprit: it's only seen when you call setLineWrapMode(QPlainTextEdit::NoWrap); This is also the culprit for the paragraph QTextBlockFormat being not correctly displayed. But there is another funny thing: When I have "NoWrap" enabled in a QTextEdit widget, the paragraph background color I set into QTextBlockFormat is shown only for the width of the text. When I don't set the "NoWrap" then the color is shown for the full widget width. Is that an intended behaviour ? -- [ signature omitted ]
Attachment:
signature.asc
Description: This is a digitally signed message part.