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. Showing a busy indicator or a loading image while loading large QML file

Showing a busy indicator or a loading image while loading large QML file

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 3 Posters 1.4k 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.
  • T Offline
    T Offline
    trupti007
    wrote on last edited by trupti007
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Use BusyIndicator - display it above the Loader you use to load your UI. When Loader's status indicates that loading is finished - hide the BusyIndicator.

      (Z(:^

      T 1 Reply Last reply
      6
      • sierdzioS sierdzio

        Use BusyIndicator - display it above the Loader you use to load your UI. When Loader's status indicates that loading is finished - hide the BusyIndicator.

        T Offline
        T Offline
        trupti007
        wrote on last edited by
        #3
        This post is deleted!
        J.HilkJ 1 Reply Last reply
        0
        • T trupti007

          This post is deleted!

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

          @trupti007 said in Showing a busy indicator or a loading image while loading large QML file:

          @sierdzio i did not used loader in my page though

          Interesting, and how do you make it "where I dynamically load the content"

          more information may lead to "better" answers.

          How ever you do it, @sierdzio suggestion still holds true, just differently.


          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.

          T 1 Reply Last reply
          1
          • J.HilkJ J.Hilk

            @trupti007 said in Showing a busy indicator or a loading image while loading large QML file:

            @sierdzio i did not used loader in my page though

            Interesting, and how do you make it "where I dynamically load the content"

            more information may lead to "better" answers.

            How ever you do it, @sierdzio suggestion still holds true, just differently.

            T Offline
            T Offline
            trupti007
            wrote on last edited by
            #5

            @J-Hilk Dynamically means all the content like images or text i am getting these from server. that is what i am talking about

            J.HilkJ 1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              As long as you have some property or signal in your code which changes value or gets emitted when loading is finished - my solution will still work. Just hide the BusyIndicator when loading is finished.

              (Z(:^

              1 Reply Last reply
              0
              • T trupti007

                @J-Hilk Dynamically means all the content like images or text i am getting these from server. that is what i am talking about

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

                @trupti007 still very ambiguous but here's an example:

                import QtQuick 2.12
                import QtQuick.Controls 2.12
                import QtQuick.Window 2.2
                import QtQuick.Layouts 1.12
                
                Window
                {
                    visible: true
                    width: 640
                    height: 480
                    title: qsTr("Hello World")
                    color: "green"
                    id: win
                
                    Timer
                    {
                        running: true
                        interval: 5000
                        repeat: false
                        onTriggered: img.source = "https://images.pexels.com/photos/1525041/pexels-photo-1525041.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"
                    }
                
                    Item{
                        id: frameImageAndIndicator
                        anchors.fill: parent
                
                        Image {
                            id: img
                            anchors.fill: parent
                            asynchronous: true
                
                            fillMode: Image.PreserveAspectFit
                        }
                
                        BusyIndicator{
                            anchors.fill: parent
                            visible: img.progress != 1 || img.source == ""
                        }
                    }
                }
                
                

                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

                • Login

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