Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project: Add Qt5QMLPlugin and optimize CMakeLists. #515

Closed
wants to merge 1 commit into from

Conversation

mentalfl0w
Copy link
Contributor

  1. 使用Qt5QMLPlugin优化整个编译流程
  2. 修复RC文件在编译中可能出现的问题
  3. 修复静态编译可能会出现失败的问题
  4. 删除不再被需要的文件

#514 完成。

@zhuzichu520
Copy link
Owner

好的,非常感谢,我研究一下...

@mentalfl0w
Copy link
Contributor Author

好的,我后期还有想法,是让Qt 5的QML_NAMED_ELEMENT之类的宏定义在cmake下也可以使用,目前已经有点头绪,接下来看看怎么实现。

@mentalfl0w
Copy link
Contributor Author

mentalfl0w commented May 29, 2024

好的,我后期还有想法,是让Qt 5的QML_NAMED_ELEMENT之类的宏定义在cmake下也可以使用,目前已经有点头绪,接下来看看怎么实现。

这个问题我解决了,明天发个PR
**
image
**
image

@mentalfl0w mentalfl0w force-pushed the qt5-qmlplugin branch 2 times, most recently from a67c05d to bda8bde Compare May 30, 2024 01:43
@mentalfl0w
Copy link
Contributor Author

mentalfl0w commented May 30, 2024

完成了,和Qt6一样,用户不需要创建任何文件,直接就可以自动生成并注册一个插件,静态编译时只需要手动运行一下自动生成的注册函数就好了。但是Qt 5.15不支持通过create()来获取instance,需要通过一种很麻烦的方法从QML引擎中获取,我看代码里用到getInstance()的几处地方都没有一定要用到这一个单例的需求,所以还是保持getInstance()没变,相当于部分组件在QML引擎内外各自维护了一个实例,空间也不会被浪费太多,个人觉得还可以接受。

@InternetofThingsprogrammer

所以我啥时候可以用到?

@mentalfl0w
Copy link
Contributor Author

所以我啥时候可以用到?

目前的更改我已经force push到了我的仓库,想体验的话可以先clone我的仓库。如果想在自己的项目中使用的话,可以看看Qt5QMLPlugin仓库,我的FluentUI仓库可以作为使用的例程😉

@zhuzichu520 zhuzichu520 deleted the branch zhuzichu520:1.7.6-dev June 14, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants