kalos80
26th July 2010, 09:23
My Qt application keeps on crashing when the tooltip in the attached file is shown.
To reproduce the problem just set a widget tooltip in the following way:
QFile file("tooltip.txt");
file.open(QIODevice::ReadOnly);
QTextStream stream(&file);
QString tooltipText = stream.readAll();
file.close();
myWidget->setToolTip(tooltipText);
I'm using the latest version of Qt (4.6.3) on Windows
I'm going to submit a bugreport, but in the meanwhile can anyone suggest me a solution to fix this crash problem?
Thanks in advance for your help
Update:
I attached a simple project to reproduce the problem.
I compile that project with Qt 4.6.3 and Visual Studio 2008 Express on Windows Xp
In debug mode it crashes always when I move the mouse on top of the widget and the tooltip is shown. In relase mode sometimes it crashes sometimes not.
Here is part of the call stack when it crashes:
tGuid4.dll!`anonymous namespace'::LineBreakHelper::currentGlyph() Line 1683 + 0x1a bytes C++
QtGuid4.dll!`anonymous namespace'::LineBreakHelper::adjustRightBearing() Line 1692 + 0xe bytes C++
QtGuid4.dll!QTextLine::layout_helper(int maxGlyphs=2147483647) Line 1931 C++
QtGuid4.dll!QTextLine::setLineWidth(double width=8388607.0000000000) Line 1602 C++
QtGuid4.dll!qt_format_text(const QFont & fnt={...}, const QRectF & _r={...}, int tf=134218769, const QTextOption * option=0x00000000, const QString & str={...}, QRectF * brect=0x00000000, int tabstops=48, int * __formal=0x00000000, int tabarraylen=0, QPainter * painter=0x0012cb54) Line 7747 C++
QtGuid4.dll!QPainter::drawText(const QRect & r={...}, int flags=1041, const QString & str={...}, QRect * br=0x00000000) Line 5807 + 0x41 bytes C++
QtGuid4.dll!QStyle::drawItemText(QPainter * painter=0x0012cb54, const QRect & rect={...}, int alignment=1041, const QPalette & pal={...}, bool enabled=true, const QString & text={...}, QPalette::ColorRole textRole=ToolTipText) Line 541 C++
QtGuid4.dll!QLabel::paintEvent(QPaintEvent * __formal=0x0012d3f0) Line 1038 C++
QtGuid4.dll!QTipLabel::paintEvent(QPaintEvent * ev=0x0012d3f0) Line 230 C++
QtGuid4.dll!QWidget::event(QEvent * event=0x0012d3f0) Line 8191 C++
.....
To reproduce the problem just set a widget tooltip in the following way:
QFile file("tooltip.txt");
file.open(QIODevice::ReadOnly);
QTextStream stream(&file);
QString tooltipText = stream.readAll();
file.close();
myWidget->setToolTip(tooltipText);
I'm using the latest version of Qt (4.6.3) on Windows
I'm going to submit a bugreport, but in the meanwhile can anyone suggest me a solution to fix this crash problem?
Thanks in advance for your help
Update:
I attached a simple project to reproduce the problem.
I compile that project with Qt 4.6.3 and Visual Studio 2008 Express on Windows Xp
In debug mode it crashes always when I move the mouse on top of the widget and the tooltip is shown. In relase mode sometimes it crashes sometimes not.
Here is part of the call stack when it crashes:
tGuid4.dll!`anonymous namespace'::LineBreakHelper::currentGlyph() Line 1683 + 0x1a bytes C++
QtGuid4.dll!`anonymous namespace'::LineBreakHelper::adjustRightBearing() Line 1692 + 0xe bytes C++
QtGuid4.dll!QTextLine::layout_helper(int maxGlyphs=2147483647) Line 1931 C++
QtGuid4.dll!QTextLine::setLineWidth(double width=8388607.0000000000) Line 1602 C++
QtGuid4.dll!qt_format_text(const QFont & fnt={...}, const QRectF & _r={...}, int tf=134218769, const QTextOption * option=0x00000000, const QString & str={...}, QRectF * brect=0x00000000, int tabstops=48, int * __formal=0x00000000, int tabarraylen=0, QPainter * painter=0x0012cb54) Line 7747 C++
QtGuid4.dll!QPainter::drawText(const QRect & r={...}, int flags=1041, const QString & str={...}, QRect * br=0x00000000) Line 5807 + 0x41 bytes C++
QtGuid4.dll!QStyle::drawItemText(QPainter * painter=0x0012cb54, const QRect & rect={...}, int alignment=1041, const QPalette & pal={...}, bool enabled=true, const QString & text={...}, QPalette::ColorRole textRole=ToolTipText) Line 541 C++
QtGuid4.dll!QLabel::paintEvent(QPaintEvent * __formal=0x0012d3f0) Line 1038 C++
QtGuid4.dll!QTipLabel::paintEvent(QPaintEvent * ev=0x0012d3f0) Line 230 C++
QtGuid4.dll!QWidget::event(QEvent * event=0x0012d3f0) Line 8191 C++
.....