Skip to content

Commit 023b4cf

Browse files
3nidsm-kuhn
authored andcommitted
[edit widgets] set line edit as read-only instead of disabled
1 parent a3447dd commit 023b4cf

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/gui/editorwidgets/qgstexteditwidget.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,15 @@ void QgsTextEditWidget::setValue( const QVariant& value )
129129
if ( mLineEdit )
130130
mLineEdit->setText( v );
131131
}
132+
133+
void QgsTextEditWidget::setEnabled( bool enabled )
134+
{
135+
if ( mTextEdit )
136+
mTextEdit->setReadOnly( !enabled );
137+
138+
if ( mPlainTextEdit )
139+
mPlainTextEdit->setReadOnly( !enabled );
140+
141+
if ( mLineEdit )
142+
mLineEdit->setReadOnly( !enabled );
143+
}

src/gui/editorwidgets/qgstexteditwidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class GUI_EXPORT QgsTextEditWidget : public QgsEditorWidgetWrapper
3838

3939
public slots:
4040
void setValue( const QVariant& value );
41+
void setEnabled( bool enabled );
4142

4243
private:
4344
QTextEdit* mTextEdit;

0 commit comments

Comments
 (0)