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

Allow `Qt.labs.settings 1.0` to work with non-constant expressions.

    XMLWordPrintable

    Details

      Description

      When defining various settings for a qml project it might be useful to not set a standard value for width or height, but something that depends on a function. This could be useful if you want to account for pixel density of the various screens.

      test.qml
      Settings {
              id: settings
              property alias x: mainwindow.x
              property alias y: mainwindow.y
              property alias width: Units.dp(800)
              property alias height: Units.dp(600)
          } 
      

      Here Units.dp() returns a value depending on the screen it is currently being used, and as a result width or height will not function in my settings. Every time I open the app only information on x, and y position will be applied.

        Attachments

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

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            greenlafone7 Green
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes