Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

check if object is an url and create url type



  • Hi,

    I have an image.source which have as input even a QUrl from C++, even a String from javascript.

    So I need to convert the later to url type to make it works, then I need 2 things:

    • check if input is url type or string
    • create an url (need something like QUrl.fromLocalFile)

    thanks for help

    Jimmy



  • for now it does work:

    var content = ddb.loadSection(sectionId)
    var path = content.path.toString()
    img.source = path.startsWith("file:///") ? content.path :  "file:///" + path
    

    I hesitate to mark it as solved since I don't know how dirty it is :-)


Log in to reply