This segfaults on OS X. You should only use QPainter inside a paintEvent (see http://doc.qt.digia.com/qt/qpainter.html).