Unsolved Qml progress bar with elapsed and remaning time
-
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.
-
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 }
-
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.
-
@Apeksha
qsTr("%1 / %2 Seconds") creates a translatable string, arg(x) replaces the %1 with x and the 2nd arg replaces the %2results in a Dislpay-String along the line of
45 / 60 Seconds
-
@J.Hilk
Thank you , i got it