Previous Page Parent Page Next Page TOC

File Dialogs

The file dialog must mimic the OS specific behavior. To achieve this we rely on the Qt provided static methods for opening and saving file dialogs. Related dialogs for opening and saving files must provide the same filters and have the same default filter with the exception that the save file dialog may omit the filter Any (*) .

Open File Dialogs

The open file dialog should provide filters to restrict the files displayed. The default filter should select files, which are the most likely ones desired by the user. A filter which must be provided in all open file dialogs is Any (*) to allow the user to select any file without restrictions.

Save File Dialogs

The save file dialog should provide filters to restrict the files displayed. The default filter should select files, which are the most likely the ones desired by the user. The filter provides a 2 functionalities in the save dialog, it filters the displayed files and determines the file format. It is often possible to have several endings for the same format (e.g. jpg and jpeg for the JPEG graphics format) therefore the user must be able to override the suggested file ending or even avoid a file suffix at all. To avoid a suffix the user must end the file name with a '.'. This terminating '.' is stripped from the final file name. To determine whether the user given file has a file suffix the file name must pass the Qt regexp \.\S{1,4} (a '.' followed by 1 to 4 non white space characters). Since it is common for users to end file names with a dot followed by digits to indicate versions of the file we must ignore suffixes comprising only digits. This means the file name must not match the Qt regexp \.\d{1,4}.