how to add a suffix to a file after saving it on filedialog in qml
Unsolved
General and Desktop
-
i have a file dialog which will open up to a perticular location and when the user gives the name i have to add some text to the name of the file and save it how can i do this in filedialog qml object.
FileDialog{ id: fileOpenDialog objectName: "save_file" title: "Save the File" folder: defaultpath // comes from the c++ side fileMode: FileDialog.SaveFile currentFile: "Export_Script_"+time_stamp nameFilters: [ "Text files (*.txt)" ] onAccepted: { fileOpenDialog.close() var filePath = fileOpenDialog.file // how to add a suffix to the filename? } onRejected: { fileOpenDialog.close() } Component.onCompleted: visible = false }
-
Hello, I want to know how to add a suffix to a file after saving it on filedialog in qml and I came here in hope to find my answer. But It makes me sad when I can't find it. I tried filePath = filePath + '.txt' but isn't working for me. Can anyone share a website with me in which I can find the solution? I will be very much thankful to you.