There is no way to specify multiple filters to a file open dialog. This corresponds to the QFileDialog::setNameFilters function. Either add a option such as --file-filter that can be specified multiple times (this is how zenity does it) or allow specifying arbitrary number of arguments to the command. In either case, it would be nice if the output of kdialog --version actually output something useful instead of 1.0. That way it would be possible to detect if kdialog supports this feature easily.
If the filters correspond with MIME types, you work around this and set multiple: kdialog --getopenfilename ~/ 'text/plain image/png'
This also works, but requires the user to select the filter: kdialog --getopenfilename ~/ 'Text Files (*.txt)\nPNG Images (*.png)' You maybe have to prepend a filter that includes all files to be useful.
The mimetypes wont works for what I need. But the \n will, so thanks for that. You might want to document it somewhere.