Toolbox Qt
|
Used to choose a file from user-space. More...
Public Types | |
enum | Type { CHOOSE_FILE_EXIST , CHOOSE_FILE_CREATE } |
Static Public Member Functions | |
static QFileInfo | fromUserSpaceFile (Type idType, QStandardPaths::StandardLocation stdLocation, const QString &keyLatest=QString(), const QString &filter=QString(), QWidget *parent=nullptr) |
Choose a file from user-space with standard location. | |
static QFileInfo | fromUserSpaceFile (Type idType, const QString &dirLocation, const QString &keyLatest=QString(), const QString &filter=QString(), QWidget *parent=nullptr) |
Choose a file from user-space. | |
static QString | fromUserSpaceDir (QStandardPaths::StandardLocation stdLocation, const QString &keyLatest=QString(), QWidget *parent=nullptr) |
Choose a directory from user-space with standard location. | |
static QString | fromUserSpaceDir (const QString &dirLocation, const QString &keyLatest=QString(), QWidget *parent=nullptr) |
Choose a directory from user-space. | |
static QString | getPathFromKey (const QString &key, const QString &defaultValue=QString()) |
Allow to retrieve a FileChooser path from key. | |
Used to choose a file from user-space.
This class provide methods making easier to choose a file from user-space.
|
static |
Choose a directory from user-space.
Allow to choose directory from user-space and allowing to easily remember latest.
[in] | dirLocation | Default directory to used when opening directory dialog window |
[in] | keyLatest | If not empty, provided key will be read from tbq::SettingsIni and use the registered directory in it (and save it when directory dialog window is closed). This is useful to directly open directory dialog window to the latest used. |
[in,out] | parent | Parent widget. |
|
static |
Choose a directory from user-space with standard location.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
static |
Choose a file from user-space.
Allow to choose file from user-space and allowing to easily remember latest used directory.
[in] | idType | Type of file to choose. If unknown, nothing will be performed. |
[in] | dirLocation | Default directory to used when opening file dialog window |
[in] | keyLatest | If not empty, provided key will be read from tbq::SettingsIni and use the registered directory in it (and save it when file dialog window is closed). This is useful to directly open file dialog window to the latest use directory for this specific ressource |
[in] | filter | Filter to use. Can be set using: tr("Images (*.png *.xpm *.jpg)" // Only display images files
tr("Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" // Allow multiple filters (separated with ";;")
|
[in,out] | parent | Parent widget. |
QFileInfo::filePath()
method.
|
static |
Choose a file from user-space with standard location.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
static |
Allow to retrieve a FileChooser path from key.
[in] | key | Key used to perform registration |
[in] | defaultValue | Default value to use if key doesn't exist or if value is empty. |
key