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/
19 #include "QDS_TextEdit.h"
21 #include <qtextedit.h>
26 QDS_TextEdit::QDS_TextEdit( const QString& id, QWidget* parent, const int flags, const QString& comp )
27 : QDS_Datum( id, parent, flags, comp )
34 QDS_TextEdit::~QDS_TextEdit()
39 Returns string from QTextEdit widget.
41 QString QDS_TextEdit::getString() const
45 res = textEdit()->text();
50 Sets the string into QTextEdit widget.
52 void QDS_TextEdit::setString( const QString& txt )
55 textEdit()->setText( txt );
59 Returns pointer to QTextEdit widget.
61 QTextEdit* QDS_TextEdit::textEdit() const
63 return ::qt_cast<QTextEdit*>( controlWidget() );
67 Create QTextEdit widget as control subwidget.
69 QWidget* QDS_TextEdit::createControl( QWidget* parent )
71 QTextEdit* te = new QTextEdit( parent );
72 connect( te, SIGNAL( textChanged() ), this, SLOT( onTextChanged() ) );
77 Notify about text changing in line edit.
79 void QDS_TextEdit::onTextChanged()
85 QString str = getString();
88 emit paramChanged( str );