The FileDialog class provides dialogs that allow users to select files or directories. More...
#include <FileDialog.h>
Public Member Functions | |
void | accept () |
FileDialog (QWidget *parent=0) | |
~FileDialog () | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static QString | getWorkingDirectory () |
Returns the working directory for the file dialog. More... | |
static QString | restoreLocation () |
Return the last location where a file save or load dialog was used. More... | |
static void | saveLocation (const QString &) |
Save the last location where a file save or load dialog was used. More... | |
static void | setWorkingDirectory (const QString &) |
Sets the working directory to dir for the file dialog. More... | |
Detailed Description
The FileDialog class provides dialogs that allow users to select files or directories.
Constructor & Destructor Documentation
◆ FileDialog()
FileDialog::FileDialog | ( | QWidget * | parent = 0 | ) |
◆ ~FileDialog()
FileDialog::~FileDialog | ( | ) |
Member Function Documentation
◆ accept()
void FileDialog::accept | ( | ) |
Referenced by ArchComponent.ComponentTaskPanel::editObject().
◆ getExistingDirectory()
|
static |
This is a convenience static function that will return an existing directory selected by the user.
Referenced by Gui::StdCmdDownloadOnlineHelp::activated().
◆ getOpenFileName()
|
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.
References Gui::dontUseNativeDialog(), getWorkingDirectory(), restoreLocation(), and setWorkingDirectory().
Referenced by CmdSandboxMeshLoader::activated(), PartGui::DlgPartImportIgesImp::onChooseFileName(), PartGui::DlgPartImportStepImp::onChooseFileName(), Gui::Dialog::ParameterGroup::onImportFromFile(), and Gui::PythonConsole::onInsertFileName().
◆ getOpenFileNames()
|
static |
This is a convenience static function that will return one or more existing files selected by the user.
References Gui::dontUseNativeDialog(), getWorkingDirectory(), restoreLocation(), and setWorkingDirectory().
◆ getSaveFileName()
|
static |
This is a convenience static function that will return a file name selected by the user.
The file does not have to exist.
References Gui::dontUseNativeDialog(), getWorkingDirectory(), restoreLocation(), and setWorkingDirectory().
Referenced by Gui::Dialog::ParameterGroup::onExportToFile(), Gui::GraphvizView::onMsg(), Gui::PythonConsole::onSaveHistoryAs(), Gui::GraphvizView::printPdf(), Gui::EditorView::printPdf(), TechDrawGui::MDIViewPage::printPdf(), Gui::View3DInventor::printPdf(), Gui::EditorView::saveAs(), Gui::Document::saveAs(), Gui::Document::saveCopy(), TechDrawGui::MDIViewPage::saveDXF(), and TechDrawGui::MDIViewPage::saveSVG().
◆ getWorkingDirectory()
|
static |
Returns the working directory for the file dialog.
Return the last directory a file was read from or saved to.
This path can be used in combination with getSaveFileName(), getOpenFileName(), getOpenFileNames() or getExistingDirectory() to open the dialog in this path.
Referenced by getOpenFileName(), getOpenFileNames(), and getSaveFileName().
◆ restoreLocation()
|
static |
Return the last location where a file save or load dialog was used.
- Returns
- QString
References App::Application::Config(), App::GetApplication(), ParameterGrp::GetASCII(), ParameterGrp::GetGroup(), and App::Application::GetUserParameter().
Referenced by getOpenFileName(), getOpenFileNames(), getSaveFileName(), and Gui::Application::runApplication().
◆ saveLocation()
|
static |
Save the last location where a file save or load dialog was used.
- Parameters
-
dirName
References App::GetApplication(), ParameterGrp::GetGroup(), App::Application::GetUserParameter(), and ParameterGrp::SetASCII().
Referenced by Gui::Application::runApplication(), and setWorkingDirectory().
◆ setWorkingDirectory()
|
static |
Sets the working directory to dir for the file dialog.
Set the directory a file was read from or saved to.
If dir is a file then the path only is taken. getWorkingDirectory() returns the working directory.
References saveLocation().
Referenced by getOpenFileName(), getOpenFileNames(), getSaveFileName(), Gui::Application::importFrom(), Gui::Application::open(), and Gui::Application::runApplication().
The documentation for this class was generated from the following files:
- src/Gui/FileDialog.h
- src/Gui/FileDialog.cpp