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

Drawing text with multi thread

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • 4.8.x
    • 4.6.1
    • GUI: Font handling
    • None
    • Debian Lenny

    Description

      My aim would be drawing images in different threads. In order to do that, I use QImage as paint device and QThread-based class for launching the drawing process.

      Everything looks normal, except the text drawing.
      The Qt that is used for compiling uses fontconfig, as suggested in the documentation (since text can not be rendered without fontconfig in the non-GUI threads). The documentation does not specify, but it seems that text can be rendered only if the used font is NOT a bitmap font.

      If bitmap fonts are allowed in fontconfig and a bitmap font is selected for text drawing, a "QPixmap: It is not safe to use pixmaps outside the GUI thread" message can be read when drawText() is called. (And sometimes the application crashes at this point. If it does not crash the result seems right).
      From the message it seems QPixmap (or QBitmap?) is used for bitmap font rendering, that is understandable, but.... how can be drawn bitmap fonts outside the GUI thread? Is it possible, or should we forget them?

      A difficult solution could be if text drawing is called in the GUI-thread (through a signal-slot connection), but the documentation warns: do not paint on one device from different threads at the same time.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            rajnaim Mark Rajnai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes