diff --git a/src/App/Property.cpp b/src/App/Property.cpp
index 35590a20a6..a53e4c95c0 100644
--- a/src/App/Property.cpp
+++ b/src/App/Property.cpp
@@ -32,6 +32,7 @@
#include "ObjectIdentifier.h"
#include "PropertyContainer.h"
#include
+#include "Application.h"
using namespace App;
@@ -110,6 +111,14 @@ void Property::touch()
StatusBits.set(0);
}
+void Property::setReadOnly(bool readOnly)
+{
+ unsigned long status = this->getStatus();
+ this->setStatus(App::Property::ReadOnly, readOnly);
+ if (status != this->getStatus())
+ App::GetApplication().signalChangePropertyEditor(*this);
+}
+
void Property::hasSetValue(void)
{
if (father)
diff --git a/src/App/Property.h b/src/App/Property.h
index 79a1e21f7d..43a1bbe912 100644
--- a/src/App/Property.h
+++ b/src/App/Property.h
@@ -27,11 +27,11 @@
// Std. configurations
#include
-#ifndef BOOST_105400
-#include
-#else
-#include
-#endif
+#ifndef BOOST_105400
+#include
+#else
+#include
+#endif
#include
#include
@@ -138,6 +138,11 @@ public:
inline void setStatus(Status pos, bool on) {
StatusBits.set(static_cast(pos), on);
}
+ ///Sets property editable/grayed out in property editor
+ void setReadOnly(bool readOnly);
+ inline bool isReadOnly() const {
+ return testStatus(App::Property::ReadOnly);
+ }
//@}
/// Returns a new copy of the property (mainly for Undo/Redo and transactions)
@@ -248,4 +253,4 @@ private:
} // namespace App
-#endif // APP_PROPERTY_H
+#endif // APP_PROPERTY_H