Qt-interest Archive, August 2007
Cant set QTextEdit to setEnable(false)
Message 1 in thread
I am having a problem with QT4.3.0 setEnabled(false) with QTextEdit.
The snippet of code is of a class constructor showing the problem.
Everything compiles AOK. When it runs 'labComment' is greyed out (as
expected), but the text in QTextEdit is never greyed out - I have
tried everything I can think of but I cannot disable this widget.
Any ideas what I am doing wrong ?
Cheers
Dave
// comment
labComment = new QLabel(i18n("Co&mment:"), page);
labComment->setObjectName("labComment");
layout->addWidget(labComment, 3, 0, Qt::AlignLeft | Qt::AlignTop);
teComment = new QTextEdit(page);
layout->addWidget(teComment, 3, 1, 1, 2);
labComment->setBuddy(teComment);
// set starting field values
cmbVariable->setEditText(QString::fromLocal8Bit(ctvar->variable.c_str()));
leValue->setText(QString::fromLocal8Bit(ctvar->value.c_str()));
teComment->setPlainText(QString::fromLocal8Bit(ctvar->comment.c_str()));
chkEnabled->setChecked(ctvar->enabled);
cmbVariable->setFocus();
labComment->setEnabled(false);
teComment->setEnabled(false);
--
[ signature omitted ]
Message 2 in thread
Having discussed it on IRC discoverd that its a style issue, the
true/false flag allows/inhibits editing but the style means they look
the same !
Cheers
Dave
--
[ signature omitted ]