The FileDialog class provides dialogs that allow users to select files or directories. More...
#include <FileDialog.h>
Static Public Member Functions | |
static QString | getExistingDirectory (QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), Options options=ShowDirsOnly) |
This is a convenience static function that will return an existing directory selected by the user. | |
static QString | getOpenFileName (QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=0, Options options=0) |
This is a convenience static function that returns an existing file selected by the user. | |
static QStringList | getOpenFileNames (QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=0, Options options=0) |
This is a convenience static function that will return one or more existing files selected by the user. | |
static QString | getSaveFileName (QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=0, Options options=0) |
This is a convenience static function that will return a file name selected by the user. | |
static QString | getWorkingDirectory () |
Returns the working directory for the file dialog. | |
static void | setWorkingDirectory (const QString &) |
Sets the working directory to dir for the file dialog. |
The FileDialog class provides dialogs that allow users to select files or directories.
Definition at line 43 of file FileDialog.h.
QString FileDialog::getExistingDirectory | ( | QWidget * | parent = 0 , |
|
const QString & | caption = QString() , |
|||
const QString & | dir = QString() , |
|||
Options | options = ShowDirsOnly | |||
) | [static] |
This is a convenience static function that will return an existing directory selected by the user.
Definition at line 99 of file FileDialog.cpp.
Referenced by Gui::StdCmdDownloadOnlineHelp::activated().
QString FileDialog::getOpenFileName | ( | QWidget * | parent = 0 , |
|
const QString & | caption = QString() , |
|||
const QString & | dir = QString() , |
|||
const QString & | filter = QString() , |
|||
QString * | selectedFilter = 0 , |
|||
Options | options = 0 | |||
) | [static] |
This is a convenience static function that returns an existing file selected by the user.
If the user pressed Cancel, it returns a null string.
Definition at line 118 of file FileDialog.cpp.
References DrawingExample::file, getWorkingDirectory(), and setWorkingDirectory().
Referenced by CmdSandboxMeshLoaderBoost::activated(), CmdSandboxMeshLoader::activated(), CmdPointsImport::activated(), CmdPartImportCurveNet::activated(), CmdPartImport::activated(), ImportIges::activated(), ImportStep::activated(), FCCmdImportReadBREP::activated(), CmdDrawingOpen::activated(), PartGui::DlgPartImportStepImp::onChooseFileName(), PartGui::DlgPartImportIgesImp::onChooseFileName(), Gui::Dialog::ParameterGroup::onImportFromFile(), and Gui::PythonConsole::onInsertFileName().
QStringList FileDialog::getOpenFileNames | ( | QWidget * | parent = 0 , |
|
const QString & | caption = QString() , |
|||
const QString & | dir = QString() , |
|||
const QString & | filter = QString() , |
|||
QString * | selectedFilter = 0 , |
|||
Options | options = 0 | |||
) | [static] |
This is a convenience static function that will return one or more existing files selected by the user.
Definition at line 144 of file FileDialog.cpp.
References getWorkingDirectory(), and setWorkingDirectory().
Referenced by CmdSandboxMeshLoaderFuture::activated(), and CmdMeshImport::activated().
QString FileDialog::getSaveFileName | ( | QWidget * | parent = 0 , |
|
const QString & | caption = QString() , |
|||
const QString & | dir = QString() , |
|||
const QString & | filter = QString() , |
|||
QString * | selectedFilter = 0 , |
|||
Options | options = 0 | |||
) | [static] |
This is a convenience static function that will return a file name selected by the user.
The file does not have to exist.
Definition at line 51 of file FileDialog.cpp.
References DrawingExample::file, getWorkingDirectory(), and setWorkingDirectory().
Referenced by CmdRobotExportKukaFull::activated(), CmdRobotExportKukaCompact::activated(), CmdRaytracingExportProject::activated(), CmdRaytracingWriteView::activated(), CmdRaytracingWritePart::activated(), CmdRaytracingWriteCamera::activated(), CmdPointsExport::activated(), CmdPartExport::activated(), CmdMeshExport::activated(), CmdDrawingExportPage::activated(), Gui::Dialog::ParameterGroup::onExportToFile(), Gui::PythonConsole::onSaveHistoryAs(), Gui::View3DInventor::printPdf(), Gui::EditorView::printPdf(), and Gui::EditorView::saveAs().
QString FileDialog::getWorkingDirectory | ( | ) | [static] |
Returns the working directory for the file dialog.
This path can be used in combination with getSaveFileName(), getOpenFileName(), getOpenFileNames() or getExistingDirectory() to open the dialog in this path.
Definition at line 171 of file FileDialog.cpp.
References App::Application::Config(), App::GetApplication(), ParameterGrp::GetGroup(), and App::Application::GetUserParameter().
Referenced by getOpenFileName(), getOpenFileNames(), getSaveFileName(), and Gui::Document::saveAs().
void FileDialog::setWorkingDirectory | ( | const QString & | dir | ) | [static] |
Sets the working directory to dir for the file dialog.
If dir is a file then the path only is taken. getWorkingDirectory() returns the working directory.
Definition at line 188 of file FileDialog.cpp.
References App::GetApplication(), ParameterGrp::GetGroup(), and App::Application::GetUserParameter().
Referenced by getOpenFileName(), getOpenFileNames(), getSaveFileName(), and Gui::Document::saveAs().