[英]How can I get the system configuration with c++ in QT
我想要系统配置,如 cpu 或显卡型号。
QSysInfo was meant for this purpose. QSysInfo就是为此目的而设计的。
For example, you can get the CPU architecture using currentCpuArchitecture .例如,您可以使用currentCpuArchitecture获取 CPU 架构。
Qt uses OpenGL for the rendering, so there is no need for specific API in there as you can use the standard OpenGL API for that: Qt 使用 OpenGL 进行渲染,因此不需要特定的 API,因为您可以使用标准的 OpenGL API:
glGetString(GL_VENDOR);
glGetString(GL_RENDERER);
For network information, you can use QNetworkInformation .对于网络信息,您可以使用QNetworkInformation 。
For store information, you can use QStorageInfo .对于商店信息,您可以使用QStorageInfo 。
For serial port information (I actually developed this one), you can use QSerialPortInfo .对于串口信息(我实际上开发了这个),您可以使用QSerialPortInfo 。
For printer information, you can use QPrinterInfo .对于打印机信息,您可以使用QPrinterInfo 。
For bluetooth information, you can use QBluetoothDeviceInfo .对于蓝牙信息,您可以使用QBluetoothDeviceInfo 。
For can bus device information, you can use QCanBusDeviceInfo .对于 CAN 总线设备信息,您可以使用QCanBusDeviceInfo 。
A good hint is to search for "info" classes in all Qt classes .一个很好的提示是在所有 Qt 类中搜索“信息”类。
Qt has consistently named the classes so during its development. Qt 在其开发过程中一直如此命名这些类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.