diff options
author | Dominik Holland <dominik.holland@qt.io> | 2020-03-18 09:48:09 +0100 |
---|---|---|
committer | Dominik Holland <dominik.holland@qt.io> | 2020-03-23 09:24:13 +0100 |
commit | 4bc23304fc8a316e07eccbd3327a0af76aeb8954 (patch) | |
tree | 2d24c71e38c069666a4aaa591e60b1c16d969d13 | |
parent | a2cd7d67cdb3589ecb2522a5ba37f6c2bbcbbc93 (diff) | |
download | qtivi-4bc23304fc8a316e07eccbd3327a0af76aeb8954.tar.gz |
ivigenerator: Fix generation error with zoned default values
With zoned default values we cannot initialize the member variables
of the autogenerated class anymore. Instead of doing that, we now
initialize the members using the default_type_value() filter.
We now rely on the provided QML simulation and initializeDefault()
as this does also the correct parsing of zoned default values.
Change-Id: I810485721bc9535eaa8838ba1b773a80d8758725
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
-rw-r--r-- | src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl b/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl index 9ee929e..4c146e1 100644 --- a/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl +++ b/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl @@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE , m_{{ property }}(new {{property|upperfirst}}ModelBackend(this)); {% endif %} {% else %} - , m_{{ property }}({{property|default_value}}) + , m_{{ property }}({{property|default_type_value}}) {% endif %} {% endfor %} { @@ -103,7 +103,7 @@ QT_BEGIN_NAMESPACE : {{class}}Interface(parent) {% for property in interface.properties %} {% if not property.type.is_model %} - , m_{{ property }}({{property|default_value}}) + , m_{{ property }}({{property|default_type_value}}) {% endif %} {% endfor %} {% if interface_zoned %} @@ -198,7 +198,7 @@ void {{class}}::addZone(const QString &zone) return zo->{{property|getter_name}}(); else qWarning() << "No such Zone"; - return {{property|default_value}}; + return {{property|default_type_value}}; } {% else %} {{ivi.prop_getter(property, class, model_interface = true)}} @@ -257,7 +257,7 @@ void {{class}}::addZone(const QString &zone) Q_UNUSED(zone); {% endif %} - qWarning() << "Not implemented!"; + qWarning() << "{{operation}}: Not implemented!"; //Fake that the reply always succeeded QIviPendingReply<{{operation|return_type}}> successReply; |