Skip to content
Andersbakken edited this page Sep 13, 2010 · 2 revisions

Welcome to the LazyTextEdit wiki!

In lieu of a real bug tracking tool I’ll put this here:

1)

If you have a document with a long line (wider than the window) and word wrap is disabled, scrolling in a read-only document using the mouse to drag and select doesn’t work for characters beyond the initial window width. For example:
  • Click anywhere in the line of text, then drag to the right – this works ok. Once you hit the window edge, however, it doesn’t automatically scroll right, as it should.
  • You can move the scrollbars right, so the hidden text is now visible, but it can be selected or dragged over.

2)

  • Crash when scrolling up and down in big document with large lines:

> qtlazytextedit biglong
‘j’ 8273917 ‘f’ 16381 16384
Failed assumption textdocument_p.h:283 (current) doc→q→readCharacter(pos) == chunkData.at(offset)
‘k’ 8273916 ‘d’ 16380 16384

Failed assumption textdocument_p.h:283 (current) doc→q→readCharacter(pos) == chunkData.at(offset)
‘s’ 8273885 ’ ’ 16349 16384
Failed assumption textdocument_p.h:283 (current) doc→q→readCharacter(pos) == chunkData.at(offset)

Failed assumption textdocument_p.h:283 (current) doc→q→readCharacter(pos) == chunkData.at(offset)
‘:’ 8273872 ’
’ 16336 16384
Failed assumption textdocument_p.h:283 (current) doc→q→readCharacter(pos) == chunkData.at(offset)
viewportPosition 8273873 “: asdf asd” 0×8079380
ASSERT: “viewportPosition == 0 || document→read(viewportPosition – 1, 1) == QString(”\n")" in file textlayout_p.cpp, line 387

3)

  • Off-by-one error in TextCursor::movePosition. This showed up when I was creating a test to grab characters from a given position in the document using a
    +character index – it failed when trying to grab the last character in the document:
bool TextCursor::movePosition(TextCursor::MoveOperation op, TextCursor::MoveMode mode, int n) { …. case Right: d→overrideColumn = -1; if (mode == MoveAnchor && hasSelection()) { setPosition(position(), MoveAnchor); } else { setPosition(qBound(0, position() + (op == TextCursor::Left ? -1 : 1), d→document→documentSize() – 1), mode); } break; ..

The ‘-1’ caused the cursor not to select anything when I was trying to select the last character.

I modified the textcursor test to check for this – the latest code in GIT has this test failing without removing the ‘-1’ above.

4)

  • There’s always exactly one blank page right at the end of the document (ie. with the vertical scroll bar all the way at the bottom)

5)

  • If a line of text has a squiggly underline (QTextCharFormat::WaveUnderline), then if the row below is clicked, that row is redrawn and truncates the underline
    +on the row above

6)

  • If you scroll past the end of the document by holding down the cursor key, it will either assert or coredump (if editable or read-only, respectively):

(Assert in editable mode)
ASSERT: “textLayout→lines.size() <= 1 || (index != -1 && currentLine.isValid())” in file textcursor.cpp, line 222
Aborted (core dumped)

(Crash in read-only mode):

(Note: variable ‘eng’ is NULL)

0xf756efe4 in QTextLine::cursorToX (this=0xffff8ea4, cursorPos=0xffff8e74, edge=QTextLine::Leading) at text/qtextlayout.cpp:2041
2041 if (!eng→layoutData)
Current language: auto; currently c++

(gdb) where

  1. 0xf756efe4 in QTextLine::cursorToX (this=0xffff8ea4, cursorPos=0xffff8e74, edge=QTextLine::Leading) at text/qtextlayout.cpp:2041
  2. 0xf756003d in QTextLine::cursorToX (this=0xffff8ea4, cursorPos=0, edge=QTextLine::Leading) at ../../include/QtGui/../../src/gui/text/qtextlayout.h:194
  3. 0xf6ff555d in TextEdit::cursorRect (this=0×805eda0, textCursor=@0x8079f10) at textedit.cpp:648
  4. 0xf6ff5abe in TextEdit::ensureCursorVisible (this=0×805eda0) at textedit.cpp:1075
  5. 0xf6ff7927 in TextEdit::paintEvent (this=0×805eda0, e=0xffff9720) at textedit.cpp:283
  6. 0xf736992c in QWidget::event (this=0×805eda0, event=0xffff9720) at kernel/qwidget.cpp:7137
  7. 0xf77ce342 in QFrame::event (this=0×805eda0, e=0xffff9720) at widgets/qframe.cpp:635
  8. 0xf787c616 in QAbstractScrollArea::viewportEvent (this=0×805eda0, e=0xffff9720) at widgets/qabstractscrollarea.cpp:925
  9. 0xf787f716 in QAbstractScrollAreaPrivate::viewportEvent (this=0×805f0d0, event=0xffff9720) at widgets/qabstractscrollarea_p.h:80
  10. 0xf787f758 in QAbstractScrollAreaFilter::eventFilter (this=0×8079d00, o=0×805edc0, e=0xffff9720) at widgets/qabstractscrollarea_p.h:91
  11. 0xf7edbe62 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=0×804a1b8, receiver=0×805edc0, event=0xffff9720) at kernel/qcoreapplication.cpp:676
  12. 0xf72fceab in QApplicationPrivate::notify_helper (this=0×804a1b8, receiver=0×805edc0, e=0xffff9720) at kernel/qapplication.cpp:3774
  13. 0xf72fef59 in QApplication::notify (this=0xffffabc4, receiver=0×805edc0, e=0xffff9720) at kernel/qapplication.cpp:3743
  14. 0xf7ede111 in QCoreApplication::notifyInternal (this=0xffffabc4, receiver=0×805edc0, event=0xffff9720) at kernel/qcoreapplication.cpp:569
  15. 0xf730b22d in QCoreApplication::sendSpontaneousEvent (receiver=0×805edc0, event=0xffff9720) at
    +../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:196
  16. 0xf73789cc in qt_sendSpontaneousEvent (receiver=0×805edc0, event=0xffff9720) at kernel/qapplication_x11.cpp:4572

7)

  • TextEdit::currentCharFormat/setCurrentCharFormat not available. I used this with QTextEdit to get the current format so I could tweak it.

8)

  • TextDocumentFragment TextCursor::selection () const not available. I was using this to grab a QTextFragment (rather than just the selected text), so that it
    +includes all of the formatting information. I’m actually not using it in working code – I was using it in some test code which basically takes everything
    +formatted in a particular way and throws it onto a temporary document, so you’re ONLY seeing text which is highlighted that way, not the whole document. Put this
    +one on the back burner for now – I’m not sure if it’s necessary or if I could obtain the same result from using TextSections, but in any case, the code in question
    +isn’t likely to be used. It may come up in future, so I thought I’d mention it as something that’s missing.

9)

  • TextCursor::beginEditBlock/endEditBlock not available. I’m not sure if these are actually required with the lazy text widget, but there were a few places in
    +the code where I was using these as an optimization during large text changes with QTextEdit.
Clone this wiki locally