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. How to How the Compilation Arch inside Qt

How to How the Compilation Arch inside Qt

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 2.0k Views 1 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
    dcbasso
    wrote on last edited by
    #1

    I trying to create a generic "About dialog", and I want to show on the label a information about the arch of app compilation (like 32bits, 64bits, x86 or x86_64...)...
    It's possible to make something like this on Qt?
    Thanks all.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dcbasso
      wrote on last edited by
      #2

      Anyone?!

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on last edited by
        #3

        QSysInfo::WordSize has the word size of the platform.

        1 Reply Last reply
        0
        • W Offline
          W Offline
          Wilk
          wrote on last edited by
          #4

          Hello.
          I guess there is one way to achieve what you want. But it may be to difficult. Add new compilation step:

          Get output of GCC

          Parse it

          Put results into some header file

          Include this file into you project

          ???

          PROFIT

          But I realy don't know how to make it, but I didn't ever try.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dcbasso
            wrote on last edited by
            #5

            Thanks all.

            QSysInfo::WordSize!

            1 Reply Last reply
            0
            • I Offline
              I Offline
              imoir
              wrote on last edited by
              #6

              To be precise Tobias, QSysInfo::WordSize() gives you the compiled size. Here is some code I use in Windows to find if a 32 bit app is running in an enviroment that supports 64 bit apps:

              @
              int osPointerSize = QSysInfo::WordSize;
              if ( osPointerSize == 32 ) {
              BOOL bIsWow64 = FALSE;
              typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
              LPFN_ISWOW64PROCESS fnIsWow64Process =
              (LPFN_ISWOW64PROCESS) GetProcAddress(GetModuleHandle
              (TEXT"kernel32")), "IsWow64Process");
              if ( fnIsWow64Process != NULL ) {
              if ( !fnIsWow64Process(GetCurrentProcess(), &bIsWow64) ) {
              QMessageBox::warning(this, tr("System error"),
              tr("Failed find WOW process"));
              } else if ( bIsWow64 ) {
              osPointerSize = 64;
              }
              }
              }
              @

              1 Reply Last reply
              0

              • Login

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