Results 1 to 4 of 4

Thread: Implementing Spotify's volume slider with QSlider.

  1. #1
    Join Date
    May 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Implementing Spotify's volume slider with QSlider.

    Hi everyone, this is my first post!

    So, I'm trying to create a volume slider similar to the one found in the desktop version of Spotify on Windows. I'm posting images showing the behaviors I'm interested in if you are not familiar with Spotify. As you see when you hover the sub-page is turning green and the handle appears. So my issues are 2.

    1) Can't turn green the sub-page on QSlider::sub-page:hover.
    2) Can't show the handle only on QSlider::groove:hover.

    I don't know if it is doable with setStyleSheet(), but I prefer it over having to subclass QSlider. I'm happy to post the relevant code if you want, though I believe that I can't set background on sub-page.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Implementing Spotify's volume slider with QSlider.

    Stylesheets are deprecated. It's very easy to do what you want by drawing a custom slider.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Implementing Spotify's volume slider with QSlider.

    Stylesheets are deprecated.
    @wysota: Welcome back. Can you please provide a link? I'm not finding anything in the online documentation of obsolete / deprecated classes that references style sheets.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Implementing Spotify's volume slider with QSlider.

    Thanks. It's deprecated not in terms that they are going to vanish any time soon. I can't give you a docs link, I think my info is based on some other source (blog, DevDays presentation? Can't remember right now). One way or another this technology is not developed anymore and there are many pieces missing there so it's hardly usable for anything more advanced than making a red push-button.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    d_stranz (4th June 2017)

Similar Threads

  1. Volume Slider changes nothing in terms of volume
    By zgulser in forum Qt Programming
    Replies: 1
    Last Post: 28th September 2012, 16:55
  2. system volume in qslider controller
    By breakthecode in forum Newbie
    Replies: 1
    Last Post: 13th December 2011, 07:07
  3. how controll system volume in qslider
    By breakthecode in forum Qt Programming
    Replies: 2
    Last Post: 11th December 2011, 21:08
  4. Phonon and Volume Slider (Nokia N8)
    By abashir in forum Newbie
    Replies: 0
    Last Post: 6th January 2011, 23:46
  5. Replies: 2
    Last Post: 21st March 2010, 10:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.