Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-37336

Qt for iOS QPainter::drawText hangs first time it is called

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.2.1
    • GUI: Painting
    • None
    • iOS (iPhone4), OSX Mavericks
    • iOS/tvOS/watchOS

    Description

      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.

      QImage image(QSize(200, 200), QImage::Format_ARGB32_Premultiplied);
      image.fill(Qt::transparent);
      QPainter painter(&image);
      QPen pen(d->textColor);
      painter.setPen(pen);
      QFont font(d->fontFamily, d->fontSize);
      painter.setFont(font);
      qDebug() << "Before draw text";
      painter.drawText(QRect(0, 0, 200, 200), flags, d->text); //Blocking call
      qDebug() << "After draw text";

      I use the exact same code under Windows(Qt5.1) and I've never had any problems, it will run smoothly.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            ein André Santos
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes