Version: 6.3.1
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes

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)
 Constructor.
 QtxPathEdit (QWidget *=0)
 Constructor.
virtual ~QtxPathEdit ()
 Destructor.
QString path () const
 Get currently selected path.
void setPath (const QString &)
 Set path.
Qtx::PathType pathType () const
 Get widget mode.
void setPathType (const Qtx::PathType)
 Set widget mode.
QString pathFilter () const
 Get currently used path filters.
void setPathFilter (const QString &)
 Set path filters.

Protected Member Functions

QLineEditlineEdit () const
 Get internal line edit widget.

Private Slots

void onBrowse (bool=false)
 Called when user clicks "Browse" button.

Private Member Functions

void initialize ()
 Perform internal widget intialization.
void updateState ()
 Update widget state.

Private Attributes

QLineEditmyPath
Qtx::PathType myType
QString myFilter

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 
)
Parameters:
typewidget mode (Qtx.PathType)
parentparent widget
See also:
pathType(), setPathType()

References initialize().

QtxPathEdit::QtxPathEdit ( QWidget parent = 0)

Qtx.PT_OpenFile mode is used by default.

Parameters:
parentparent widget
See also:
pathType(), setPathType()

References initialize().

QtxPathEdit::~QtxPathEdit ( ) [virtual]

Member Function Documentation

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

References myPath.

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

References myPath.

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

References myType.

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

References myType, and updateState().

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

References myFilter.

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

References myFilter, and updateState().

void QtxPathEdit::onBrowse ( bool  = false) [private, slot]

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

Parameters:
on(not used)
See also:
mode(), setMode()

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

QLineEdit * QtxPathEdit::lineEdit ( ) const [protected]
Returns:
line edit box widget

References myPath.

void QtxPathEdit::initialize ( ) [private]
void QtxPathEdit::updateState ( ) [private]

Field Documentation

QString QtxPathEdit.myFilter [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS