Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED] Is exist fututre plans for supproting tech like qss in qml?

[SOLVED] Is exist fututre plans for supproting tech like qss in qml?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Milovidov
    wrote on last edited by
    #1

    Hi all!

    I interested in this because I don't understand how I can create several designs for several platforms in my app.
    I don't want to create several projects for each platform, I want to load predefined design in compilation time.
    And also I don't want create different qml files.

    I already read this topic "http://qt-project.org/wiki/QmlStyling":http://qt-project.org/wiki/QmlStyling , but this not provide what I need because I don't can change singleton qml file in compilation time.

    Is exist any ways or is will be?

    Thank you for your attention!

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      There are two mechanisms that you can already make use of to do this.
      As for your style, I would suggest you create multiple versions of a file called something like Constants.qml, containing properties like marginWidth, titleColor, baseColor, buttonPixmap etc.

      Then you can load this into your application on a per-platform basis, by either creating a loader:

      @
      Loader {
      source: switch(Qt.platform.os) {
      case "android: ...
      case "windows: ...
      }
      @
      etc

      Or alternatively, with Qt 5.2 there are new platform selectors that allows ou to build multiple versions of your application with specific file names/directories for different platforms:

      http://qt-project.org/doc/qt-5/qqmlfileselector.html

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Milovidov
        wrote on last edited by
        #3

        Thank you very much!

        This is better solutions from this that I saw before!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved