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. QML and platform defines
Forum Updated to NodeBB v4.3 + New Features

QML and platform defines

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 4 Posters 6.2k 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.
  • frankcyblogic.deF Offline
    frankcyblogic.deF Offline
    frankcyblogic.de
    wrote on last edited by
    #1

    I'd like to adjust the behavior of the QML code based on the target platform. Font size, extra buttons for touch only devices, etc... The question is are there any platform defines available? For instance like Qt.Q_WS_X11 ?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      moo1
      wrote on last edited by
      #2

      I ended up supplying such a info as a global variable into QML from C++. I'd like to know if there's a way not requiring C++.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        artem.marchenko
        wrote on last edited by
        #3

        You may be able to solve it during compile time. If your final target is a normal app that runs QML, you can use C preprocessor or the make rules to include a platform specific Settings.qml (or Settings.xml)

        1 Reply Last reply
        0
        • T Offline
          T Offline
          talmage
          wrote on last edited by
          #4

          unclewerner, how did you solve this problem?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            artem.marchenko
            wrote on last edited by
            #5

            I solved it here: http://developer.qt.nokia.com/forums/viewthread/5862/#38285

            Basically, you use macros on the C++ side to introduce a property to QML, the rest can be done in Javascript based on that property (or properties if you like to have many).

            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