"All Supported" in "Files of type:" combobox of QFileDialog

136 views Asked by At

I made a subclass of QFileDialog and put some file formats in "Files of type" combobox. Expet from these file formats, I want to have an "All Supported" item in this combobox. When some selects "All Supported", they will be able to select only the files of the supported formats.

I have already looked at the cocept of QMimeDatabase but I am quite confused on how and where can make the XML file, containing my custom formats. According to the documentation:

"Applications which want to define custom MIME types need to install an XML file into the locations searched for MIME definitions. These locations can be queried with

QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime/packages"),
                          QStandardPaths::LocateDirectory);

"

When I am calling locateAll, I get an empty QStringList.

So my questions are:

  1. Do I really need the concept of some new entries in QMimeDatabase?

  2. If yes, where is the directory that I have to put my XML file?

0

There are 0 answers