如何在QML中打包自定义控件? [英] How to package custom controls in QML?

查看:473
本文介绍了如何在QML中打包自定义控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个QML自定义控件库,该库将提供给我的客户.同时,我不希望我的客户通过查看QML源代码来对控件进行逆向工程".

I would like to create a library of QML custom controls that I would provide to my customers. At the same time I don't want my customers to "reverse-engineer" my controls by peeking into the QML source code.

为避免这种情况,我最好的选择是什么?理想的情况是,我将控件作为已编译的库提供,它们可以在自己的项目中导入.

What are my best options to avoid this? The ideal scenario would that I provide my controls as a compiled library that they could import in their own projects.

我的目标平台是iOS和Android.

My target platforms are iOS and Android.

推荐答案

如何为自定义QML控件创建程序包?这些控制 不应以源代码形式打包,以防止进行逆向工程.

How can I create the package for custom QML controls? These controls should not be packaged in the source code form to prevent reverse-engineering.

这个问题意味着作者具有使用QML技术本身(不是C ++)实现的QML自定义控件.否则,它已经是 QML C ++插件,并在形式的编译库或其他形式的本机代码(我们可以只注册QML类型并从可执行文件中提供必要的导入).

The question implies that the author has QML custom controls implemented with QML technique itself (not C++). Otherwise that would be already QML C++ PlugIn and provided in the form compiled library or some other form of native code (we can just register QML type and provide the necessary import from within executable).

实施 QML插件(仅包含QML源代码)代码),我们应该创建特殊类型的项目.方便地将其组织为嵌套的 subdir项目,以使其与应用程序的其余部分一起工作.请注意,一个插件项目可能包含许多新的QML类型.

To implement QML PlugIn (with just QML source code) we should create special type of project. It is convenient to organize as nested subdir project to make it work altogether with the rest of the application. Mind that one plug-in project may contain many new QML types.

要使QML代码不可见,我们现在可以使用 Qt Quick编译器对其进行编译.某些Qt许可证.

And to make QML code not visible we can now compile it with Qt Quick compiler available under certain Qt licenses.

这篇关于如何在QML中打包自定义控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆