diff options
Diffstat (limited to 'framework/actions/context.cpp')
-rw-r--r-- | framework/actions/context.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/framework/actions/context.cpp b/framework/actions/context.cpp index 205b1606..8f370a0b 100644 --- a/framework/actions/context.cpp +++ b/framework/actions/context.cpp | |||
@@ -29,10 +29,22 @@ Context::Context(QObject *parent) | |||
29 | 29 | ||
30 | } | 30 | } |
31 | 31 | ||
32 | void Context::clear() | ||
33 | { | ||
34 | auto meta = metaObject(); | ||
35 | for (auto i = meta->propertyOffset(); i < meta->propertyCount(); i++) { | ||
36 | auto property = meta->property(i); | ||
37 | setProperty(property.name(), QVariant()); | ||
38 | } | ||
39 | for (const auto &p : dynamicPropertyNames()) { | ||
40 | setProperty(p, QVariant()); | ||
41 | } | ||
42 | } | ||
43 | |||
32 | QDebug operator<<(QDebug dbg, const Kube::Context &context) | 44 | QDebug operator<<(QDebug dbg, const Kube::Context &context) |
33 | { | 45 | { |
34 | dbg << "Kube::Context {\n"; | 46 | dbg << "Kube::Context {\n"; |
35 | auto metaObject = context.QObject::metaObject(); | 47 | auto metaObject = context.metaObject(); |
36 | for (auto i = metaObject->propertyOffset(); i < metaObject->propertyCount(); i++) { | 48 | for (auto i = metaObject->propertyOffset(); i < metaObject->propertyCount(); i++) { |
37 | auto property = metaObject->property(i); | 49 | auto property = metaObject->property(i); |
38 | dbg << property.name() << context.property(property.name()) << "\n"; | 50 | dbg << property.name() << context.property(property.name()) << "\n"; |