Qt - 获取系统信息

发布于 2024-10-02 08:44:18 字数 89 浏览 0 评论 0原文

我正在寻找一种(便携式)方法来获取系统信息,即CPU时钟和制造商、可用内存等。

有没有办法用Qt来做到这一点,或者我是否必须编写操作系统特定的代码?

I'm looking for a (portable) way to get system information, i.e cpu clock and manufacturer, available memory, etc.

Is there a way to do this with Qt or do I have to write OS specific code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

折戟 2024-10-09 08:44:18

我认为 Qt 中没有内置任何东西来获取这些细节。在 Linux 上,所有这些都可以通过 /proc/cpuinfo 获得。如果您的目标是其他平台,您可能只想直接使用 cpuid 指令(假设x86/x86-64)。

I don't think that there is anything built into Qt to get these kind of details. On linux, all of this is available through /proc/cpuinfo. If you are targeting other platforms, you may want to just go directly to using the cpuid instruction (assuming x86/x86-64).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文