PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 12, 2022

[FIXED] How can get I a hardware ID in Qt

 September 12, 2022     c++, cross-platform, qt     No comments   

Issue

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.


Solution

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).



Answered By - Floris Velleman
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing