Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
4.4.0
-
None
Description
On Qt for Mac, If many lines are added quickly using the append slot QTextEdit often misrenders the text after a resizing of the window... it shows multiple instances of the same lines, so that the display looks wrong and is hard to read.
This can be seen with the following example :
#include <QtGui>
//class MyTextEdit : public QPlainTextEdit
class MyTextEdit : public QTextEdit
{
Q_OBJECT
public:
MyTextEdit();
private slots:
void AddSomeText();
};
MyTextEdit :: MyTextEdit()
{
setReadOnly(true);
QTimer::singleShot(200, this, SLOT(AddSomeText()));
}
void MyTextEdit :: AddSomeText()
{
static int count = 0;
for (int i=0; i<6; i++)
QScrollBar * sb = verticalScrollBar();
sb->setValue(sb->maximum());
QTimer::singleShot(2000, this, SLOT(AddSomeText()));
}
int main(int argc, char ** argv)
{
QApplication app(argc, argv);
QWidget w;
w.setMinimumWidth(640);
QBoxLayout * vbl = new QBoxLayout(QBoxLayout::TopToBottom, &w);
vbl->setMargin(5);
vbl->setSpacing(5);
MyTextEdit * mpte = new MyTextEdit;
vbl->addWidget(mpte);
w.show();
return app.exec();
}
#include "main.moc"
Attachments
Issue Links
- resulted from
-
QTBUG-2525 QPlainTextEdit:text lines are not drawn correcty on Mac OS X after adjusting scrollbar
-
- Closed
-