Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qml progress bar with elapsed and remaning time
Forum Updated to NodeBB v4.3 + New Features

Qml progress bar with elapsed and remaning time

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 2 Posters 1.7k 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.
  • A Offline
    A Offline
    Apeksha
    wrote on last edited by
    #1

    Hi,
    Can anyone help to show elapsed and remaining time for progress bar in qml which shows like when we play video in our system.

    Thanks in advance.

    J.HilkJ 1 Reply Last reply
    0
    • A Apeksha

      Hi,
      Can anyone help to show elapsed and remaining time for progress bar in qml which shows like when we play video in our system.

      Thanks in advance.

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

      hi @Apeksha ,
      that should be very very easy in qml, what have you tried?

       ProgressBar {
              property int totalTime: 100 //in miliseconds
              Text{
              anchors.fill: parent
              text: qsTr("%1 / %2 Seconds").arg(totalTime*value).arg(totalTime-totalTime*value)
              verticalAlignment: Qt.AlignVCenter
              horizontalAlignment: Qt.AlignHCenter
          }
      

      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.

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

        hi @Apeksha ,
        that should be very very easy in qml, what have you tried?

         ProgressBar {
                property int totalTime: 100 //in miliseconds
                Text{
                anchors.fill: parent
                text: qsTr("%1 / %2 Seconds").arg(totalTime*value).arg(totalTime-totalTime*value)
                verticalAlignment: Qt.AlignVCenter
                horizontalAlignment: Qt.AlignHCenter
            }
        
        A Offline
        A Offline
        Apeksha
        wrote on last edited by
        #3

        @J.Hilk

        text: qsTr("%1 / %2 Seconds).arg(totalTimevalue).arg(totalTime-totalTimevalue)

        I didn't get this line, can you clear it please.

        Thank you in advance.

        J.HilkJ 1 Reply Last reply
        0
        • A Apeksha

          @J.Hilk

          text: qsTr("%1 / %2 Seconds).arg(totalTimevalue).arg(totalTime-totalTimevalue)

          I didn't get this line, can you clear it please.

          Thank you in advance.

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

          @Apeksha
          qsTr("%1 / %2 Seconds") creates a translatable string, arg(x) replaces the %1 with x and the 2nd arg replaces the %2

          results in a Dislpay-String along the line of
          45 / 60 Seconds


          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.

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

            @Apeksha
            qsTr("%1 / %2 Seconds") creates a translatable string, arg(x) replaces the %1 with x and the 2nd arg replaces the %2

            results in a Dislpay-String along the line of
            45 / 60 Seconds

            A Offline
            A Offline
            Apeksha
            wrote on last edited by
            #5

            @J.Hilk
            Thank you , i got it

            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