summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2008-08-20 08:04:57 +0000
committerdeva <deva>2008-08-20 08:04:57 +0000
commit45702265ce206381bcb02a53b413ad987897b02b (patch)
treeaa0a77c66a1538c6f88944827d31fbf6d81643f0
parent4be53ad09b924cfc1f5e72cea0ac92c184ce5d45 (diff)
Added 'readonly' property to lineedit.
-rw-r--r--client/widgets/lineedit.cc10
-rw-r--r--design/widgets/lineedit.tex2
2 files changed, 12 insertions, 0 deletions
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()));
diff --git a/design/widgets/lineedit.tex b/design/widgets/lineedit.tex
index cec5214..09876e3 100644
--- a/design/widgets/lineedit.tex
+++ b/design/widgets/lineedit.tex
@@ -13,4 +13,6 @@ En lineedit har flg. attributter:
validere feltet. Hvis udeladt accepterer feltet alle inputs. Læs
mere om de regulære udtryk her:
\verb|http://doc.trolltech.com/4.3/qregexp.html#introduction|
+\item \textit{readonly} - Beskriver om feltet er skrivebeskyttet.
+ Hvis værdien er udeladt vil lineeditten kunne ændres af brugeren.
\end{itemize}