Important: Please read the Qt Code of Conduct -

Qt for android app not displaying fullscreen

  • Hi

    Im trying to display an app in fullscreen mode on android device, problem is screen doesn't get fullscreen because of the navigation bar, 0_1517497496566_27650432_1979326172080895_274743506_o.png

    The white bar at the bottom is where the navigation buttons usually is, as you see i cant paint over it its constantly white.

    I am using QT 5.9 and trying build something for android API 21, for the window i am using Mainwindow, and the function MainWindow.showFullScreen. How can i solve this?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You should add which version of Qt you are using as well as Android version.

  • If the area is white, it means that the window is indeed fullscreen (as the buttons are not visible), but painted only with white, which must be the background colour you have set, but not with your paintevent code. So which is it? Not fullscreen or not painted?
    (There have been in old Qt versions bugs where the buttons remain visible in fullscreen mode, and also workarounds. If you use a very old Qt, check this: [](link url) )

  • The area is then not painted, i have tried to fill the hole screen with another color but it still leaves the bottom line white as you see in picture below. 0_1517558062648_27711535_1980180741995438_1077967120_o.png

    The way i paint is by filling a rectangle with the size of Mainwindow.Width and MainWindow.Height. The "real" background i have set is supposed to be black which then can't cause the problem.

  • Moderators

    some some code please. Especially where you set the size of your main screen.
    Also does it mean you use QML? Or QtWidgets?

  • Picture one is how i get the size of the screen to use on my app
    The first photo is of my main.c, while the other photo is where i paint it in mainwindow.cpp


  • Moderators

    so all you do is calling showFullScreen() right?
    Try the following (remove all the fullscreen code):

    const QScreen* screen = qApp->primaryScreen();
    w.setGeometry( QRect(QPoint(0,0), screen->geometry ().size() );

  • Moderators

    additionaly to what @raven-worx said, you can try setting this windowflag


    this should paint the window over everything.