是否可以为特定项目禁用Qt 5.8中的QML缓存? [英] Can QML caching in Qt 5.8 be disabled for a particular project?

查看:262
本文介绍了是否可以为特定项目禁用Qt 5.8中的QML缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Qt 5.8本应在qtquick编译器的前面提供可选用途,但它带有一个Jit-comt编译器,该功能默认情况下处于启用状态,并将已编译的QML文件缓存在磁盘上,以便提高启动性能并减少内存使用。

Qt 5.8 was supposed to come with the optional use ahead of time qtquick compiler, instead it arrived with a sort-of-a-jit-compiler, a feature that's enabled by default and caches compiled QML files on disk in order to improve startup performance and reduce memory usage.

该功能随一起提供严重 错误,这些错误会大大减少,或者就我而言,甚至完全抵消了它的好处,就像我没有这么做的那样。开始时不会有任何问题,并且测试并没有显示任何内存使用方面的改进。

The feature however arrives with serious bugs which greatly diminish, or in my case even completely negate its benefits, as I didn't have a problem with startup times to begin with, and testing didn't reveal any memory usage improvements whatsoever.

所以我要选择退出功能在我的项目中,但我似乎找不到如何做到的。由于我的项目依赖于5.8引入的其他新功能,因此不能选择返回Qt 5.7.1。

So what I would like to do is opt out of that feature in my project, but I don't seem to find how to do that. Going back to Qt 5.7.1 is not an option since my project relies on other new features, introduced with 5.8.

推荐答案

添加 QML_DISABLE_DISK_CACHE (设置为1)到您的环境变量。您应该可以通过 qputenv -在加载QML内容之前将其放在 main 中。

Add QML_DISABLE_DISK_CACHE (set to 1) to your environment variables. You should be able to do it inside your application via qputenv -- put it somewhere in main before loading QML content.

这篇关于是否可以为特定项目禁用Qt 5.8中的QML缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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