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=nullptr) | |
~FileDialog () | |
Static Public Member Functions | |
static QString | getExistingDirectory (QWidget *parent=nullptr, 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=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. More... | |
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 will return one or more existing files selected by the user. More... | |
static QString | getSaveFileName (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 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... | |
The FileDialog class provides dialogs that allow users to select files or directories.
FileDialog::FileDialog | ( | QWidget * | parent = nullptr | ) |
References draftgeoutils.intersections::connect().
FileDialog::~FileDialog | ( | ) |
void FileDialog::accept | ( | void | ) |
|
static |
This is a convenience static function that will return an existing directory selected by the user.
Referenced by Gui::StdCmdDownloadOnlineHelp::activated().
|
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::DialogOptions::dontUseNativeFileDialog(), getWorkingDirectory(), restoreLocation(), and setWorkingDirectory().
Referenced by CmdSandboxMeshLoader::activated(), PartGui::DlgPartImportIgesImp::onChooseFileName(), PartGui::DlgPartImportStepImp::onChooseFileName(), Gui::Dialog::ParameterGroup::onImportFromFile(), and Gui::PythonConsole::onInsertFileName().
|
static |
This is a convenience static function that will return one or more existing files selected by the user.
References Gui::DialogOptions::dontUseNativeFileDialog(), getWorkingDirectory(), restoreLocation(), and setWorkingDirectory().
|
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::DialogOptions::dontUseNativeFileDialog(), getWorkingDirectory(), restoreLocation(), and setWorkingDirectory().
Referenced by Gui::Dialog::ParameterGroup::onExportToFile(), Gui::GraphvizView::onMsg(), Gui::PythonConsole::onSaveHistoryAs(), Gui::EditorView::printPdf(), Gui::GraphvizView::printPdf(), Gui::View3DInventor::printPdf(), TechDrawGui::MDIViewPage::printPdf(), Gui::EditorView::saveAs(), Gui::Document::saveAs(), Gui::Document::saveCopy(), TechDrawGui::MDIViewPage::saveDXF(), and TechDrawGui::MDIViewPage::saveSVG().
|
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 StdCmdExport::activated(), getOpenFileName(), getOpenFileNames(), and getSaveFileName().
|
static |
Return the last location where a file save or load dialog was used.
References App::Application::Config(), App::GetApplication(), ParameterGrp::GetASCII(), ParameterGrp::GetGroup(), and App::Application::GetUserParameter().
Referenced by getOpenFileName(), getOpenFileNames(), getSaveFileName(), and Gui::Application::runApplication().
|
static |
Save the last location where a file save or load dialog was used.
dirName |
References App::GetApplication(), ParameterGrp::GetGroup(), App::Application::GetUserParameter(), and ParameterGrp::SetASCII().
Referenced by Gui::Application::runApplication(), and 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().