The shorter program posted by Chris crashes, too. (I am using Qt version 4.6.3 on Linux).

The backtrace suggests that l.show(); causes the crash, but there are no parameters hinting at the problem.

Here is the backtrace:
Qt Code:
  1. 0 QTextLine::layout_helper(int) /usr/lib/libQtGui.so.4 0 0xb77f1fae
  2. 1 QTextLine::setLineWidth(double) /usr/lib/libQtGui.so.4 0 0xb77f3dbc
  3. 2 ?? /usr/lib/libQtGui.so.4 0 0xb76d8c0a
  4. 3 ?? /usr/lib/libQtGui.so.4 0 0xb76d99c1
  5. 4 QFontMetrics::boundingRect(QRect const&, int, QString const&, int, int*) const /usr/lib/libQtGui.so.4 0 0xb77c3f3b
  6. 5 ?? /usr/lib/libQtGui.so.4 0 0xb79c5fd1
  7. 6 QLabel::minimumSizeHint() const /usr/lib/libQtGui.so.4 0 0xb79c6416
  8. 7 QLabel::sizeHint() const /usr/lib/libQtGui.so.4 0 0xb79c653b
  9. 8 QWidgetPrivate::adjustedSize() const /usr/lib/libQtGui.so.4 0 0xb75bddd9
  10. 9 QWidget::adjustSize() /usr/lib/libQtGui.so.4 0 0xb75c4c3d
  11. 10 QWidget::setVisible(bool) /usr/lib/libQtGui.so.4 0 0xb75cdb80
  12. 11 QWidget::show qwidget.h 485 0x08048992
  13. 12 main main.cpp 9 0x080488ad
To copy to clipboard, switch view to plain text mode 

Same in the program above: w.show() leads to the segfault.

It seems that this behavior was already detected as a bug in version 4.6.3 and fixed in 4.7.1
(Check http://bugreports.qt.nokia.com/browse/QTBUG-13546 and http://bugreports.qt.nokia.com/browse/QTBUG-11427)

In fact I should have found this earlier on my own, so thank you for helping me nevertheless.