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. How to have a splash screen in android application built with QML?
QtWS25 Last Chance

How to have a splash screen in android application built with QML?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 1.6k 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.
  • D Offline
    D Offline
    divaindie
    wrote on last edited by divaindie
    #1

    Hi All,
    how i can have a splash screen in Qt for android apps.

    Note:i have tried creating splash screen using "QSplashScreen " ,but i guess it is not a proper way of doing it for android because you can observe a flicker after showing the splash ,also for this i have to add widget (QT += widgets )module into .pro file which i don't want to do,also it requires "QApplication " in main file but iam using "QGuipplication" .

    J.HilkJ 1 Reply Last reply
    0
    • D Offline
      D Offline
      dogbear
      wrote on last edited by
      #2

      Hi.

      You can create a splash screen by creating a new QML file (splashscreen.qml for example) and simply have an image in it that is loaded (for speed sake) from the resource file (compiled into the executable).

      Then in your main.qml, show that splash screen with a timer while you load your other resources asynchronously.

      So long story short, a splash screen is nothing more than a qml Item with an image in it, shown at the start of the app and hidden whenever loading (whatever that is) is finished.

      1 Reply Last reply
      0
      • D divaindie

        Hi All,
        how i can have a splash screen in Qt for android apps.

        Note:i have tried creating splash screen using "QSplashScreen " ,but i guess it is not a proper way of doing it for android because you can observe a flicker after showing the splash ,also for this i have to add widget (QT += widgets )module into .pro file which i don't want to do,also it requires "QApplication " in main file but iam using "QGuipplication" .

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @divaindie
        If you want a custom splash screen for android, usually there's a white screen with the application name by default before the actual app is completely loaded, you'll have to add that in the manifest file.

        The manifest file created by QtCreator for example has the correct method in it already but IIRC it's commented out:

        For example:

                    <!-- Splash screen -->
                    <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/launch_logo"/>
                    <!-- Splash screen -->
        

        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
        1
        • D Offline
          D Offline
          divaindie
          wrote on last edited by divaindie
          #4

          i feel this link is useful !!!

          1 Reply Last reply
          1

          • Login

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