PDA

View Full Version : bug: setLineWrapMode



magland
23rd July 2007, 20:28
I am using Qt 4.3.0 on Windows

There seems to be a serious problem with QTextEdit when using
setLineWrapMode(QTextEdit::NoWrap)

The problem is that when typing toward the bottom of a moderately large text file, the interface starts dragging and becomes very slow - the difference is striking between the top and bottom of the document, and I think it gets worse for larger files.

If I remove the "setLineWrapMode" line, then everything works fine.

For a long time, I blamed it on my syntax highlighter, but now I'm quite certain that it's a Qt bug... Anyone encounter this kind of behaviour, or have an idea for a workaround?

Not sure if it's 4.3.0-specific, Windows-specific (or even my-particular-computer-specific :eek: )

Thanks.

edit: Here's a sample program that produces the behaviour:



#include <QApplication>
#include <QTextEdit>

int main(int argc, char *argv[]) {
QApplication app(argc, argv);

QTextEdit edit;

edit.setLineWrapMode(QTextEdit::NoWrap);
edit.showNormal();

bool ret=app.exec();
return ret;
}

rajesh
24th July 2007, 07:23
I have tested your code. it seems a bug in Qt.
after using setLineWrapMode(QTextEdit (http://doc.trolltech.com/4.2/QTextEdit.html)::NoWrap); I have entered a huge text then It become slow.
you can report to trolltech.

magland
24th July 2007, 12:05
I have tested your code. it seems a bug in Qt.
after using setLineWrapMode(QTextEdit (http://doc.trolltech.com/4.2/QTextEdit.html)::NoWrap); I have entered a huge text then It become slow.
you can report to trolltech.

Thanks for the confirmation that it's not just my computer :). I am using the following workaround in my project, which does the job, at least untill the bug is fixed...



setLineWrapMode(QTextEdit::FixedPixelWidth);
setLineWrapColumnOrWidth(10000);

parnurzeal
5th June 2011, 14:57
Now, I have this problem,too. It seems even newest Qt version hasn't fixed this problem,yet. :mad: