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 (QWidget *parent, Type idType, QStandardPaths::StandardLocation stdLocation, const QString &filter=QString(), SettingsIni *settings=nullptr, const QString &keyLatest=QString()) |
Choose a file from user-space with standard location. | |
static QFileInfo | fromUserSpaceFile (QWidget *parent, Type idType, const QString &dirLocation, const QString &filter=QString(), SettingsIni *settings=nullptr, const QString &keyLatest=QString()) |
Choose a file from user-space. | |
static QString | fromUserSpaceDir (QWidget *parent, QStandardPaths::StandardLocation stdLocation, SettingsIni *settings=nullptr, const QString &keyLatest=QString()) |
Choose a directory from user-space with standard location. | |
static QString | fromUserSpaceDir (QWidget *parent, const QString &dirLocation, SettingsIni *settings=nullptr, const QString &keyLatest=QString()) |
Choose a directory from user-space. | |
static QString | getPathFromKey (const SettingsIni *settings, 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 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 |
Choose a file from user-space.
Allow to choose file from user-space and allow to easily remember latest used directory.
[in,out] | parent | Parent widget. |
[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] | 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] | settings | Settings entity to use store if using keyLatest argument. Nothing performed if nullptr . |
[in] | keyLatest | If not empty, provided key will be read from setting argument 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 |
QFileInfo::filePath()
method.
|
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 directory from user-space.
Allow to choose directory from user-space and allowing to easily remember latest.
[in,out] | parent | Parent widget. |
[in] | dirLocation | Default directory to used when opening directory dialog window |
[in,out] | settings | Settings entity to use store if using keyLatest argument. Nothing performed if nullptr . |
[in] | keyLatest | If not empty, provided key will be read from setting argument 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. |
|
static |
Allow to retrieve a FileChooser path from key.
[in] | setting | Setting instance to use. Must be not NULL. |
[in] | key | Key used to perform registration |
[in] | defaultValue | Default value to use if key doesn't exist or if value is empty. |
key