Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Slider position update
Forum Updated to NodeBB v4.3 + New Features

Slider position update

Scheduled Pinned Locked Moved Solved General and Desktop
qsliderqmediaplayer
5 Posts 2 Posters 2.8k 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.
  • UnitScanU Offline
    UnitScanU Offline
    UnitScan
    wrote on last edited by
    #1

    Hi. I'm gonna to create a mp3 player with Qt library, I already familiar with object-oriented language and the Qt library, but I have a question: in my player I created a slider to see the progress of the songs. Is there a way to update the slider while playing the audio file?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      welcome to the forum. You can use the sliders setValue function to update the slider position and use positionChanged Signal ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      UnitScanU 1 Reply Last reply
      3
      • dheerendraD dheerendra

        welcome to the forum. You can use the sliders setValue function to update the slider position and use positionChanged Signal ?

        UnitScanU Offline
        UnitScanU Offline
        UnitScan
        wrote on last edited by
        #3

        @dheerendra Very well. Last question: is there a way to fast forward or rewind a song by clicking on the slider? Beacause now, when I click on the slider the thumbtrack takes only small steps, he does not position where I click.

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          Can you try using the setPosition in MediaPlayer with Slider sliderReleased signal and value() methods ?

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          2
          • UnitScanU Offline
            UnitScanU Offline
            UnitScan
            wrote on last edited by UnitScan
            #5

            [SOLVED]

            To make thumb slider jump directly at mouse click, use this subclass:

            header file: https://nopaste.me/view/c38f6570
            source file: https://nopaste.me/view/ee7b9450

            EDIT: line 4 in .cpp file is useless, you can delete this

            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