Rik99
Rik99

Reputation: 79

Cannot open files with QFileDialog (Qt 5.7)

I'm creating an audio player with Qt 5.7 on Windows 10. The program works but when I load an audio file it return these errors

shell\comdlg32\fileopensave.cpp(14274)\comdlg32.dll!75622833: (caller: 7565211C) ReturnHr(1) tid(dec) 80004005 Not specified error.
    CallContext:[\PickerModalLoop] 

shell\osshell\lmui\ntshrui\dll\shrengine.cpp(1473)\ntshrui.dll!665E3BE2: (caller: 665DF284) ReturnHr(1) tid(1a14) 80004005 Not specified error.

This is the function

void AudioPlayer::loadClicked()
{
    QString filename = QFileDialog::getOpenFileName(this, tr("Select an audio file"), "" ,tr("File Mp3 (*.mp3)"));
    int volume = ui->horizontalSliderVolume->value();

    if(!filename.isEmpty())
    {
        player.setMedia(QUrl::fromLocalFile(filename));
        player.setVolume(volume);
    }
}

Why? How can I resolve?

Upvotes: 1

Views: 830

Answers (1)

Adrien Leravat
Adrien Leravat

Reputation: 2789

It is related to this Qt bug ticket. It is actually only warnings produced by Windows, but your application should be fine. The messages themselves apparently cannot be removed.

Upvotes: 2

Related Questions