[API] FilePickerPage pre-select fille

asked 2020-02-18 19:48:27 +0300

attah gravatar image

For my app SeaPrint, I used the FilePickerPage component to let the user select a file to print. It has the very nice feature of providing the mime type and other file information, which is good for matching printers to file type.

I would also like to allow it to accept a file on the command line, or possibly even over dbus. But this functionality cannot rely on FilePickerPage to provide the mime type, as the properties are read-only, and thus doesn't update even if i was to set the selected file.

Any chance this can be included in a future release? Or is there some better way i should be doing this?

edit retag flag offensive close delete

Comments

1

are you qml-only? can't you just use https://doc.qt.io/qt-5/qmimedatabase.html?

coderus ( 2020-02-18 20:39:00 +0300 )edit

No, so i guess that's an option... it just felt so backwards to re-implement functionality. I'll go that route for now.

attah ( 2020-02-18 20:52:24 +0300 )edit

pickers in sfos are single-purpose, mainly for internal use, not handy apis

coderus ( 2020-02-19 10:24:04 +0300 )edit

That's sad, but you are probably right as always :) I got it working, thanks.

attah ( 2020-02-19 10:54:15 +0300 )edit