53 tr(
"Open Image"),
"/home/jana",
tr(
"Image Files (*.png *.jpg *.bmp)"));
58 "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"
105 tr(
"Images (*.png *.xpm *.jpg)"));
112 "Select one or more files to open",
114 "Images (*.png *.xpm *.jpg)");
120 "/home/jana/untitled.png",
121 tr(
"Images (*.png *.xpm *.jpg)"));
135 "application/octet-stream"
144 "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"
The QByteArray class provides an array of bytes.
The QFileDialog class provides a dialog that allow users to select files or directories....
static QString getExistingDirectory(QWidget *parent=nullptr, const QString &caption=QString(), const QString &dir=QString(), Options options=ShowDirsOnly)
static QString getSaveFileName(QWidget *parent=nullptr, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=nullptr, Options options=Options())
void setNameFilters(const QStringList &filters)
static QString getOpenFileName(QWidget *parent=nullptr, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=nullptr, Options options=Options())
void setViewMode(ViewMode mode)
QStringList selectedFiles() const
static void getOpenFileContent(const QString &nameFilter, const std::function< void(const QString &, const QByteArray &)> &fileContentsReady)
void setFileMode(FileMode mode)
void setNameFilter(const QString &filter)
static QStringList getOpenFileNames(QWidget *parent=nullptr, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=nullptr, Options options=Options())
The QString class provides a Unicode character string.
The QStringList class provides a list of strings.
void saveFile(const char *content, size_t size, const std::string &fileNameHint)
QStringList mimeTypeFilters({"image/jpeg", "image/png", "application/octet-stream" })
[12]
XML files xml auto fileContentReady
[14]
QFileDialog dialog(this)
[1]
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]