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

QPicture DPI

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.7.3
    • GUI: Painting
    • None

      The QPicture paint device appear to always have the system DPI (screen DPI). When painting they always scale the image by the ratios between the system and destination DPI.

      This behaviour is pretty horrid for a number of reasons:

      • If the system DPI doesn't have the same X and Y DPI the images will often get squashed (as drawing code assumes equal X and Y, e.g. for drawing circles and text)
      • Makes it difficult to use an intermediate drawing format to pass rendered output between parts of the program. If you know your final output will have a certain DPI, you want to render everything with this DPI.
      • If a system has a different screen DPI then the final output from painting the QPicture will be different from another system (due to the scaling commands in the output). This breaks output file consistency between different systems.
      • Might cause the problems in PDF character spacing: QTBUG-4974 and differences between integer and floating point coordinates.

      I'm not suggesting that the default should be changed, but it would be easy to fix these probklems by:

      • have a setResolution method like QPrinter to change the apparent DPI of the QPicture to users drawing onto it
      • have an option to switch off DPI scaling when rendering a QPicture to a QPainter.

      This is probably a few line patch which wouldn't break any existing code.

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

            rodal Samuel Rødal
            jeremysanders Jeremy Sanders
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes