#include class MyWidget : public QWidget { public: MyWidget(QWidget *parent = 0) : QWidget(parent) {} protected: void paintEvent(QPaintEvent *) { QPainter p(this); QString str = QString("Loooooooooooooooooooong string%1Short alt.").arg(QChar(ushort(0x9c))); p.drawText(QRect(20, 20, 100, 100), 0, str); p.drawText(QRect(20, 40, 200, 100), 0, str); QStaticText st(str); p.drawStaticText(20, 60, st); } }; int main(int argc, char **argv) { QApplication a(argc, argv); MyWidget w; w.show(); return a.exec(); }