Jump to content

FileDialog QML Type QT6


Cuq
Go to solution Solved by Cuq,

Recommended Posts

Posted (edited) · FileDialog QML Type QT6

I have a small problem but I would like to solve it. In a QML File I use the FileDialog component ... I wanted to be able to define the starting folder using currentFolder : url

 

But unfortunately this does not seem to work. What is the form of the url string ? do I have to do a particular formatting ? 

I tried with : currentFolder: encodeURIComponent but it's the same ? Any Idea ?

 

Current QML File link : https://github.com/5axes/CuraLiveScriptingPlugin/blob/master/qml_qt6/LiveScripting.qml

Edited by Cuq
  • Link to post
    Share on other sites

    • Solution
    Posted · FileDialog QML Type QT6

    I think the issue was the format of the Url.  Seems to be correct now

     

    			currentFolder:pathToUrl(UM.ActiveTool.properties.getValue("ScriptFolder"))
    			
    			function pathToUrl(path)
    			{
    				// Convert the path to a usable url
    				var url = "file:///"
    				url = url + path
    				url = encodeURIComponent(url)
    				
    				// Return the resulting url
    				return url
    			}

     

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.8 beta released
        Another Cura release has arrived and in this 5.8 beta release, the focus is on improving Z seams, as well as completing support for the full Method series of printers by introducing a profile for the UltiMaker Method.
          • Like
        • 1 reply
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
    ×
    ×
    • Create New...