Deploy Qt5 QML application

前端 未结 5 1606
广开言路
广开言路 2020-12-03 11:49

To test QML deployment I\'ve created a very simple QML application. Here is the code:

main.cpp

#include 

        
5条回答
  •  无人及你
    2020-12-03 12:25

    You need to deploy the application, for this purpose I use the utility cqtdeployer

    This utility itself collects all the necessary dependencies of your application and you do not have to spend your time on it, or you can automate this process.

    You can install from github releases (Windows)

    or

    from snapstore (Linux)

    sudo snap install cqtdeployer
    

    You can use as follows:

    • Windows:
    %cqtdeployer% -bin myApp -qmake path/to/Qt/5.x.x/build/bin/qmake.exe -qmlDir path/to/my/qml/files/dir
    
    • Linux:
    cqtdeployer -bin myApp -qmake path/to/Qt/5.x.x/build/bin/qmake -qmlDir path/to/my/qml/files/dir
    
    • path/to/Qt/5.x.x/build/bin/qmake - This is the way qmake is used to build your program.

    • path/to/my/qml/files/dir - this is the path directly to your qml file (which you wrote)

    And Run application with sh script (Linux) or exe (Windows)

    If you'll use the version from snap then make sure that you have all the permissions.

    If you need use windows version just install application from installer

提交回复
热议问题