Important: Please read the Qt Code of Conduct -

Trying to make a game so how can i hide Status Bar on android

  • Hello,

    I am trying to do a game so i want to hide the status bar, at least i need the status bar height for calculation for my screen resolition.

    Is there anyway to do in Qt c++ code to hide status bar or take status bar height?

    Not; i tried

       setWindowFlags(windowFlags() | Qt::FramelessWindowHint);

    it doesnt worked

    i need hide the status bar.


  • Try add:

         android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

    to AndroidManifest

    But You may also call it through JNI:

    #include <QtAndroidExtras/qandroidfunctions.h>
    #include <QtAndroidExtras/qandroidjnienvironment.h>
    #include <QtCore/qdebug.h>
    void setFullScreen() {
      QAndroidJniObject activity = QtAndroid::androidActivity();
      if (activity.isValid()) {
        QAndroidJniObject window = activity.callObjectMethod("getWindow", "()Landroid/view/Window;");
        if (window.isValid()) {
          const int FLAG_KEEP_SCREEN_ON = 128;
          const int FLAG_FULLSCREEN = 1024;
    //      const int FLAG_FORCE_NOT_FULLSCREEN = 2048;
          window.callMethod<void>("addFlags", "(I)V", FLAG_KEEP_SCREEN_ON | FLAG_FULLSCREEN);
          QAndroidJniEnvironment env;
          if (env->ExceptionCheck())

    Then invoke MainWindow in main.cpp:


    or call showMaximized() in its constructor

    (Bonus ;-) probably You would like to keeps screen on). It requires additional permission: <uses-permission android:name="android.permission.WAKE_LOCK"/>

  • @SeeLook

    showFullScreen() is working bot i didnt edit menifest, i am new on that.

    thanks a lot =)

Log in to reply