Bam Bou
Bam Bou

Reputation: 135

QTMultimedia setMedia member issue

I was trying to rebuild an old project, recreating a new project with all my old files, I get this weird error: "No member named 'setMedia' in 'QMediaPlayer' QMultimedia is well set up. The library has been changed? There are no resources on the web about this

Thanks

enter image description here

Upvotes: 0

Views: 2405

Answers (2)

Dineth Madusara
Dineth Madusara

Reputation: 1

I am using Qt 6.5 LTS and faced the same issue. Replacing setMedia by setSource worked for me.

void setSource(const QUrl &source); is coming from Qt 6 as per the documentation.

Please refer the documentation and check against your Qt version - https://doc.qt.io/qt-6/qmediaplayer.html

Upvotes: 0

vinadenenko
vinadenenko

Reputation: 76

It looks like you are using Qt6. In Qt6 setMedia was changed to setSource. You can find info in docs.

Upvotes: 1

Related Questions