def __kdeGetOpenFileNames(parent = None, caption = QString(), dir_ = QString(), filter = QString(), selectedFilter = None, options = QFileDialog.Options()): """ Module function to get a list of names of files for opening. @param parent parent widget of the dialog (QWidget) @param caption window title of the dialog (QString) @param dir_ working directory of the dialog (QString) @param filter filter string for the dialog (QString) @param selectedFilter selected filter for the dialog (QString) @param options various options for the dialog (QFileDialog.Options) @return list of filenames to be opened (QStringList) """ if not QString(filter).isEmpty(): filter = __convertFilter(filter, selectedFilter) wdir = __workingDirectory(dir_) dlg = KFileDialog(KUrl.fromPath(wdir), filter, parent) dlg.setOperationMode(KFileDialog.Opening) dlg.setMode(KFile.Modes(KFile.Files) | KFile.Modes(KFile.LocalOnly)) dlg.setWindowTitle(caption.isEmpty() and \ QApplication.translate('KFileDialog', 'Open') or caption) dlg.exec_() if selectedFilter is not None: flt = dlg.currentFilter() flt.prepend("(").append(")") selectedFilter.replace(0, selectedFilter.length(), flt) return dlg.selectedFiles()