Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QProcess returns "wrong" result due to architecture, mac.

    General and Desktop
    qprocess architecture mac arm
    2
    2
    101
    Loading More Posts
    • 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
      Dariusz last edited by Dariusz

      Hey

      Ok soo this is fun one.. I want to know what is the architecture of current system... You know x86_64 or arm64 (I'm on mac m1)... the fun part is... if I compile my app for Intel only, and run (mac runs it via rosetta) > QSysInfo::currentCpuArchitecture() I will get x86_64, because thats what whatever enumeration does and thats what Qt gets. Which is not what I want. I want to know if this hardware is x86_64 or arm... so I figured I would run a QProcess("uname",{"-m"}); instead and just get it from OS... but oh boi how I was wrong, that returns x86_64 too!!! Soo my magical question is... how can I use QProcess to get the correct architecture? Or qt lib in general ?

      Regards
      Dariusz

      SOLLUTION :
      Found out that we can check if we are running in translated mode via > https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment

      It would be nice if Qt had an option to figure that one natively via QSysInfo at some point.

      1 Reply Last reply Reply Quote 1
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        You can open a feature request to discuss that matter.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post