Skip to content

Expose QUrl::toLocalFile() to Julia #232

Closed

Description

@rakeshksr

Currently, QUrl::toLocalFile() from Qt is not exposed in the Julia bindings while QUrl::fromLocalFile exposed.

When a user selects a file via a QML based file picker or drag-and-drop interface, the returned object is often a QUrl. To use this file in Julia we need the raw local path.

Current Workaround:

On Qml side

function toLocalFile(url) {
    return decodeURIComponent(url).replace(/^(file:\/{2,3})/, "");
}

julia_path = toLocalFile(qurl)
Julia.operationOnJuliaSide(julia_path)

Activity

  1. barche commented on Feb 13, 2026

    @barche
    Collaborator

    This would be easy to add, but I think it would be more efficient to use the URIs.jl package for this?

  2. rakeshksr commented on Feb 14, 2026

    @rakeshksr
    Author

    I am able to decode the path successfully with URIs.jl; however, I am unable to properly handle the file prefix. On Windows, QML returns a URI in the format file:///path, whereas on other platforms it returns file://path.

    I would prefer not to introduce an additional dependency for functionality that is already supported by this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions