6

I can't get the CPU ID or motherboard serial number in all operating system (cross platform Qt)

On Windows I'm using WMI and on Mac another. I want use a cross-platform library.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Amir Movahedi
  • 1,802
  • 3
  • 29
  • 52

3 Answers3

3

Although Qt detects at runtime the CPU feature set (cf. src/corelib/tools/qsimd.cpp), it does not export any function to access that (nor any other CPUID information). Write your small piece of assembly code to gather that information. - source

You will have to write some platform dependent code to retrieve this information.

For the CPU id you should probably look into the function __cpuid() for Windows and this answer can help you out on getting it for Linux.

Doing this you might want to consider reading up on motherboard serial numbers as not all of them provide this information at the same place (most do not provide it at all).

Community
  • 1
  • 1
Floris Velleman
  • 4,848
  • 4
  • 29
  • 46
0

You can execute this command : "wmic cpu get ProcessorId"

0

Qt 5.11 introduced this function: QSysInfo::machineUniqueId

Alexander Dyagilev
  • 1,139
  • 1
  • 15
  • 43