Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator and QML files
Forum Updated to NodeBB v4.3 + New Features

QtCreator and QML files

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 6.5k 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.
  • B Offline
    B Offline
    bergo.torino
    wrote on last edited by
    #1

    Hello,

    i have a troubles with understanding how QtCreator manages QtQuick projects. In general I have problems with understanding how to structure an application which uses both .qml files and some C++ as well. When I create a QtQuick project i see my .qml files listed in project view under a 'qml icon'. Later they are copied to out-of-source build folder.
    Recently I have created a normal Qt GUI application and later decided to add some QML.. I was suprised when I noticed that .qml files are visible as 'other files' rather than 'qml files' on the project tree and they are not copied to the out-of-source build directory.

    So what makes the difference?

    thanks for all suggestions, it is probably something simple which Im for some reason not able to see.

    It's compiling - mostly I'm slacking off ;)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexisdm
      wrote on last edited by
      #2

      When you start a C++ project with QML, a file qmlapplicationviewer.pri is included in your .pro file and a new variable DEPLOYMENTFOLDERS is added:
      @
      #folder where the qml files are
      folder_01.source = qml/projectName
      #destination folder in the build directory and the install directory
      folder_01.target = qml
      DEPLOYMENTFOLDERS = folder_01
      ...

      include(qmlapplicationviewer/qmlapplicationviewer.pri)
      qtcAddDeployment()@

      The function qtcAddDeployment() from the .pri file takes care of copying the file from that directory to the out-of-source build folder and to the install folder (through the use of the variables QMAKE_EXTRA_TARGET and INSTALLS).
      Apparently everything in the INSTALLS variable is also automagically displayed in the project tree in QtCreator without being listed as OTHER_FILES in the .pro.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bergo.torino
        wrote on last edited by
        #3

        Thanks, so there is a chance that it will work. Anyway it is still hard to make this working for Qt application to which QML is added later.

        It's compiling - mostly I'm slacking off ;)

        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