A
A
Anton Misyagin2020-05-24 15:20:53
Android
Anton Misyagin, 2020-05-24 15:20:53

How to stretch an application to full screen on Android?

I am writing an application on QT 5.9 in kiosk mode. It should work expanded to the entire display. Expand to full screen:

QGuiApplication app(argc, argv);
    QQmlApplicationEngine engine;
    const QUrl url(QStringLiteral("qrc:/interface/main.qml"));
    QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                     &app, [url](QObject *obj, const QUrl &objUrl) {
        if (!obj && url == objUrl)
            QCoreApplication::exit(-1);
    }, Qt::QueuedConnection);

    engine.load(url);
    #if defined(Q_OS_ANDROID)
        QQuickWindow *window = qobject_cast<QQuickWindow *>(engine.rootObjects().first());
        window->showFullScreen();
    #endif


but one BUT remains. The display resolution of the device is 600 by 1024. The application first launches with the back, home, minimize button bar visible. Next, the kiosk mode turns on and they disappear. The image is stretched to fill the screen, but the round buttons no longer remain round, but become oval. In the logs on startup I see this line:
DisplayManager( 2083): getDisplayInfo: displayId=0, info=DisplayInfo{"Embedded Display", uniqueId "local:0", app 600 x 976, real 600 x 1024, largest app 1024 x 951, smallest app 600 x 527, 69.6 fps, supportedRefreshRates [69.6], rotation 3, density 160 (159.5681 x 160.42105) dpi, layerStack 0, appVsyncOff 0, presDeadline 15367816, type BUILT_IN, state ON, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}


Those. a 600x976 rectangle stretched to 600x1024 how to say this without notifying the application, i.e. it thinks that it is 600x976, while it was stretched to 600x1024, making the roundness conceived by the developer an ovality. Where to dig in this case. I can't find similar threads.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Misyagin, 2020-05-25
@sunnmas

Examination of the screen of the device under a microscope and counting the interface elements in pixels showed the non-squareness of the pixel on the screen.

J
Jacob E, 2020-05-25
@Zifix

First, you need to try to set the full screen mode in the manifest .
Secondly, why are you pulling the guts out of the engine in C ++ when QML has a beautiful property for this case?
Third, tell us exactly how you enable kiosk mode.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question