简体   繁体   English

什么是所有文件的mime类型

[英]What is the mime-type for All Files

Simple Question: What is the mimetype for "All Files", ie * or *.* 一个简单的问题:“所有文件”的模仿类型是什么,即**.*

I need it to add the option "All Files" to a filter for files in the QFileDialog : 我需要它来将选项“所有文件”添加到QFileDialog文件的过滤器中:

QFileDialog dialog(this);
QStringList mTypes= byteToStringList(QImageReader::supportedMimeTypes());
mTypes.append("???");//what to add here to get "All Files (*)" or "All Files (*.*)"
dialog.setMimeTypeFilters(mTypes);

it's literally in the documentation for the function 它实际上是在该功能的文档中

says

Use "application/octet-stream" for the "All files (*)" filter, since that is the base MIME type for all files. 将“应用程序/八位字节流”用于“所有文件(*)”过滤器,因为这是所有文件的基本MIME类型。

只要根本不设置任何mime类型过滤器,它就会显示所有文件。

you can use this: 您可以使用此:

QFileDialog dialog(this);
dialog.setFileMode(QFileDialog::AnyFile);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM