Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MAC ID of PC in Qt

MAC ID of PC in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 766 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dushy1109
    wrote on last edited by
    #1

    Hi

    I am a beginner to Qt programming. I have a task to get the MAC Address of the PC through Qt.
    Can anybody help to get the workable sample code for the same

    Thanks in advance

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi and welcome to the forums
      Actually there can be more than one mac address. each network interface have one.
      For a laptop , there is often both WIFI and ethernet ( cable) so keep this in mind.

      you can use QNetworkConfiguration
      http://doc.qt.io/qt-5/qnetworkconfigurationmanager.html

      see here for example
      https://stackoverflow.com/questions/7609953/obtaining-mac-address-on-windows-in-qt

      last example handles the fact, there can be more than one.

      In most cases you only want
      BearerWLAN and BearerEthernet.

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved