Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_gui_dialogs_qfiledialog.cpp File Reference

(08d2ae88333ee63fe4e84b24409c41d603697577)

Go to the source code of this file.

Functions

dialog setFileMode (QFileDialog::AnyFile)
 
dialog setNameFilter (tr("Images (*.png *.xpm *.jpg)"))
 [2]
 
dialog setViewMode (QFileDialog::Detail)
 [3]
 
 if (dialog.exec()) fileNames = dialog.selectedFiles()
 
dialog setNameFilter ("All C++ files (*.cpp *.cc *.C *.cxx *.c++)")
 [5]
 
dialog setNameFilter ("*.cpp *.cc *.C *.cxx *.c++")
 
dialog setNameFilters (filters)
 
dialog exec ()
 
dialog setMimeTypeFilters (mimeTypeFilters)
 

Variables

 fileName
 [0]
 
Images * png
 [0]
 
Text filestxt
 
QStringList fileNames
 [4]
 
const QStringList filters ({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
 [6]
 
QFileDialog dialog (this)
 [1]
 
QStringList files
 [8]
 
QString dir
 [11]
 
QStringList mimeTypeFilters ({"image/jpeg", "image/png", "application/octet-stream" })
 [12]
 
XML files xml auto fileContentReady
 [14]
 
QByteArray imageData
 [15]
 

Function Documentation

◆ exec()

msgBox exec ( )

◆ if()

if ( dialog. exec()) = dialog.selectedFiles()

◆ setFileMode()

dialog setFileMode ( QFileDialog::AnyFile )

◆ setMimeTypeFilters()

dialog setMimeTypeFilters ( mimeTypeFilters )

◆ setNameFilter() [1/3]

dialog setNameFilter ( "*.cpp *.cc *.C *.cxx *.c++" )

◆ setNameFilter() [2/3]

dialog setNameFilter ( "All C++ files (*.cpp *.cc *.C *.cxx *.c++)" )

[5]

[6]

◆ setNameFilter() [3/3]

dialog setNameFilter ( tr("Images (*.png *.xpm *.jpg)") )

[2]

[3]

◆ setNameFilters()

dialog setNameFilters ( filters )

◆ setViewMode()

dialog setViewMode ( QFileDialog::Detail )

[3]

[4]

Variable Documentation

◆ dialog

QFileDialog dialog ( this )

[1]

[2]

◆ dir

QString dir
Initial value:
= QFileDialog::getExistingDirectory(this, tr("Open Directory"),
"/home",
static QString getExistingDirectory(QWidget *parent=nullptr, const QString &caption=QString(), const QString &dir=QString(), Options options=ShowDirsOnly)
This is a convenience static function that returns an existing directory selected by the user.
@ DontResolveSymlinks
Definition qfiledialog.h:50
#define tr(X)

[11]

[12]

Definition at line 79 of file src_gui_dialogs_qfiledialog.cpp.

◆ fileContentReady

XML files xml auto fileContentReady
Initial value:
= [](const QString &fileName, const QByteArray &fileContent) {
if (fileName.isEmpty()) {
} else {
}
}
\inmodule QtCore
Definition qbytearray.h:57

[14]

[15]

Definition at line 101 of file src_gui_dialogs_qfiledialog.cpp.

◆ fileName

QString fileName
Initial value:
tr("Open Image"), "/home/jana", tr("Image Files (*.png *.jpg *.bmp)"))
static QString getOpenFileName(QWidget *parent=nullptr, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=nullptr, Options options=Options())
This is a convenience static function that returns an existing file selected by the user.

[0]

[9]

[7]

[8]

[11]

Definition at line 5 of file src_gui_dialogs_qfiledialog.cpp.

◆ fileNames

QStringList fileNames

[4]

[5]

Definition at line 32 of file src_gui_dialogs_qfiledialog.cpp.

◆ files

QStringList files
Initial value:
this,
"Select one or more files to open",
"/home",
"Images (*.png *.xpm *.jpg)")
static QStringList getOpenFileNames(QWidget *parent=nullptr, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=nullptr, Options options=Options())
This is a convenience static function that returns one or more existing files selected by the user.

[8]

[9]

Definition at line 63 of file src_gui_dialogs_qfiledialog.cpp.

◆ filters

const QStringList filters ( {"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" } )

[6]

[7]

◆ imageData

QByteArray imageData

[15]

[16]

Definition at line 112 of file src_gui_dialogs_qfiledialog.cpp.

◆ mimeTypeFilters

QStringList mimeTypeFilters ( {"image/jpeg", "image/png", "application/octet-stream" } )

[12]

[13]

◆ png

Images * png

[0]

[13]

[1]

[14]

Definition at line 11 of file src_gui_dialogs_qfiledialog.cpp.

◆ txt

Text files * txt

Definition at line 11 of file src_gui_dialogs_qfiledialog.cpp.