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

Add API to set the DPI of a QTextDocument

    XMLWordPrintable

Details

    • All

    Description

      QTextDocument has no way of defining a default DPI, so it will use qt_defaultDpi() instead, which is based on system settings (or 75 in the case of a non-GUI application). In principle, this is okay, since it will match the DPI of fonts, but it makes certain use cases difficult.

      For instance, if you want to get actual physical sizes e.g. in an image or on a printer, you have to account for the logical DPI factor of the system (or override this using AA_Use96Dpi), even if the QTextDocument is never drawn to any screen. This is not just an issue for fonts, but things like setting absolute sizes for an iframe (or a table) for instance, will also interpret the pixel size in terms of the system's logical DPI and scale all output to the target device based on this.

      If there was a way to set the DPI of the QTextDocument, it would make use cases like this a lot easier.

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              esabraha Eskil Abrahamsen Blomfeldt
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes