1 // Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "QDS_TextEdit.h"
21 #include <qtextedit.h>
26 Datum with control corresponding to text edit. User can enter parameter value in multiple line editor.
30 Constructor. Create text edit datum object with datum identifier \aid under widget \aparent.
31 Parameter \aflags define behaviour of datum and set of created subwidgets. Default value of this
32 parameter is QDS::All. Parameter \acomp specify the component name which will be used during search
35 QDS_TextEdit::QDS_TextEdit( const QString& id, QWidget* parent, const int flags, const QString& comp )
36 : QDS_Datum( id, parent, flags, comp )
43 QDS_TextEdit::~QDS_TextEdit()
48 Returns string from QTextEdit widget. Reimplemented from QDS_Datum.
50 QString QDS_TextEdit::getString() const
54 res = textEdit()->text();
59 Sets the string into QTextEdit widget. Reimplemented from QDS_Datum.
61 void QDS_TextEdit::setString( const QString& txt )
64 textEdit()->setText( txt );
68 Returns pointer to QTextEdit widget.
70 QTextEdit* QDS_TextEdit::textEdit() const
72 return ::qt_cast<QTextEdit*>( controlWidget() );
76 Create QTextEdit widget as control subwidget.
78 QWidget* QDS_TextEdit::createControl( QWidget* parent )
80 QTextEdit* te = new QTextEdit( parent );
81 connect( te, SIGNAL( textChanged() ), this, SLOT( onTextChanged() ) );
86 Notify about text changing in text edit.
88 void QDS_TextEdit::onTextChanged()
94 QString str = getString();
97 emit paramChanged( str );