Bug#476217: Bug#485597: psi vs Qt4.4.0-3 segmentation fault
This definitely looks like a qt bug: I just wrote a relatively simple
test program to reproduce it without using psi.
The attached files contain a simple application, which just opens a
window containing a single QTextEditor, and, from a timer, continously
adds '.' characters with the QTextCharFormat::SpellCheckUnderline style.
On my computer, it reproducibly crashes within less than a second.
I hope this helps debugging.
Jan
#include <QApplication>
#include <QLabel>
#include <QTextCharFormat>
#include <QTextDocument>
#include <QTextEdit>
#include <QTextCursor>
#include <QColor>
#include <QTimer>
#include "main.h"
App::App(int argc, char *argv[]) : QApplication(argc,argv) {
tcf = new QTextCharFormat();
tcf->setUnderlineColor(QColor(255,0,0));
tcf->setUnderlineStyle(QTextCharFormat::SpellCheckUnderline);
QTextDocument *document = new QTextDocument();
QTextEdit *hello = new QTextEdit();
hello->setDocument(document);
hello->resize(100, 30);
hello->show();
cursor = new QTextCursor(document);
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(10);
}
void App::update() {
cursor->insertText(".",*tcf);
}
int main(int argc, char *argv[])
{
App app(argc, argv);
return app.exec();
}
######################################################################
# Automatically generated by qmake (2.01a) Mon Jul 7 00:18:03 2008
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += main.cpp
HEADERS += main.h
CONFIG += qt debug
#include <QApplication>
#include <QLabel>
#include <QTextCharFormat>
#include <QTextDocument>
#include <QTextEdit>
#include <QTextCursor>
#include <QColor>
#include <QTimer>
class App : public QApplication
{
Q_OBJECT
public:
App(int argc, char *argv[]);
public slots:
void update();
private:
QTextCharFormat *tcf;
QTextCursor *cursor;
};
Reply to: