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. Fullscreen app on android
Forum Updated to NodeBB v4.3 + New Features

Fullscreen app on android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 3 Posters 4.3k 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.
  • S Offline
    S Offline
    scotryder
    wrote on last edited by
    #1

    Hi there,

    How set a QT app as fullscreen on android?

    Thanks

    G 1 Reply Last reply
    0
    • S scotryder

      Hi there,

      How set a QT app as fullscreen on android?

      Thanks

      G Offline
      G Offline
      Gourmet
      wrote on last edited by
      #2

      @scotryder get working space geometry as

      screengeo = QApplication::desktop()->availableGeometry();
      

      then calculate zoom factor to fill geometry by vertical or horizontal and then scale to this factor.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        scotryder
        wrote on last edited by
        #3

        Thank you for your reply
        Im using a QML based app (should have mentioned earlier) and was expecting something simple :(

        1 Reply Last reply
        0
        • timdayT Offline
          timdayT Offline
          timday
          wrote on last edited by
          #4

          I have a QML&C++ application on Android and I'm pretty sure the only thing I do to fullscreen it (hiding the status bar) is invoke showFullScreen() on the QQuickView my main.cpp creates. At least that's been true from Qt5.7... think there might have been some problems/a different way of doing it back around Qt5.3.

          If your app is just QML see https://forum.qt.io/topic/77517/android-fullscreen-app

          It's more complicated on iOS where you have to set some plist property.

          1 Reply Last reply
          1
          • S Offline
            S Offline
            scotryder
            wrote on last edited by
            #5

            @timday said in Fullscreen app on android:

            https://forum.qt.io/topic/77517/android-fullscreen-app

            Thats a reply i was expecting, Here is my main.cpp but i dont see QQuickView in it, please advise

            int main(int argc, char *argv[])
            {
                QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
            
                QGuiApplication app(argc, argv);
                QtWebView::initialize();
            
            
            
                QQmlApplicationEngine engine;
                engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
                if (engine.rootObjects().isEmpty())
                    return -1;
            
            
            
                return app.exec();
            }
            
            1 Reply Last reply
            0
            • timdayT Offline
              timdayT Offline
              timday
              wrote on last edited by
              #6

              Hmmm interesting... there's probably lots of ways of doing it but my own minimal canonical QML-based app looks like:

              int main(int argc,char* argv[]) {
              
                QGuiApplication app(argc,argv);  
              
                QQuickView viewer;
                viewer.setResizeMode(QQuickView::SizeRootObjectToView);
                viewer.setSource(QUrl("qrc:///main.qml"));
                viewer.showFullScreen();
              
                return app.exec();
              }
              

              If you need to get hold of the QML engine, it lives at viewer.engine(). I'm a bit surprised your way of doing things works at all actually... my assumption would have been you always have to call one of the show methods on some graphical class to have an app display anything at all!

              1 Reply Last reply
              1
              • S Offline
                S Offline
                scotryder
                wrote on last edited by
                #7

                Interestingly this is autogenerated code when i create a new QT Quick App. However i just tried your visiblity fix from other post you mentioned, and gonna give it a try and if it works ill set this as answer.
                Thank you very much :)

                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