Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxPathEdit Class Reference

The QtxPathEdit class represents a widget for file or directory path preference items editing. More...

#include <QtxPathEdit.h>

Inheritance diagram for QtxPathEdit:
Inheritance graph

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

QLineEditlineEdit () 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

QLineEditmyPath
 
Qtx::PathType myType
 
QString myFilter
 
bool myBrowse
 

Detailed Description

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.

Constructor & Destructor Documentation

QtxPathEdit::QtxPathEdit ( const Qtx::PathType  type,
QWidget parent = 0,
bool  browse = false 
)
Parameters
typewidget mode (Qtx::PathType)
parentparent widget
browseif true, automatically finish editing of file path when user presses OK in "Select File/Directory" dialog box
See Also
pathType(), setPathType()

References initialize().

QtxPathEdit::QtxPathEdit ( QWidget parent = 0,
bool  browse = false 
)

Qtx::PT_OpenFile mode is used by default.

Parameters
parentparent widget
browseif true, automatically finish editing of file path when user presses OK in "Select File/Directory" dialog box
See Also
pathType(), setPathType()

References initialize().

QtxPathEdit::~QtxPathEdit ( )
virtual

Member Function Documentation

void QtxPathEdit::initialize ( )
private
QLineEdit * QtxPathEdit::lineEdit ( ) const
protected
Returns
line edit box widget

References myPath.

void QtxPathEdit::onBrowse ( bool  = false)
privateslot

Invokes standard browsng dialog box depending on the used widget mode.

Parameters
on(not used)
See Also
mode(), setMode()

References Qtx::makeEnvVarSubst(), myBrowse, myPath, path(), pathFilter(), pathType(), Qtx::PT_Directory, Qtx::PT_OpenFile, and Qtx::PT_SaveFile.

QString QtxPathEdit::path ( ) const
Returns
file or directory path entered by the user
See Also
setPath()

References myPath.

QString QtxPathEdit::pathFilter ( ) const
Returns
file or directory path filters
See Also
setPathFilter()

References myFilter.

Qtx::PathType QtxPathEdit::pathType ( ) const
Returns
currently used widget mode (Qtx::PathType)
See Also
setPathType()

References myType.

void QtxPathEdit::setPath ( const QString &  txt)
Parameters
txtfile or directory path
See Also
path()

References myPath.

void QtxPathEdit::setPathFilter ( const QString &  f)
Parameters
fnew file or directory path filters
See Also
pathFilter()

References myFilter, and updateState().

void QtxPathEdit::setPathType ( const Qtx::PathType  type)
Parameters
typenew widget mode (Qtx::PathType)
See Also
pathType()

References myType, and updateState().

void QtxPathEdit::updateState ( )
private

Member Data Documentation

bool QtxPathEdit::myBrowse
private
QString QtxPathEdit::myFilter
private
QLineEdit* QtxPathEdit::myPath
private
Qtx::PathType QtxPathEdit::myType
private

The documentation for this class was generated from the following files: