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. Qt5.1.1 QML ProgressBar not updated once an audio file played to end by Audio (QtMultimedia 5.0)
Qt 6.11 is out! See what's new in the release blog

Qt5.1.1 QML ProgressBar not updated once an audio file played to end by Audio (QtMultimedia 5.0)

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.5k Views 1 Watching
  • 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.
  • W Offline
    W Offline
    watersoul
    wrote on last edited by
    #1

    Always if the status EndOfMedia is reached and a new file is loaded, the audio player can not update the ProgressBar anymore, although the actual played samples (playMusic.position) still can be displayed correctly in a text field. The audio player application must be closed and restarted to make it work again.
    What can be the problem?

    @
    import QtQuick 2.1
    import QtQuick.Controls 1.0
    import QtQuick.Controls.Styles 1.0
    import QtMultimedia 5.0
    import QtQuick.Dialogs 1.0

    FileDialog { id: fileDialog
    title: "Please choose a file"
    nameFilters: [ "Audio files (*.mp3 .wav)", "All files ()" ]

        onAccepted: {
            playMusic.source = fileDialog.fileUrl
        }
        onRejected: {
        }
    }
    

    Audio {id: playMusic
    }
    ProgressBar { id: progress
    minimumValue: 0.0
    maximumValue: playMusic.duration
    value: playMusic.position
    }
    @

    1 Reply Last reply
    0

    • Login

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