Fullscreen app on android
-
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 theQQuickView
mymain.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.
-
@timday said in Fullscreen app on android:
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(); }
-
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 theshow
methods on some graphical class to have an app display anything at all!