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. Make QML executable on Mac (1.0.1)
Qt 6.11 is out! See what's new in the release blog

Make QML executable on Mac (1.0.1)

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.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
    Bidochon
    wrote on last edited by
    #1

    Using the simplest QML application ever (the helloWord application), I'm just trying to make the executable.
    I created a blank application using New Project>Applications>Qt Quick Application
    So I get the following folder structure
    @myApplication
    |- myApplication.pro
    |- qtquick2applicationviewer
    | |- qtquick2applicationviewer.pri
    | |- Headers
    | |- Sources
    |- Sources
    | |- main.cpp
    |- QML
    |- qml/myApplication
    |- main.qml
    @

    so, from the command line, all I do is
    @

    qmake
    make install
    @

    and when I try to launch the application, I get
    @
    file:////<path_to_folder>/myApplication/main.qml: File not found
    @

    And if I do move the qml file at this location, it works.

    here is my .pro file
    @

    Add more folders to ship with the application, here

    folder_01.source = qml/myApplication
    folder_01.target = qml
    DEPLOYMENTFOLDERS = folder_01

    Additional import path used to resolve QML modules in Creator's code model

    QML_IMPORT_PATH =

    The .cpp file which was generated for your project. Feel free to hack it.

    SOURCES += main.cpp

    Installation path

    target.path =

    Please do not modify the following two lines. Required for deployment.

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

    As you can see, I can not make this application simpler… I guess I'm missing something basic but can't figure out which one.

    Thanks

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You can move QML files into a Qt Resource file (qrc), then it will always work. Or run your app from Qt Creator (not command line) and it should also be working.

      (Z(:^

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bidochon
        wrote on last edited by
        #3

        Thanks sierdzio.

        I will surely look into this Qt Resource file.

        I also figured out that to launch the application, I had to run (from the command line) the myApplication inside the myApplication.app/Contents/MacOs folder.

        Now I just need to figure out why, if I move that same folder into another Mac computer, it does not work !

        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