" "
};
-//================================================================
-// Function : QtxPathDialog
-// Purpose : Constructor.
-//================================================================
-
+/*!
+ Constructor.
+*/
QtxPathDialog::QtxPathDialog( const bool import, QWidget* parent, const bool modal, const bool resize, const int buttons, WFlags f )
: QtxDialog( parent, 0, modal, resize, buttons, f ),
myDefault( -1 ),
setFocusProxy( le );
}
-//================================================================
-// Function : QtxPathDialog
-// Purpose : Constructor.
-//================================================================
-
+/*!
+ Constructor.
+*/
QtxPathDialog::QtxPathDialog( QWidget* parent, const bool modal, const bool resize, const int buttons, WFlags f )
: QtxDialog( parent, 0, modal, resize, buttons, f ),
myDefault( -1 ),
initialize();
}
-//================================================================
-// Function : ~QtxPathDialog
-// Purpose : Destructor.
-//================================================================
-
+/*!
+ Destructor.
+*/
QtxPathDialog::~QtxPathDialog()
{
}
-//================================================================
-// Function : fileName
-// Purpose :
-//================================================================
-
+/*!
+ \return file name
+*/
QString QtxPathDialog::fileName() const
{
return fileName( defaultEntry() );
}
-//================================================================
-// Function : setFileName
-// Purpose :
-//================================================================
-
+/*!
+ Sets file name
+ \param txt - new file name
+ \param autoExtension - auto extension determination by file
+*/
void QtxPathDialog::setFileName( const QString& txt, const bool autoExtension )
{
setFileName( defaultEntry(), txt, autoExtension );
}
-//================================================================
-// Function : filter
-// Purpose :
-//================================================================
-
+/*!
+ \return filter
+*/
QString QtxPathDialog::filter() const
{
return myFilter;
}
-//================================================================
-// Function : setFilter
-// Purpose :
-//================================================================
-
+/*!
+ Changes filter (filter is a list of masks, separated by ';;')
+ \param fltr - new filter
+*/
void QtxPathDialog::setFilter( const QString& fltr )
{
myFilter = fltr;
}
-//================================================================
-// Function : show
-// Purpose :
-//================================================================
-
+/*!
+ Shows path dialog
+*/
void QtxPathDialog::show()
{
if ( hasVisibleChildren( myEntriesFrame ) )
QtxDialog::show();
}
-//================================================================
-// Function : onBrowse
-// Purpose :
-//================================================================
-
+/*!
+ SLOT: called if user click button to show standard file dialog
+*/
void QtxPathDialog::onBrowse()
{
const QObject* obj = sender();
emit fileNameChanged( fName );
}
-//================================================================
-// Function : onReturnPressed
-// Purpose :
-//================================================================
-
+/*!
+ SLOT: called if user presses RETURN in line edit
+*/
void QtxPathDialog::onReturnPressed()
{
const QObject* obj = sender();
emit fileNameChanged( fileName() );
}
-//================================================================
-// Function : onTextChanged
-// Purpose :
-//================================================================
-
+/*!
+ SLOT: called if text in line edit is changed
+*/
void QtxPathDialog::onTextChanged( const QString& )
{
validate();
}
-//================================================================
-// Function : validate
-// Purpose :
-//================================================================
-
+/*!
+ Checks validity of text and according to it enables/disables OK, Yes buttons
+*/
void QtxPathDialog::validate()
{
setButtonEnabled( isValid(), OK | Yes );
}
-//================================================================
-// Function : isValid
-// Purpose :
-//================================================================
-
+/*!
+ \return true if selected file is valid
+*/
bool QtxPathDialog::isValid()
{
bool ok = true;
return ok;
}
-//================================================================
-// Function : acceptData
-// Purpose :
-//================================================================
-
+/*!
+ \return true entered data is accepted
+*/
bool QtxPathDialog::acceptData() const
{
bool ok = true;
return ok;
}
-//================================================================
-// Function : fileNameChanged
-// Purpose :
-//================================================================
-
+/*!
+ Some custom activity on file name changing (must be redefined, default implementation is empty
+*/
void QtxPathDialog::fileNameChanged( int, QString )
{
}
-//================================================================
-// Function : optionsFrame
-// Purpose :
-//================================================================
-
+/*!
+ \return frame with options
+*/
QFrame* QtxPathDialog::optionsFrame()
{
return myOptionsFrame;
}
-//================================================================
-// Function : getFileName
-// Purpose :
-//================================================================
-
+/*!
+ \return file name
+ \param id - id of file entry
+*/
QString QtxPathDialog::fileName( const int id ) const
{
QString res;
return res;
}
-//================================================================
-// Function : setFileName
-// Purpose :
-//================================================================
-
+/*!
+ Change file name of file entry
+ \param id - id of file entry
+ \param txt - new file name
+ \param autoExt - assign extension automatically
+*/
void QtxPathDialog::setFileName( const int id, const QString& txt, const bool autoExt )
{
int mode;
}
}
-//================================================================
-// Function : fileEntry
-// Purpose :
-//================================================================
-
+/*!
+ \return line edit of file entry
+ \param id - id of file entry
+*/
QLineEdit* QtxPathDialog::fileEntry( const int id ) const
{
QLineEdit* le = 0;
return le;
}
-//================================================================
-// Function : fileEntry
-// Purpose :
-//================================================================
-
+/*!
+ \return line edit and mode of file entry
+ \param id - id of file entry
+ \param theMode - for return mode of file entry
+*/
QLineEdit* QtxPathDialog::fileEntry( const int theId, int& theMode ) const
{
QLineEdit* le = 0;
return le;
}
-//================================================================
-// Function : createFileEntry
-// Purpose :
-//================================================================
-
+/*!
+ Creates file entry
+ \return id of just created file entry
+ \param lab - title of entry
+ \param mode - mode of entry
+ \param id - proposed id (if it is -1, then id will be chosen automatically)
+*/
int QtxPathDialog::createFileEntry( const QString& lab, const int mode, const int id )
{
int num = id;
return num;
}
-//================================================================
-// Function : defaultEntry
-// Purpose :
-//================================================================
-
+/*!
+ \return id of default entry
+*/
int QtxPathDialog::defaultEntry() const
{
return myDefault;
}
-//================================================================
-// Function : setDefaultEntry
-// Purpose :
-//================================================================
-
+/*!
+ Change default entry id
+ \param id - new default entry id
+*/
void QtxPathDialog::setDefaultEntry( const int id )
{
myDefault = id;
}
-//================================================================
-// Function : initialize
-// Purpose :
-//================================================================
-
+/*!
+ Initialize dialog layout
+*/
void QtxPathDialog::initialize()
{
setCaption( tr( "File dialog" ) );
myOptionsFrame = new QFrame( mainGroup );
}
-//================================================================
-// Function : prepareFilters
-// Purpose :
-//================================================================
-
+/*!
+ \return list of filters
+*/
QStringList QtxPathDialog::prepareFilters() const
{
QStringList res;
return res;
}
-//================================================================
-// Function : filterWildCards
-// Purpose :
-//================================================================
-
+/*!
+ \return list of filters with filtered wild cards
+*/
QStringList QtxPathDialog::filterWildCards( const QString& theFilter ) const
{
QStringList res;
return res;
}
-//================================================================
-// Function : autoExtension
-// Purpose :
-//================================================================
-
+/*!
+ \return file name with assigned extension
+ \param theFileName - source file name
+ \param theFilter - list of filters
+*/
QString QtxPathDialog::autoExtension( const QString& theFileName, const QString& theFilter ) const
{
QString fName = theFileName;
return fName;
}
-//================================================================
-// Function : hasVisibleChildren
-// Purpose :
-//================================================================
-
+/*!
+ \return true if widget has visible children
+ \param wid - widget
+*/
bool QtxPathDialog::hasVisibleChildren( QWidget* wid ) const
{
bool res = false;