|
QSint Library
0.2.2
|
Widget combining a line edit and a tool button used for selection of file system objects. More...
#include <pathpicker.h>
Inherits QWidget.
Public Types | |
| enum | PickFlags { PF_EXISTING_FILE, PF_EXISTING_FILES, PF_EXISTING_DIR, PF_SAVE_FILE } |
| Defines file system objects to pick. More... | |
| enum | DialogFlags { DF_SYSTEM = 0, DF_DEFAULT } |
| Defines pick dialog type. More... | |
Signals | |
| void | beforePicked () |
| void | picked (const QString &path) |
Public Member Functions | |
| PathPicker (QWidget *parent=0) | |
| void | setEditorEnabled (bool set) |
| bool | isEditorEnabled () const |
| void | setObjectsToPick (int flags) |
| int | objectsToPick () const |
| void | setDialogType (int flags) |
| int | dialogType () const |
| void | setDefaultDirectory (const QString &dirName) |
| const QString & | defaultDirectory () const |
| void | setFilters (const QString &filters) |
| const QString & | filters () const |
| void | setCaption (const QString &text) |
| const QString & | caption () const |
| QToolButton * | button () |
| QLineEdit * | editor () |
Protected Slots | |
| virtual void | showPickDialog () |
Widget combining a line edit and a tool button used for selection of file system objects.
Click on the tool button invokes a modal dialog where you can choose a file, a directory or a number of files to open (or a file to save). The selected path(es) will be then transferred to the line edit along with emitting the picked() signal.
Using setObjectsToPick() and setDialogType(), you can specify the style of the pick dialog and the file system objects (see PickFlags and DialogFlags enums).
Use setCaption() to modify the default caption of the pick dialog.
Method setDefaultDirectory() lets you set the initial directory where to point the pick dialog.
Via setFilters() you can specify additional file name wildcards (See Qt documentation on the QFileDialog class).
To customize the look of the tool button (i.e. icon, text, etc.), retrieve the pointer to the tool button via button() method. Use editor() method to get the line edit widget.
|
explicit |
Constructor.
|
signal |
Emitted when user is about to pick an object from the dialog or editor.
|
inline |
Returns the tool button widget.
|
inline |
Returns the caption of the pick dialog, or empty string if the default one should be used.
|
inline |
Returns the default directory which is open when showing the dialog.
|
inline |
Returns DialogFlags defining dialog type.
|
inline |
Returns the line edit widget.
|
inline |
Returns the active file name filters applied to the filenames.
|
inline |
Returns true if manual path editor is enabled, false otherwise.
|
inline |
Returns PickFlags defining objects to pick.
|
signal |
Emitted when user picks an object from the dialog or editor. path
|
inline |
Defines the caption of the pick dialog. If no caption has been specified, then the default one will be shown.
|
inline |
Defines the default directory to open when showing the dialog.
|
inline |
Defines pick dialog type as DialogFlags.
| void QSint::PathPicker::setEditorEnabled | ( | bool | set | ) |
Enables (default) or disables manual path editor according to set parameter.
|
inline |
Defines the file name filters applied to the filenames.
|
inline |
Defines objects being picked as PickFlags.
|
protectedvirtualslot |
Invokes file object pick dialog. When a valid object(s) has been picked from the filesystem, the implementation should set the content of the editor and emit picked() signal.