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. Qt for android app not displaying fullscreen
QtWS25 Last Chance

Qt for android app not displaying fullscreen

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
mainwindowfullscreennavigation
8 Posts 5 Posters 5.1k Views
  • 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.
  • A Offline
    A Offline
    amins
    wrote on 1 Feb 2018, 15:44 last edited by amins 2 Feb 2018, 07:39
    #1

    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?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 1 Feb 2018, 18:15 last edited by
      #2

      Hi and welcome to devnet,

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

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

      M 1 Reply Last reply 1 Feb 2018, 21:01
      0
      • S SGaist
        1 Feb 2018, 18:15

        Hi and welcome to devnet,

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

        M Offline
        M Offline
        mvuori
        wrote on 1 Feb 2018, 21:01 last edited by
        #3

        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: [https://bugreports.qt.io/browse/QTBUG-33135](link url) )

        1 Reply Last reply
        0
        • A Offline
          A Offline
          amins
          wrote on 2 Feb 2018, 07:58 last edited by
          #4

          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.

          R 1 Reply Last reply 2 Feb 2018, 08:15
          0
          • A amins
            2 Feb 2018, 07:58

            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.

            R Offline
            R Offline
            raven-worx
            Moderators
            wrote on 2 Feb 2018, 08:15 last edited by
            #5

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

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0
            • A Offline
              A Offline
              amins
              wrote on 2 Feb 2018, 08:25 last edited by
              #6

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

              0_1517559803941_Capture3.PNG

              R 1 Reply Last reply 2 Feb 2018, 08:30
              0
              • A amins
                2 Feb 2018, 08:25

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

                0_1517559803941_Capture3.PNG

                R Offline
                R Offline
                raven-worx
                Moderators
                wrote on 2 Feb 2018, 08:30 last edited by raven-worx 2 Feb 2018, 08:32
                #7

                @amins
                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() );
                

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  J.Hilk
                  Moderators
                  wrote on 2 Feb 2018, 08:35 last edited by
                  #8

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

                  setWindowFlag(Qt::MaximizeUsingFullscreenGeometryHint,true);
                  

                  this should paint the window over everything.


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  1 Reply Last reply
                  0

                  1/8

                  1 Feb 2018, 15:44

                  • Login

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