在linux中,我只想部署qml依赖,如何部署从qmlimportscanner中获得json内容

eh57zj3b  于 2023-03-22  发布在  Linux
关注(0)|答案(1)|浏览(129)

我经营这个

qmlimport scanner -rootPath  `myproject source` -importPat `qt installed path /qml/`

然后得到如下:

[
    {
        "name": "QtQml",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQml",
        "type": "module",
        "version": "2.12"
    },
    {
        "classname": "QtQuickLayoutsPlugin",
        "name": "QtQuick.Layouts",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Layouts",
        "plugin": "qquicklayoutsplugin",
        "type": "module",
        "version": "1.12"
    },
    {
        "classname": "QtQuickControls2Plugin",
        "name": "QtQuick.Controls",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls.2",
        "plugin": "qtquickcontrols2plugin",
        "type": "module",
        "version": "2.12"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "QmlCpp",
        "type": "module",
        "version": "1.0"
    },
    {
        "name": "../Shapes",
        "path": "../subDir/dv_qmlLib/dv_qmlLib/ItemsControls/Shapes",
        "type": "directory"
    },
    {
        "classname": "QtQuickTemplates2Plugin",
        "name": "QtQuick.Templates",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Templates.2",
        "plugin": "qtquicktemplates2plugin",
        "type": "module",
        "version": "2.5"
    },
    {
        "classname": "QtQuick2WindowPlugin",
        "name": "QtQuick.Window",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Window.2",
        "plugin": "windowplugin",
        "type": "module",
        "version": "2.2"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.0"
    },
    {
        "name": "../Shapes",
        "path": "../subDir/dv_qmlLib/dv_qmlLib/Buttons/Shapes",
        "type": "directory"
    },
    {
        "classname": "QtQmlModelsPlugin",
        "name": "QtQml.Models",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQml/Models.2",
        "plugin": "modelsplugin",
        "type": "module",
        "version": "2.12"
    },
    {
        "classname": "QtQuick2WindowPlugin",
        "name": "QtQuick.Window",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Window.2",
        "plugin": "windowplugin",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "dv_qmlLib",
        "type": "module",
        "version": "1.0"
    },
    {
        "classname": "QtQuickControls1Plugin",
        "name": "QtQuick.Controls",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls",
        "plugin": "qtquickcontrolsplugin",
        "type": "module",
        "version": "1.4"
    },
    {
        "name": "QtQuick.Controls.Styles",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls/Styles",
        "type": "module",
        "version": "1.4"
    },
    {
        "name": "QmlCpp.Dv_ui.ViewModel",
        "type": "module",
        "version": "1.0"
    },
    {
        "classname": "QtQuickLayoutsPlugin",
        "name": "QtQuick.Layouts",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Layouts",
        "plugin": "qquicklayoutsplugin",
        "type": "module",
        "version": "1.0"
    },
    {
        "name": "..",
        "path": "../subDir/dv_qmlLib/dv_qmlLib/Themes",
        "type": "directory"
    },
    {
        "name": "../Js",
        "path": "../subDir/dv_qmlLib/dv_qmlLib/Themes/Js",
        "type": "directory"
    },
    {
        "classname": "QmlShapesPlugin",
        "name": "QtQuick.Shapes",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Shapes",
        "plugin": "qmlshapesplugin",
        "type": "module",
        "version": "1.12"
    },
    {
        "classname": "QtGraphicalEffectsPlugin",
        "name": "QtGraphicalEffects",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtGraphicalEffects",
        "plugin": "qtgraphicaleffectsplugin",
        "type": "module",
        "version": "1.0"
    },
    {
        "classname": "QtGraphicalEffectsPrivatePlugin",
        "name": "QtGraphicalEffects/private",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtGraphicalEffects/private",
        "plugin": "qtgraphicaleffectsprivate",
        "type": "module",
        "version": "1.0"
    },
    {
        "classname": "QtQuick2WindowPlugin",
        "name": "QtQuick.Window",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Window.2",
        "plugin": "windowplugin",
        "type": "module",
        "version": "2.1"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.11"
    },
    {
        "classname": "QtQuickControls2Plugin",
        "name": "QtQuick.Controls",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls.2",
        "plugin": "qtquickcontrols2plugin",
        "type": "module",
        "version": "2.15"
    },
    {
        "classname": "QtQuickLayoutsPlugin",
        "name": "QtQuick.Layouts",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Layouts",
        "plugin": "qquicklayoutsplugin",
        "type": "module",
        "version": "1.15"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.15"
    },
    {
        "classname": "QtQuick2WindowPlugin",
        "name": "QtQuick.Window",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Window.2",
        "plugin": "windowplugin",
        "type": "module",
        "version": "2.15"
    },
    {
        "name": "QtQml",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQml",
        "type": "module",
        "version": "2.15"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.2"
    },
    {
        "name": "QtQuick.Controls.Private",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls/Private",
        "type": "module",
        "version": "1.0"
    },
    {
        "name": ".",
        "path": "../TreeViewStyle.qml",
        "type": "directory"
    },
    {
        "name": ".",
        "path": "../QtQuick/Controls/Styles/Desktop/TreeViewStyle.qml",
        "type": "directory"
    },
    {
        "classname": "QtQuickControls1Plugin",
        "name": "QtQuick.Controls",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls",
        "plugin": "qtquickcontrolsplugin",
        "type": "module",
        "version": "1.2"
    },
    {
        "name": ".",
        "path": "../QtQuick/Controls/Styles/Desktop/ComboBoxStyle.qml",
        "type": "directory"
    },
    {
        "name": ".",
        "path": "../QtQuick/Controls/Styles/Desktop/MenuBarStyle.qml",
        "type": "directory"
    },
    {
        "name": ".",
        "path": "../QtQuick/Controls/Styles/Desktop/TableViewStyle.qml",
        "type": "directory"
    },
    {
        "classname": "QtLabsPlatformPlugin",
        "name": "Qt.labs.platform",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/Qt/labs/platform",
        "plugin": "qtlabsplatformplugin",
        "type": "module",
        "version": "1.1"
    },
    {
        "name": ".",
        "path": "../ComboBoxStyle.qml",
        "type": "directory"
    },
    {
        "name": ".",
        "path": "../MenuBarStyle.qml",
        "type": "directory"
    },
    {
        "name": ".",
        "path": "../TableViewStyle.qml",
        "type": "directory"
    },
    {
        "classname": "QtQuickExtrasPlugin",
        "name": "QtQuick.Extras",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Extras",
        "plugin": "qtquickextrasplugin",
        "type": "module",
        "version": "1.4"
    },
    {
        "name": "QtQuick.Extras.Private",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Extras/Private",
        "type": "module",
        "version": "1.0"
    },
    {
        "classname": "QtQuickLayoutsPlugin",
        "name": "QtQuick.Layouts",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Layouts",
        "plugin": "qquicklayoutsplugin",
        "type": "module",
        "version": "1.1"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.5"
    },
    {
        "name": "QtQuick.Extras.Private.CppUtils",
        "type": "module",
        "version": "1.1"
    },
    {
        "name": "QtQuick.Extras.Private.CppUtils",
        "type": "module",
        "version": "1.0"
    },
    {
        "name": "QtQuick.Controls.Styles",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls/Styles",
        "type": "module",
        "version": "1.1"
    },
    {
        "name": ".",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls/Styles/Desktop/TreeViewStyle.qml",
        "type": "directory"
    },
    {
        "name": "QtQuick.Controls.Styles",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls/Styles",
        "type": "module",
        "version": "1.3"
    },
    {
        "name": ".",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls/Styles/Desktop/ComboBoxStyle.qml",
        "type": "directory"
    },
    {
        "name": ".",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls/Styles/Desktop/MenuBarStyle.qml",
        "type": "directory"
    },
    {
        "name": ".",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls/Styles/Desktop/TableViewStyle.qml",
        "type": "directory"
    },
    {
        "classname": "QtGraphicalEffectsPrivatePlugin",
        "name": "QtGraphicalEffects.private",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtGraphicalEffects/private",
        "plugin": "qtgraphicaleffectsprivate",
        "type": "module",
        "version": "1.12"
    },
    {
        "classname": "QtGraphicalEffectsPlugin",
        "name": "QtGraphicalEffects",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtGraphicalEffects",
        "plugin": "qtgraphicaleffectsplugin",
        "type": "module",
        "version": "1.12"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.1"
    },
    {
        "name": "HelperWidgets",
        "type": "module",
        "version": "2.0"
    },
    {
        "classname": "QtQuickControls1Plugin",
        "name": "QtQuick.Controls",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls",
        "plugin": "qtquickcontrolsplugin",
        "type": "module",
        "version": "1.1"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.3"
    },
    {
        "name": "QtQuick.Extras.Private",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Extras/Private",
        "type": "module",
        "version": "1.1"
    },
    {
        "name": "QtQuick.Controls.impl",
        "type": "module",
        "version": "2.12"
    },
    {
        "classname": "QtQuickTemplates2Plugin",
        "name": "QtQuick.Templates",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Templates.2",
        "plugin": "qtquicktemplates2plugin",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "QtQuick.Controls.Fusion",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "QtQuick.Controls.Fusion.impl",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "QtQuick.Controls.Universal",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "QtQuick.Controls.Universal.impl",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "QtQuick.Controls.Material",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "QtQuick.Controls.Material.impl",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "QtQuick.Controls.Imagine",
        "type": "module",
        "version": "2.12"
    },
    {
        "name": "QtQuick.Controls.Imagine.impl",
        "type": "module",
        "version": "2.12"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.4"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.6"
    },
    {
        "classname": "QtQuickControls1Plugin",
        "name": "QtQuick.Controls",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls",
        "plugin": "qtquickcontrolsplugin",
        "type": "module",
        "version": "1.5"
    },
    {
        "name": "QtQuick.Controls.Styles",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls/Styles",
        "type": "module",
        "version": "1.2"
    },
    {
        "classname": "QtQuickControls1Plugin",
        "name": "QtQuick.Controls",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick/Controls",
        "plugin": "qtquickcontrolsplugin",
        "type": "module",
        "version": "1.3"
    },
    {
        "classname": "QtQuick2Plugin",
        "name": "QtQuick",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQuick.2",
        "plugin": "qtquick2plugin",
        "type": "module",
        "version": "2.9"
    },
    {
        "classname": "QtQmlModelsPlugin",
        "name": "QtQml.Models",
        "path": "/home/deepvision/Qt5.12.6/5.12.6/gcc_64/qml/QtQml/Models.2",
        "plugin": "modelsplugin",
        "type": "module",
        "version": "2.2"
    }
]

有我的项目的qml文件、qt安装目录的qml文件和qt安装目录的插件。
我如何复制这些依赖项到我的应用程序workDir,我的动态库使用LD_LIBRARY env变量located.所以我只需要qml依赖项。
我试着用linuxdeployqt,但是我们公司的项目把很多库放在一个目录(git repo),不是每个动态库都在我的分支中使用,所以我在使用linuxdeplyqt时得到了很多错误,比如xxx not found
我只需要复制qml依赖到我的应用程序的工作目录
我的文件树:

../
dv-detector/
| .git/
| .vscode/
| docs/
| dv_algorithm/     =>a loat of librays
| dv_base/          =>a loat of librays
| dv_business/      =>a loat of librays
| dv_ui/
| | bin/            => application work here ,also deploy target dir
| | configuration/
| | data/
| | defectpic/
| | depends/
| | dv_ui/
| | extension/
| | features/
| | image/
| | image_nologo/
| | p2/
| | plugins/
| | qtpropertybrowser/
| | readme/
| | src/
| | subDir/
| | | dv_core/
| | | dv_qmlLib/                =>  qml libray project as .pri
| | | | dv_qmlLib/
| | | | | Buttons/
| | | | | Charts/
| | | | | DbgTools/
| | | | | ItemsControls/
| | | | | Js/
| | | | | Shapes/
| | | | | Svg/
| | | | | Themes/
| | | | | Window/
| | | | | qmldir                => qmldir
| | | | window/
| | | | dv_qmlLib_global.h
| | | | dv_qmllib.h
| | | | eventHub.h
| | | | qmlUtility.h
| | | | qmlbootstraper.h
| | | | dv_qmllib.cpp
| | | | eventHub.cpp
| | | | qmlUtility.cpp
| | | | qmlbootstraper.cpp
| | | | dv_qmlLib.pri
| | | | dv_qmlLib.qrc
| | | test/
| | dv_ui.h
| | dv_ui.cpp
| | .git*
...
...
...
unguejic

unguejic1#

最后,我使用windeployqt部署它,并在linux中,复制插件和qml模块那些有相同的名称到我的应用程序的工作目录。并编辑run.sh添加行导出QML2_IMPORT_PATHQT_PLUGIN_PATH指向他们。它可以运行起来。仍然注意到一些库是miss,经过一点点复制的东西,我它工作得很好

相关问题