diff options
author | Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> | 2024-10-12 20:06:59 +0900 |
---|---|---|
committer | Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> | 2024-10-13 01:13:21 +0900 |
commit | e22a2d57ec08bfff591a0bc3494d359e80830791 (patch) | |
tree | cafa99324783575b6cab17431e6debb4c90108ef /MediaControls | |
parent | b4202d3d5aca7842314edbf010e2e8605a6a9e24 (diff) |
Qt6.7 has more limitation from Qt6.5. That cause runtime warning in momiplayer.
This patch fix this warning issue.
Bug-AGL: SPEC-5162
Change-Id: I9b0de4a619ca774c90fd0c6892ba73b53b58ff58
Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Diffstat (limited to 'MediaControls')
-rw-r--r-- | MediaControls/PlaybackSeekControl.qml | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/MediaControls/PlaybackSeekControl.qml b/MediaControls/PlaybackSeekControl.qml index e41f6cc..85ca4d4 100644 --- a/MediaControls/PlaybackSeekControl.qml +++ b/MediaControls/PlaybackSeekControl.qml @@ -15,13 +15,6 @@ Item { required property MediaPlayer mediaPlayer property alias isMediaSliderPressed: mediaSlider.pressed - function getTime(time : int) { - const h = Math.floor(time / 3600000).toString() - const m = Math.floor(time / 60000).toString() - const s = Math.floor(time / 1000 - m * 60).toString() - return `${h.padStart(2,'0')}:${m.padStart(2,'0')}:${s.padStart(2, '0')}` - } - RowLayout { anchors.fill: root anchors.leftMargin: 200 @@ -31,7 +24,14 @@ Item { id: mediaTime color: Config.secondaryColor font.bold: true - text: root.getTime(root.mediaPlayer.position) + property int mediaTimePosition + mediaTimePosition: root.mediaPlayer.position + onMediaTimePositionChanged : { + const h = Math.floor(mediaTimePosition / 3600000).toString() + const m = Math.floor(mediaTimePosition / 60000).toString() + const s = Math.floor(mediaTimePosition / 1000 - m * 60).toString() + text = `${h.padStart(2,'0')}:${m.padStart(2,'0')}:${s.padStart(2, '0')}` + } } CustomSlider { @@ -51,7 +51,15 @@ Item { id: durationTime color: Config.secondaryColor font.bold: true - text: root.getTime(root.mediaPlayer.duration) + property int durationTimePosition + durationTimePosition: root.mediaPlayer.duration + onDurationTimePositionChanged : { + const h = Math.floor(durationTimePosition / 3600000).toString() + const m = Math.floor(durationTimePosition / 60000).toString() + const s = Math.floor(durationTimePosition / 1000 - m * 60).toString() + text = `${h.padStart(2,'0')}:${m.padStart(2,'0')}:${s.padStart(2, '0')}` + } + } } |