• Type: User Story
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: api, scalability


      This API should contain only properties of the physical display.

      The API contains basically three different properties: resolution, dpi and orientation. In addition to the raw numbers there are quantized (and enumerated) values for those.

      Furthermore the API proposal contains a Q_INVOKABLE setter for resolution & dpi. This is to enable scalability testing on desktop environment by simulating different physical displays.

      The class should be exposed to QML as a context property called "screen". The class should be registered as "uncreatable".

      // Pixel size properties
      Q_PROPERTY(int width READ width NOTIFY widthChanged FINAL)       // changes according to orientation
      Q_PROPERTY(int height READ height NOTIFY heightChanged FINAL)    // changes according to orientation
      Q_PROPERTY(int displayWidth READ displayWidth NOTIFY displayChanged FINAL)   // constant
      Q_PROPERTY(int displayHeight READ displayHeight NOTIFY displayChanged FINAL) // constant
      // orientation control properties
      Q_PROPERTY(int rotation READ rotation NOTIFY currentOrientationChanged FINAL)
      Q_PROPERTY(Orientation currentOrientation READ currentOrientation NOTIFY currentOrientationChanged FINAL)
      Q_PROPERTY(Orientations allowedOrientations READ allowedOrientations WRITE setAllowedOrientations NOTIFY allowedOrientationsChanged FINAL)
          enum Orientation {
              Default = 0,
              Portrait = 1,
              Landscape = 2,
              PortraitInverted = 4,
              LandscapeInverted = 8,
              All = 15
          // Page needs new enumeration "Manual" to control the orientation via screen API.
      // Physical size properties
      Q_PROPERTY(qreal dpi READ dpi NOTIFY displayChanged FINAL)
      Q_PROPERTY(DisplayCategory displayCategory READ displayCategory NOTIFY displayChanged FINAL) // Small, Normal, Large, ExtraLarge
      Q_PROPERTY(Density density READ density NOTIFY displayChanged FINAL) // Low, Medium, High, ExtraHigh
      // RnD: testing purposes - maybe not documented to 3rd parties.
      Q_INVOKABLE void privateSetDisplay(int width, int height, qreal dpi);


          Issue Links

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



              • Assignee:
                skananoj Sami Kananoja
                skananoj Sami Kananoja
              • Votes:
                2 Vote for this issue
                6 Start watching this issue


                • Created:

                  Gerrit Reviews

                  There are no open Gerrit changes