Salome HOME
0054504: Exception when accessing VTK renderer with libSalomePy module
[modules/gui.git] / src / QDS / QDS_TextEdit.cxx
index 65fbcb28ec926a0a7a56303c3c717913bcee9819..898d3b3fa7ac837b4b187d8478243ccd4546ed8f 100644 (file)
@@ -1,9 +1,52 @@
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 #include "QDS_TextEdit.h"
 
-#include <qtextedit.h>
+#include <QTextEdit>
+
+/*
+  \class QDS_TextEdit
+  \brief Datum with control corresponding to the text edit. 
+
+  User can enter parameter value in multi line editor.
+*/
 
 /*!
-  Constructor.
+  \brief Constructor. 
+
+  Create combobox datum object with datum identifier \a id 
+  and parent widget \a parent. 
+
+  Parameter \a flags defines behaviour of datum and set of created
+  subwidgets. Default value of this parameter is QDS::All.
+
+  Parameter \a comp specifies the component name which will be used
+  when searching the dictionary item.
+
+  \param id datum identifier
+  \param parent parent widget
+  \param flags datum flags
+  \param comp component
 */
 QDS_TextEdit::QDS_TextEdit( const QString& id, QWidget* parent, const int flags, const QString& comp )
 : QDS_Datum( id, parent, flags, comp )
@@ -11,25 +54,27 @@ QDS_TextEdit::QDS_TextEdit( const QString& id, QWidget* parent, const int flags,
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_TextEdit::~QDS_TextEdit()
 {
 }
 
 /*!
-  Returns string from QTextEdit widget.
+  \brief Get string value from datum.
+  \return datum string value
 */
 QString QDS_TextEdit::getString() const
 {
   QString res;
   if ( textEdit() )
-    res = textEdit()->text();
+    res = textEdit()->toPlainText();
   return res;
 }
 
 /*!
-  Sets the string into QTextEdit widget.
+  \brief Set string value to datum.
+  \param txt new datum string value
 */
 void QDS_TextEdit::setString( const QString& txt )
 {
@@ -38,15 +83,18 @@ void QDS_TextEdit::setString( const QString& txt )
 }
 
 /*!
-  Returns pointer to QTextEdit widget.
+  \brief Get text edit widget.
+  \return internaltext edit widget
 */
 QTextEdit* QDS_TextEdit::textEdit() const
 {
-  return ::qt_cast<QTextEdit*>( controlWidget() );
+  return ::qobject_cast<QTextEdit*>( controlWidget() );
 }
 
 /*!
-  Create QTextEdit widget as control subwidget.
+  \brief Create text edit widget as control subwidget.
+  \param parent parent widget
+  \return created text edit widget
 */
 QWidget* QDS_TextEdit::createControl( QWidget* parent )
 {
@@ -56,7 +104,9 @@ QWidget* QDS_TextEdit::createControl( QWidget* parent )
 }
 
 /*!
-  Notify about text changing in line edit.
+  \brief Called when text is changed by the user.
+
+  Notify about text changing in text edit.
 */
 void QDS_TextEdit::onTextChanged()
 {
@@ -69,3 +119,8 @@ void QDS_TextEdit::onTextChanged()
   emit paramChanged();
   emit paramChanged( str );
 }
+
+/*!
+  \fn void QDS_TextEdit::returnPressed();
+  \brief The signal is emitted when user presses \c Enter key in the text edit.
+*/