From 45702265ce206381bcb02a53b413ad987897b02b Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 20 Aug 2008 08:04:57 +0000 Subject: Added 'readonly' property to lineedit. --- client/widgets/lineedit.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'client/widgets') diff --git a/client/widgets/lineedit.cc b/client/widgets/lineedit.cc index 69073ce..6decbab 100644 --- a/client/widgets/lineedit.cc +++ b/client/widgets/lineedit.cc @@ -39,6 +39,16 @@ LineEdit::LineEdit(QDomNode &node, MacroWindow *macrowindow) if(elem.hasAttribute("height")) { setMinimumHeight(elem.attribute("height").toInt()); } + + if(elem.hasAttribute("readonly")) { + if(elem.attribute("readonly") == "true" || elem.attribute("readonly") == "1") { + setReadOnly(true); + } else if(elem.attribute("readonly") == "false" || elem.attribute("readonly") == "0") { + setReadOnly(false); + } else { + printf("Unknown value of readonly: %s\n", elem.attribute("readonly").toStdString().c_str()); + } + } connect(this, SIGNAL(textChanged(QString)), this, SLOT(changed())); -- cgit v1.2.3