PyQT5 QMediaPlaylist documentation snafu

QMediaPlaylist has a method


with the signature

bool QMediaPlaylist::addMedia(const QMediaContent &content)

And the documentation suggests for c++ that


should work.

BUT in PyQT5


errors out with unexpected QUrl.

So….. you have to do


in python. A bit unwieldy but PySide2 appears to have stalled from an outsiders perspective.

Initially I suspect that QUrl and QMediaContent inherited from some sort of common base class and were split off and its perhaps an untested use case of using QUrl was lost. I ended up making a bandaid in python with

MakePath = lambda x: QtM.QMediaContent(QtCore.QUrl.fromLocalFile(x))

where QtM is `from PyQt5 import QtMultimedia as QtM`