From e48fe81a444a3d416e3daab0195fe28c2901aa8d Mon Sep 17 00:00:00 2001 From: enk Date: Fri, 8 Jul 2005 12:41:16 +0000 Subject: [PATCH] Update comments --- src/SUIT/SUIT_ActionOperation.h | 4 +- src/SUIT/SUIT_Application.h | 18 ++++--- src/SUIT/SUIT_DataOwner.cxx | 19 ++++---- src/SUIT/SUIT_DataOwner.h | 1 + src/SUIT/SUIT_FileDlg.cxx | 85 +++++++++++++-------------------- src/SUIT/SUIT_FileDlg.h | 28 +++++++---- src/SUIT/SUIT_FileValidator.cxx | 6 +-- src/SUIT/SUIT_FileValidator.h | 2 + src/SUIT/SUIT_MessageBox.h | 13 +++-- src/SUIT/SUIT_Tools.h | 2 +- 10 files changed, 92 insertions(+), 86 deletions(-) diff --git a/src/SUIT/SUIT_ActionOperation.h b/src/SUIT/SUIT_ActionOperation.h index d6a95702f..8fc3139f5 100644 --- a/src/SUIT/SUIT_ActionOperation.h +++ b/src/SUIT/SUIT_ActionOperation.h @@ -15,7 +15,7 @@ public: QtxAction* action() const; - // GUI management + /** @name GUI management*/ //@{ virtual void setAction( const QString& text, const QIconSet& icon, const QString& menuText, QKeySequence accel, QObject* parent, const char* name = 0, bool toggle = false ); @@ -26,7 +26,7 @@ public: bool addTo( QWidget* theWidget ); bool addTo( QWidget* theWidget, int thePos ); - void setStatusTip( const QString& theTip ); + void setStatusTip( const QString& theTip );//@} private: QtxAction* myAction; diff --git a/src/SUIT/SUIT_Application.h b/src/SUIT/SUIT_Application.h index 5ee41624b..127f2ed6d 100755 --- a/src/SUIT/SUIT_Application.h +++ b/src/SUIT/SUIT_Application.h @@ -12,7 +12,9 @@ class SUIT_Desktop; class SUIT_Convertor; class SUIT_ViewModel; class SUIT_ResourceMgr; - +/*! \class QObject + * \brief For more information see QT documentation. + */ /*! An Application is a class which defines application configuration and behaviour. For example Application object defines what Viewers are used in this application, what auxilliary windows @@ -92,24 +94,28 @@ protected: //! Creates a new Study instance. Must be redefined in new application according to its Study type. virtual SUIT_Study* createNewStudy(); virtual void setActiveStudy( SUIT_Study* ); - + + /** @name Create tool functions*/ //@{ int createTool( const QString& ); int createTool( const int, const int, const int = -1 ); int createTool( const int, const QString&, const int = -1 ); int createTool( QAction*, const int, const int = -1, const int = -1 ); - int createTool( QAction*, const QString&, const int = -1, const int = -1 ); + int createTool( QAction*, const QString&, const int = -1, const int = -1 );//@} + /** @name Create menu functions*/ //@{ int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 ); int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 ); int createMenu( const int, const int, const int = -1, const int = -1 ); int createMenu( const int, const QString&, const int = -1, const int = -1 ); int createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 ); - int createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 ); + int createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );//@} + /** @name Set menu shown functions*/ //@{ void setMenuShown( QAction*, const bool ); - void setMenuShown( const int, const bool ); + void setMenuShown( const int, const bool );//@} + /** @name Set tool shown functions*/ //@{ void setToolShown( QAction*, const bool ); - void setToolShown( const int, const bool ); + void setToolShown( const int, const bool );//@} static QAction* separator(); QAction* action( const int ) const; diff --git a/src/SUIT/SUIT_DataOwner.cxx b/src/SUIT/SUIT_DataOwner.cxx index 767dd5220..3a85389bc 100755 --- a/src/SUIT/SUIT_DataOwner.cxx +++ b/src/SUIT/SUIT_DataOwner.cxx @@ -12,23 +12,18 @@ // SUIT_DataOwner class //******************************************************************** -//==================================================================== -//! Constructor -//==================================================================== + +/*! Constructor*/ SUIT_DataOwner::SUIT_DataOwner() { } -//==================================================================== -//! Destructor -//==================================================================== +/*! Destructor*/ SUIT_DataOwner::~SUIT_DataOwner() { } -//==================================================================== -//! operator== : compares two owners -//==================================================================== +/*! operator== : compares two owners*/ bool operator==( const SUIT_DataOwnerPtr& p1, const SUIT_DataOwnerPtr& p2 ) { if ( !p1.isNull() && !p2.isNull() ) @@ -37,8 +32,10 @@ bool operator==( const SUIT_DataOwnerPtr& p1, const SUIT_DataOwnerPtr& p2 ) } //******************************************************************** -// SUIT_DataOwnerPtrList class: implements value list with unique -// items (uniqueness is provided by operator==()) +/*! \class SUIT_DataOwnerPtrList + * implements value list with unique items (uniqueness is + * provided by operator==()) + */ //******************************************************************** //==================================================================== diff --git a/src/SUIT/SUIT_DataOwner.h b/src/SUIT/SUIT_DataOwner.h index b17520d4d..faa0f283e 100755 --- a/src/SUIT/SUIT_DataOwner.h +++ b/src/SUIT/SUIT_DataOwner.h @@ -28,6 +28,7 @@ bool operator==( const SUIT_DataOwnerPtr&, const SUIT_DataOwnerPtr& ); /*! \class QValueList * \brief For more documentation see QT documentation. + * QT class */ /*! \class SUIT_DataOwnerPtrList * \brief Manage list of SUIT_DataOwnerPtr. diff --git a/src/SUIT/SUIT_FileDlg.cxx b/src/SUIT/SUIT_FileDlg.cxx index ed68b26ff..992b6be73 100755 --- a/src/SUIT/SUIT_FileDlg.cxx +++ b/src/SUIT/SUIT_FileDlg.cxx @@ -64,15 +64,14 @@ #define MIN_COMBO_SIZE 100 -// If the selected file name has extension which does not match the selected filter -// this extension is ignored (and new one will be added). See below for details. +/*! If the selected file name has extension which does not match the selected filter + * this extension is ignored (and new one will be added). See below for details. + */ const bool IGNORE_NON_MATCHING_EXTENSION = true; QString SUIT_FileDlg::myLastVisitedPath; -/*! -Constructor -*/ +/*! Constructor */ SUIT_FileDlg::SUIT_FileDlg( QWidget* parent, bool open, bool showQuickDir, bool modal ) : QFileDialog( parent, 0, modal ), myValidator( 0 ), @@ -129,17 +128,13 @@ myAccepted( false ) myValidator = new SUIT_FileValidator(this); } -/*! -Destructor -*/ +/*! Destructor*/ SUIT_FileDlg::~SUIT_FileDlg() { setValidator( 0 ); } -/*! - Redefined from QFileDialog. -*/ +/*! Redefined from QFileDialog.*/ void SUIT_FileDlg::polish() { QFileDialog::polish(); @@ -177,10 +172,9 @@ void SUIT_FileDlg::polish() } } -/*! -Sets validator for file names to open/save -Deletes previous validator if the dialog owns it. -*/ +/*! Sets validator for file names to open/save + * Deletes previous validator if the dialog owns it. + */ void SUIT_FileDlg::setValidator( SUIT_FileValidator* v ) { if ( myValidator && myValidator->parent() == this ) @@ -188,34 +182,31 @@ void SUIT_FileDlg::setValidator( SUIT_FileValidator* v ) myValidator = v; } -/*! -Returns the selected file -*/ +/*! Returns the selected file */ QString SUIT_FileDlg::selectedFile() const { return mySelectedFile; } -/*! -Returns 'true' if this is 'Open File' dialog -and 'false' if 'Save File' dialog -*/ +/*! Returns 'true' if this is 'Open File' dialog + * and 'false' if 'Save File' dialog + */ bool SUIT_FileDlg::isOpenDlg() const { return myOpen; } -/*! -Closes this dialog and sets the return code to 'Accepted' -if the selected name is valid ( see 'acceptData()' ) -*/ +/*! Closes this dialog and sets the return code to 'Accepted' + * if the selected name is valid ( see 'acceptData()' ) + */ void SUIT_FileDlg::accept() { - /* myAccepted flag is used to warkaround the Qt 2.2.2 BUG: - accept() method is called twice if user presses 'Enter' key - in file name editor while file name is not acceptable by acceptData() - (e.g. permission denied) - */ + /* myAccepted + * flag is used to warkaround the Qt 2.2.2 BUG: + * accept() method is called twice if user presses 'Enter' key + * in file name editor while file name is not acceptable by acceptData() + * (e.g. permission denied) + */ if ( !myAccepted ) { if ( mode() != ExistingFiles ) { mySelectedFile = QFileDialog::selectedFile(); @@ -231,21 +222,18 @@ void SUIT_FileDlg::accept() myAccepted = !myAccepted; } -/*! -Closes this dialog and sets the return code to 'Rejected' -*/ +/*! Closes this dialog and sets the return code to 'Rejected' */ void SUIT_FileDlg::reject() { mySelectedFile = QString::null; QFileDialog::reject(); } -/*! -Returns 'true' if selected file is valid. -The validity is checked by a file validator, -if there is no validator the file is always -considered as valid -*/ +/*! Returns 'true' if selected file is valid. + * The validity is checked by a file validator, + * if there is no validator the file is always + * considered as valid + */ bool SUIT_FileDlg::acceptData() { if ( myValidator ) @@ -268,11 +256,10 @@ bool SUIT_FileDlg::acceptData() return true; } -/*! -Adds an extension to the selected file name -if the file has not it. -The extension is extracted from the active filter. -*/ +/*! Adds an extension to the selected file name + * if the file has not it. + * The extension is extracted from the active filter. + */ void SUIT_FileDlg::addExtension() { // check if file name entered is empty @@ -346,9 +333,7 @@ void SUIT_FileDlg::addExtension() } } -/*! - Processes selection : tries to set given path or filename as selection -*/ +/*! Processes selection : tries to set given path or filename as selection */ bool SUIT_FileDlg::processPath( const QString& path ) { if ( !path.isNull() ) { @@ -370,9 +355,7 @@ bool SUIT_FileDlg::processPath( const QString& path ) } return false; } -/*! - Called when user selects item from "Quick Dir" combo box -*/ +/*! Called when user selects item from "Quick Dir" combo box */ void SUIT_FileDlg::quickDir(const QString& dirPath) { QString aPath = dirPath; diff --git a/src/SUIT/SUIT_FileDlg.h b/src/SUIT/SUIT_FileDlg.h index 5770584d0..7bf1cc663 100755 --- a/src/SUIT/SUIT_FileDlg.h +++ b/src/SUIT/SUIT_FileDlg.h @@ -10,6 +10,9 @@ class QComboBox; class QPushButton; class SUIT_FileValidator; +/*! \class QFileDialog + * For more information see QT documentation. +*/ class SUIT_EXPORT SUIT_FileDlg : public QFileDialog { Q_OBJECT @@ -48,15 +51,22 @@ protected slots: void addQuickDir(); protected: - bool myOpen; /* open/save selector */ - QString mySelectedFile; /* selected filename */ - SUIT_FileValidator* myValidator; /* file validator */ - QLabel* myQuickLab; /* quick dir combo box */ - QComboBox* myQuickCombo; /* quick dir combo box */ - QPushButton* myQuickButton; /* quick dir add button */ - bool myAccepted; /* 'Accepted' flag */ - - static QString myLastVisitedPath; /* last visited path */ + bool myOpen; //!< open/save selector + QString mySelectedFile; //!< selected filename + SUIT_FileValidator* myValidator; //!< file validator + QLabel* myQuickLab; //!< quick dir combo box + QComboBox* myQuickCombo; //!< quick dir combo box + QPushButton* myQuickButton; //!< quick dir add button + + /*! \var myAccepted + * \brief flag is used to warkaround the Qt 2.2.2 + * \bug accept() method is called twice if user presses 'Enter' key + * in file name editor while file name is not acceptable by acceptData() + * (e.g. permission denied) + */ + bool myAccepted; + + static QString myLastVisitedPath; //!< last visited path }; #endif diff --git a/src/SUIT/SUIT_FileValidator.cxx b/src/SUIT/SUIT_FileValidator.cxx index c10bfc2af..3298cdb9b 100755 --- a/src/SUIT/SUIT_FileValidator.cxx +++ b/src/SUIT/SUIT_FileValidator.cxx @@ -16,13 +16,13 @@ #include #include -/* constructor */ +/*! constructor */ SUIT_FileValidator::SUIT_FileValidator(QWidget* parent) : myParent(parent) { } -/* returns false if can't open file */ +/*! returns false if can't open file */ bool SUIT_FileValidator::canOpen( const QString& file ) { if ( !QFile::exists( file ) ) { @@ -42,7 +42,7 @@ bool SUIT_FileValidator::canOpen( const QString& file ) return true; } -/* returns false if can't save file */ +/*! returns false if can't save file */ bool SUIT_FileValidator::canSave( const QString& file ) { if ( QFile::exists( file ) ) { diff --git a/src/SUIT/SUIT_FileValidator.h b/src/SUIT/SUIT_FileValidator.h index dfc96c88f..ecba9f2c7 100755 --- a/src/SUIT/SUIT_FileValidator.h +++ b/src/SUIT/SUIT_FileValidator.h @@ -23,9 +23,11 @@ public: virtual bool canOpen( const QString& file ); virtual bool canSave( const QString& file ); + //! Return parent widget QWidget* parent() const { return myParent; } private: + QWidget* myParent; }; diff --git a/src/SUIT/SUIT_MessageBox.h b/src/SUIT/SUIT_MessageBox.h index 4ed62f821..96ef29b0a 100755 --- a/src/SUIT/SUIT_MessageBox.h +++ b/src/SUIT/SUIT_MessageBox.h @@ -21,15 +21,19 @@ class SUIT_EXPORT SUIT_MessageBox { public: - /* show a box with one button */ + + /** @name One button message boxes.*/ + //@{ static int info1 ( QWidget* parent, const QString& caption, const QString& text, const QString& textButton0 ); static int warn1 ( QWidget* parent, const QString& caption, const QString& text, const QString& textButton0 ); static int error1 ( QWidget* parent, const QString& caption, const QString& text, const QString& textButton0 ); + //@} - /* show a box with two buttons */ + /** @name Two buttons message boxes.*/ + //@{ static int info2 ( QWidget* parent, const QString& caption, const QString& text, const QString& textButton0, const QString& textButton1, int idButton0, int idButton1, int idDefault ); @@ -39,8 +43,10 @@ public: static int error2 ( QWidget* parent, const QString& caption, const QString& text, const QString& textButton0, const QString& textButton1, int idButton0, int idButton1, int idDefault ); + //@} - /* show a box with three buttons */ + /** @name Three buttons message boxes.*/ + //@{ static int info3 ( QWidget* parent, const QString& caption, const QString& text, const QString& textButton0, const QString& textButton1, const QString& textButton2, int idButton0, int idButton1, @@ -53,6 +59,7 @@ public: const QString& textButton0, const QString& textButton1, const QString& textButton2, int idButton0, int idButton1, int idButton2, int idDefault ); + //@} }; #endif diff --git a/src/SUIT/SUIT_Tools.h b/src/SUIT/SUIT_Tools.h index c568d4165..ec7c4c898 100755 --- a/src/SUIT/SUIT_Tools.h +++ b/src/SUIT/SUIT_Tools.h @@ -10,7 +10,7 @@ #include #include /*! \class Qtx - * \brief For more documentation see QT documentation. + * For more information see QT documentation. */ class SUIT_EXPORT SUIT_Tools : public Qtx { -- 2.39.2