[ui] add string <--> file representation convertors

* convenient methods to conform strings to Qt file reprensentation using the "file:/" protocol prefix
* use those methodes when manipulating files
This commit is contained in:
Yann Lanthony 2018-02-26 16:59:25 +01:00
parent 62726b4663
commit 2cdc83f06f
7 changed files with 38 additions and 6 deletions

View file

@ -31,6 +31,7 @@ Item {
// Load a 3D media file in the 3D viewer
function load3DMedia(filepath)
{
filepath = Filepath.stringToFile(filepath)
if(Filepath.extension(filepath) === ".abc")
{
viewer3D.abcSource = filepath
@ -154,7 +155,7 @@ Item {
anchors.bottomMargin: 10
anchors.horizontalCenter: parent.horizontalCenter
visible: meshFile != '' && (viewer3D.source != meshFile)
onClicked: viewer3D.source = meshFile
onClicked: load3DMedia(meshFile)
}
}
}