VolumeSlider’s tooltip misbehaviour

I was developing a Qt application that makes use of a Phonon::VolumeSlider object. But after clicking the mute button beside of the VolumeSlider and verifying its tooltip, I noticed it was showing the wrong volume. A video can explain this better than me:


If you want to reproduce this problem, you can download its source code as a Qt Creator project. Please keep in mind that it’s the source code with errors!  But there’s a workaround to this problem:

1. In the class where you create the Phonon::AudioOutput whose volume is handled by the VolumeSlider, put this:

[code language=”cpp”]
connect(audioOutput, SIGNAL(mutedChanged(bool)), this, SLOT(handleMute(bool)));
connect(audioOutput, SIGNAL(volumeChanged(qreal)), this, SLOT(handleVolume(qreal)));

2. Create the slots you used above using the following code:

[code language=”cpp”]
void MainWindow::handleMute(bool mute) {
if (!mute) {
void MainWindow::handleVolume(qreal volume) {
outputVolume = volume;

3. Declare the slots and the outputVolume variable in your header file:

[code language=”cpp”]
qreal outputVolume;

private slots:
void handleMute(bool mute);
void handleVolume(qreal volume);

You can download the fixed source code. I don’t know if this behaviour is the expected in Qt, but I filed a bug for it.

Notice: Trying to get property 'comment_ID' of non-object in /home/esdrasbeleza/sites/esdrasbeleza.com/wp-includes/comment-template.php on line 670

Notice: Trying to get property 'user_id' of non-object in /home/esdrasbeleza/sites/esdrasbeleza.com/wp-includes/comment-template.php on line 28

Notice: Trying to get property 'comment_ID' of non-object in /home/esdrasbeleza/sites/esdrasbeleza.com/wp-includes/comment-template.php on line 48
Leave a Reply to Anonymous Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.