The QtxPathEdit class represents a widget for file or directory path preference items editing. More...
#include <QtxPathEdit.h>
Public Member Functions | |
QtxPathEdit (const Qtx::PathType, QWidget *=0, bool=false) | |
Constructor. More... | |
QtxPathEdit (QWidget *=0, bool=false) | |
Constructor. More... | |
virtual | ~QtxPathEdit () |
Destructor. More... | |
QString | path () const |
Get currently selected path. More... | |
void | setPath (const QString &) |
Set path. More... | |
Qtx::PathType | pathType () const |
Get widget mode. More... | |
void | setPathType (const Qtx::PathType) |
Set widget mode. More... | |
QString | pathFilter () const |
Get currently used path filters. More... | |
void | setPathFilter (const QString &) |
Set path filters. More... | |
Protected Member Functions | |
QLineEdit * | lineEdit () const |
Get internal line edit widget. More... | |
Private Slots | |
void | onBrowse (bool=false) |
Called when user clicks "Browse" button. More... | |
Private Member Functions | |
void | initialize () |
Perform internal widget intialization. More... | |
void | updateState () |
Update widget state. More... | |
Private Attributes | |
QLineEdit * | myPath |
Qtx::PathType | myType |
QString | myFilter |
bool | myBrowse |
The path preference item is represented as the line edit box for the direct path editing and small button clicking on which invokes browse dialog box. The widget can be used in different modes: "Open File", "Save File", "Select Directory". The mode defines the type of the standard browse dialog box which is invoked on the button clicking.
Initial path value can be set with setPath() method. Chosen path can be retrieved with the path() method. The widget mode can be set with setPathType() and retrieved with pathType() method.
In addition, file/direcrory filters (wildcards) can be set with the setPathFilter() method and retrieved with pathFilter() method.
QtxPathEdit::QtxPathEdit | ( | const Qtx::PathType | type, |
QWidget * | parent = 0 , |
||
bool | browse = false |
||
) |
type | widget mode (Qtx::PathType) |
parent | parent widget |
browse | if true , automatically finish editing of file path when user presses OK in "Select File/Directory" dialog box |
References initialize().
QtxPathEdit::QtxPathEdit | ( | QWidget * | parent = 0 , |
bool | browse = false |
||
) |
Qtx::PT_OpenFile mode is used by default.
parent | parent widget |
browse | if true , automatically finish editing of file path when user presses OK in "Select File/Directory" dialog box |
References initialize().
|
virtual |
|
private |
References browse_icon, myPath, onBrowse(), and updateState().
|
protected |
References myPath.
|
privateslot |
Invokes standard browsng dialog box depending on the used widget mode.
on | (not used) |
References Qtx::makeEnvVarSubst(), myBrowse, myPath, path(), pathFilter(), pathType(), Qtx::PT_Directory, Qtx::PT_OpenFile, and Qtx::PT_SaveFile.
QString QtxPathEdit::path | ( | ) | const |
QString QtxPathEdit::pathFilter | ( | ) | const |
Qtx::PathType QtxPathEdit::pathType | ( | ) | const |
void QtxPathEdit::setPath | ( | const QString & | txt | ) |
void QtxPathEdit::setPathFilter | ( | const QString & | f | ) |
f | new file or directory path filters |
References myFilter, and updateState().
void QtxPathEdit::setPathType | ( | const Qtx::PathType | type | ) |
type | new widget mode (Qtx::PathType) |
References myType, and updateState().
|
private |
References myPath, Qtx::pathCompleter(), pathFilter(), and pathType().
|
private |
|
private |
|
private |
|
private |