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

Improve high-DPI auto-testing

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P2: Important
    • 6.0
    • 6.x
    • GUI: High-DPI
    • None

    Description

      Goal
      We'd like to Improve auto-test coverage of Qts high-DPI support, including CI regression testing. This requires running auto-tests in environments that does not have physical screens, by simulating (multiple) virtual screens:

      Changes

      Mock testing with the offscreen platform plugin overview

      (as implemented in the changes above)

      The offscreen platform plugin now supports taking a config file which specifies the virtual screen configuration: (example)

      {
          “screens”: [
              {
              "name", "screen-1",
              "x", 0,
              "y", 0,
              "width", 640,
              "height", 480,
              "dpi", 96,
              "dpr", 1,
              },
              …
          ]
      }
      

      The config file path is specified using platform plugin arguments:

      -platform offscfreen:configfile=/path/to/file
      

      This enables two use cases:

      • Running existing tests on any mock configuration. E.g, can tst_QWindow handle two screens with different DPI.
      • Writing new tests witch instantiates different mock configurations, and then verifies that a specific Qt API/feature works as expected. (In practice, this is done by re-creating the QApplication a new config file.)

      Future Work

      • How can this be configured from e.g. a CI system script? Support specifying the config file by environment variable as well?
      • Support events: "screen disconnected", "DPI changed".
        • sepcify events/timing using JSON config file.
        • Add QTestLib API for e.g. setting screen configuration.
      • Can this be used by applications?

      Limitations:

      • Platform plugin code is not tested - we should implement as much in QtGui as possible
      • We risk tailoring our tests to our the offscreen platform plugin implementation. Remember to test on actual platforms as well.

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            sorvig Morten Sørvig
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes