Version: 9.15.0
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...
 
QFileDialog::Options pathOptions () const
 Get currently used path options. More...
 
void setPathOptions (const QFileDialog::Options)
 Set path file dialog options. 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
 
QFileDialog::Options myOptions
 
bool myBrowse
 

Detailed Description

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

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() [1/2]

QtxPathEdit::QtxPathEdit ( const Qtx::PathType  type,
QWidget parent = 0,
bool  browse = false 
)

Constructor.

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() [2/2]

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

Constructor.

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::~QtxPathEdit ( )
virtual

Destructor.

Member Function Documentation

◆ initialize()

void QtxPathEdit::initialize ( )
private

Perform internal widget intialization.

References browse_icon, myPath, onBrowse(), and updateState().

◆ lineEdit()

QLineEdit * QtxPathEdit::lineEdit ( ) const
protected

Get internal line edit widget.

Returns
line edit box widget

References myPath.

◆ onBrowse

void QtxPathEdit::onBrowse ( bool  = false)
privateslot

Called when user clicks "Browse" button.

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(), pathOptions(), pathType(), Qtx::PT_Directory, Qtx::PT_OpenFile, and Qtx::PT_SaveFile.

◆ path()

QString QtxPathEdit::path ( ) const

Get currently selected path.

Returns
file or directory path entered by the user
See also
setPath()

References myPath.

◆ pathFilter()

QString QtxPathEdit::pathFilter ( ) const

Get currently used path filters.

Returns
file or directory path filters
See also
setPathFilter()

References myFilter.

◆ pathOptions()

QFileDialog::Options QtxPathEdit::pathOptions ( ) const

Get currently used path options.

Returns
file or directory path options
See also
setPathOptions()

References myOptions.

◆ pathType()

Qtx::PathType QtxPathEdit::pathType ( ) const

Get widget mode.

Returns
currently used widget mode (Qtx::PathType)
See also
setPathType()

References myType.

◆ setPath()

void QtxPathEdit::setPath ( const QString &  txt)

Set path.

Parameters
txtfile or directory path
See also
path()

References myPath.

◆ setPathFilter()

void QtxPathEdit::setPathFilter ( const QString &  f)

Set path filters.

Parameters
fnew file or directory path filters
See also
pathFilter()

References myFilter, and updateState().

◆ setPathOptions()

void QtxPathEdit::setPathOptions ( const QFileDialog::Options  options)

Set path file dialog options.

Parameters
fnew file or directory path options
See also
pathOptions()

References myOptions.

◆ setPathType()

void QtxPathEdit::setPathType ( const Qtx::PathType  type)

Set widget mode.

Parameters
typenew widget mode (Qtx::PathType)
See also
pathType()

References myType, and updateState().

◆ updateState()

void QtxPathEdit::updateState ( )
private

Update widget state.

References myPath, Qtx::pathCompleter(), pathFilter(), and pathType().

Member Data Documentation

◆ myBrowse

bool QtxPathEdit::myBrowse
private

◆ myFilter

QString QtxPathEdit::myFilter
private

◆ myOptions

QFileDialog::Options QtxPathEdit::myOptions
private

◆ myPath

QLineEdit* QtxPathEdit::myPath
private

◆ myType

Qtx::PathType QtxPathEdit::myType
private

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