I'm using Qt for iOS 5.2 and when trying to draw text using QPainter, it will hang on that call for a few seconds (5 seconds on iPhone4 and around 3 on OSX). After that first time, it won't block anymore if I call it again.

Qt Code:
  1. QImage image(QSize(200, 200), QImage::Format_ARGB32_Premultiplied);
  2. image.fill(Qt::transparent);
  3. QPainter painter(&image);
  4. QPen pen(d->textColor);
  5. painter.setPen(pen);
  6. QFont font(d->fontFamily, d->fontSize);
  7. painter.setFont(font);
  8. qDebug() << "Before draw text";
  9. painter.drawText(QRect(0, 0, 200, 200), flags, d->text); //Blocking call
  10. qDebug() << "After draw text";
To copy to clipboard, switch view to plain text mode 

I'm using the same example in Windows(Qt5.1) and I've never had any problems, this same code runs smoothly.

I had to execute that code in another thread so it won't block the application, but most likely I'll need to see text as soon as the application is launched. I've tested with QStaticText as well with no luck.

Is anyone experiencing the same problem? Is there any workaround?