A generic function that is meant to export a Qt object to an
external file. Currently, only export to some image formats is
supported. This is used, in particular, to allow exporting the
contents of a qsceneDevice via a context menu item
for a corresponding view.