Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Get current CPU architecture in Qt 4.7, and hide mouse cursor on ARM
Forum Updated to NodeBB v4.3 + New Features

Get current CPU architecture in Qt 4.7, and hide mouse cursor on ARM

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 1.6k 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.
  • M Offline
    M Offline
    mostefa
    wrote on last edited by A Former User
    #1

    Hello,

    For my project i need two builds (one for x86 architecutre , one for ARM architecure) , i am using qt 4.7

    and i need to hide cursor mouse on ARM architecture:

    I added this part of code to my program:

    QWSServer *server = QWSServer::instance();
        if(server) {
            server->setCursorVisible(false);
        }
    

    This seems to work normally without any problem on ARM, but in x86 the program won't build cause QWSServer is not built with my qt4 Desktop,

    Is there anyway to getCpu Information in sourceFile?

    I saw that this can be achieved in Qt 5 with this getter:

    QSysInfo::currentCpuArchitecture()
    

    but i don't know if there is an equivalent in qt4

    if this will be possible i want to do this:

    if(QSysInfo::currentCpuArchitecture() == "arm")
      #define armBuild
    #ifdef armBuild
            QWSServer *server = QWSServer::instance();
        if(server) {
            server->setCursorVisible(false);
        }
    #endif
    

    Or is there any other way to to hide cursor mouse only for ARM build?

    Thank you for your help !

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mostefa
      wrote on last edited by
      #2

      Solved:

      with

      #ifdef __arm__
      

      i wrote this code :

      #ifdef __arm__
          QWSServer *server = QWSServer::instance();
          if(server) {
              server->setCursorVisible(false);
          }
      #endif
      

      Sorry for my question !

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        You should rather use #ifdef Q_WS_QWS. This way you're not dependent on the architecture of the processor either.

        The fact that you are currently building for ARM is an implementation detail. You could be building your application for MIPS in a few months or even x86 and your current check would have to be modified. With Q_WS_QWS you're testing that you are building against an embedded build of Qt4 whatever the underlying platform is.

        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
        1
        • M Offline
          M Offline
          mostefa
          wrote on last edited by
          #4

          @SGaist thank you for explanation but when i use #ifdef Q_WS_QWS_ , like this :

          #ifdef Q_WS_QWS_
          QWSServer *server = QWSServer::instance();
          if(server) {
          server->setCursorVisible(false);
          }
          #endif

          the mouse cursor still appear in ARM

          Is there something i am mading wrong?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mostefa
            wrote on last edited by mostefa
            #5

            Oh it was just a writing mistake

            #ifdef Q_WS_QWS_ instead of #ifdef Q_WS_QWS , now it work

            @SGaist Thank you again

            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