def data_url(mimetype, data):
 b64 = base64.b64encode(data).decode('ascii')
 url = QUrl('data:{};base64,{}'.format(mimetype, b64))
 qtutils.ensure_valid(url)
 return url

def data_url ( mimetype , data ) : b64 = base64 . b64encode ( data ) . decode ( 'ascii' ) url = QUrl ( 'data:{};base64,{}' . format ( mimetype , b64 ) ) qtutils . ensure_valid ( url ) return url
get a data: qurl for the given data .