aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-04 03:05:03 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-04 03:05:04 +0200
commitb96abbc0ee6afe25f5651bacc277bb712a243f79 (patch)
treecc97ae52d1ecec282d66b50005253a404afc682d
parentaaba53a9bf90784e2dc00351c554fbab34ecb778 (diff)
parentc1eb0c8c62409a10ad1893a406aba07451b473e2 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
-rw-r--r--.qmake.conf2
-rw-r--r--src/ivicore/configure.json2
-rw-r--r--src/ivimedia/configure.json3
-rw-r--r--src/tools/ivigenerator/generator/filters.py30
-rw-r--r--src/tools/ivigenerator/templates/backend_qtro/backend.cpp.tpl2
-rw-r--r--src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl9
-rw-r--r--tests/auto/core/ivigenerator/org.example.echo.yaml47
-rw-r--r--tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp4
-rw-r--r--tests/auto/core/qivisimulationengine/tst_qivisimulationengine.cpp2
9 files changed, 72 insertions, 29 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 6e535a8..4f5640d 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -7,6 +7,6 @@ DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST
QMAKEFEATURES=$$PWD/mkspecs/features
-MODULE_VERSION = 5.14.0
+MODULE_VERSION = 5.14.2
!win32: CONFIG += ivi-coverage
diff --git a/src/ivicore/configure.json b/src/ivicore/configure.json
index 6698d98..7bc153c 100644
--- a/src/ivicore/configure.json
+++ b/src/ivicore/configure.json
@@ -88,7 +88,7 @@
"report": [
{
"type": "error",
- "condition": "!features.ivigenerator && input.ivigenerator != 'no'",
+ "condition": "features.ivicore && !features.ivigenerator && input.ivigenerator != 'no'",
"message": "Cannot build the IVI Generator because its dependencies are not satisfied.
The IVI Generator provides tooling to generate source code out of IDL files.
Make sure python3 and its 'virtualenv' packages are installed.
diff --git a/src/ivimedia/configure.json b/src/ivimedia/configure.json
index 33265db..46dc233 100644
--- a/src/ivimedia/configure.json
+++ b/src/ivimedia/configure.json
@@ -53,11 +53,12 @@
},
"tuner_simulation_backend": {
"label": "Tuner Simulation Backend",
+ "condition": "module.multimedia",
"output": [ "privateFeature" ]
},
"media_qtro_backend" : {
"label": "Mediaplayer Qt Remote Objects Backend",
- "condition": "features.remoteobjects",
+ "condition": "features.remoteobjects && module.multimedia",
"output": [ "privateFeature" ]
},
"media_qtro_simulation_server" : {
diff --git a/src/tools/ivigenerator/generator/filters.py b/src/tools/ivigenerator/generator/filters.py
index 737143c..7e7c3d5 100644
--- a/src/tools/ivigenerator/generator/filters.py
+++ b/src/tools/ivigenerator/generator/filters.py
@@ -167,17 +167,17 @@ def default_value_helper(symbol, res):
t = symbol.type
if t.is_struct:
if not (isinstance(res, dict) or isinstance(res, list)):
- jinja_error('default_value: value in annotation is supposed to be a dict or list')
+ jinja_error('default_value: value in annotation for symbol {0} is supposed to be a dict or list'.format(symbol.qualified_name))
if len(res) != len(t.reference.fields):
- jinja_error('default_value: argument count in annotation and number of struct fields '
- 'does not match')
+ jinja_error('default_value: argument count in annotation for symbol {0} and number of struct fields '
+ 'does not match: Expected {1} instead of {2}'.format(symbol.qualified_name, len(t.reference.fields), len(res)))
values = []
for idx, property in enumerate(res):
values.append(default_value_helper(list(t.reference.fields)[idx], property))
return '{0}({{{1}}})'.format(t.type, ', '.join(values))
if t.is_model or t.is_list:
if not isinstance(res, list):
- jinja_error('default_value: value in annotation is supposed to be a list')
+ jinja_error('default_value: value in annotation for symbol {0} is supposed to be a list'.format(symbol.qualified_name))
row_string = ''
if t.nested.is_struct and t.is_list:
row_string = ', '.join(('QVariant::fromValue({0})'.format(default_value_helper(t.nested, row))) for row in res)
@@ -437,8 +437,19 @@ def simulationData(module):
and p in property.tags['config_simulator']):
if property.name not in iData:
iData[property.name] = {}
- iData[property.name][p] = symbolToJson(property.tags['config_simulator'][p],
- property.type)
+ if p not in iData[property.name]:
+ iData[property.name][p] = {}
+ zones = iData.get('zones', None)
+ res = property.tags['config_simulator'][p]
+ if isinstance(res, dict) and zones:
+ for zone in zones:
+ if zone in res:
+ iData[property.name][p][zone] = symbolToJson(res[zone], property.type)
+ # Also check the entry for the general zone (=)
+ if "=" in res:
+ iData[property.name][p]["="] = symbolToJson(res["="], property.type)
+ else:
+ iData[property.name][p] = symbolToJson(res, property.type)
data[interface.name] = iData
return json.dumps(data, indent=' ')
@@ -447,10 +458,11 @@ def symbolToJson(data, symbol):
if symbol.type.is_struct:
t = symbol.type
if not (isinstance(data, dict) or isinstance(data, list)):
- jinja_error('simulationData: value in annotation is supposed to be a dict or list')
+ jinja_error('simulationData: value in annotation for symbol {0} is supposed to be a dict or list'.format(symbol.qualified_name))
if len(data) != len(t.reference.fields):
- jinja_error('simulationData: argument count in annotation and number of struct fields '
- 'does not match')
+ print(len(data), len(t.reference.fields))
+ jinja_error('simulationData: argument count in annotation for symbol {0} and number of struct fields '
+ 'does not match: Expected {1} instead of {2}'.format(symbol.qualified_name, len(t.reference.fields), len(data)))
newList = list(symbolToJson(property, list(t.reference.fields)[idx]) for idx, property in enumerate(data))
return {"type": symbol.type.name, "value": newList}
elif symbol.type.is_enum or symbol.type.is_flag:
diff --git a/src/tools/ivigenerator/templates/backend_qtro/backend.cpp.tpl b/src/tools/ivigenerator/templates/backend_qtro/backend.cpp.tpl
index 5a46282..cf9aebc 100644
--- a/src/tools/ivigenerator/templates/backend_qtro/backend.cpp.tpl
+++ b/src/tools/ivigenerator/templates/backend_qtro/backend.cpp.tpl
@@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE
{% if property.type.is_model %}
, m_{{property}}(new Zoned{{property|upperfirst}}ModelBackend(QStringLiteral("{{interface.qualified_name}}.{{property}}.") + m_zone, this))
{% else %}
- , m_{{ property }}({{property|default_value}})
+ , m_{{ property }}({{property|default_type_value}})
{% endif %}
{% endfor %}
{
diff --git a/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl b/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl
index 4c146e1..f8f2cd7 100644
--- a/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl
+++ b/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl
@@ -149,6 +149,12 @@ QStringList {{class}}::availableZones() const
void {{class}}::initialize()
{
+{% if interface.tags.config.zoned %}
+ // To initialize the default values all zone objects need to be created. For zoned backends
+ // the availableZones() method is responsible for that, just make sure this is called before
+ // initialize to have them created before.
+ availableZones();
+{% endif %}
QIVI_SIMULATION_TRY_CALL({{class}}, "initialize", void);
{% for property in interface.properties %}
{% if not interface_zoned %}
@@ -173,7 +179,8 @@ void {{class}}::initialize()
{% if interface_zoned %}
void {{class}}::addZone(const QString &zone)
{
- m_zones->insert(zone, QVariant::fromValue(new {{zone_class}}(zone, this)));
+ if (!m_zones->contains(zone))
+ m_zones->insert(zone, QVariant::fromValue(new {{zone_class}}(zone, this)));
}
{{zone_class}}* {{class}}::zoneAt(const QString &zone)
diff --git a/tests/auto/core/ivigenerator/org.example.echo.yaml b/tests/auto/core/ivigenerator/org.example.echo.yaml
index 10953f0..d1750bf 100644
--- a/tests/auto/core/ivigenerator/org.example.echo.yaml
+++ b/tests/auto/core/ivigenerator/org.example.echo.yaml
@@ -1,15 +1,47 @@
+org.example.echo.EchoZoned#stringValue:
+ config_simulator:
+ default: "two"
+
+org.example.echo.Echo#intValue:
+ config_simulator:
+ default_value: 61
+ range_high: 150
+ range_low: 0
+
+org.example.echo.Echo#contact:
+ config_simulator:
+ zoned: true
+ default: [ "foo", 23, true, 1234 ]
+
+org.example.echo.Echo#combo:
+ config_simulator:
+ zoned: true
+ default: [ [ "foo", 23, true, 1234 ], WeekDay.Monday ]
+
+org.example.echo.Echo#intList:
+ config_simulator:
+ default: [1, 2, 3, 4]
+
+org.example.echo.Echo#comboList:
+ config_simulator:
+ default: [[ [ "foo", 23, true, 1234 ], WeekDay.Monday ], [ [ "bar", 21, false, "foo" ], WeekDay.Tuesday ]]
+
+org.example.echo.Echo#contactList:
+ config_simulator:
+ default: [[ "foo", 23, true, WeekDay.Monday ], [ "bar", 12, false, false ]]
+
org.example.echo.EchoZoned:
config_simulator:
zones: [ FrontLeft, FrontRight, Rear ]
org.example.echo.EchoZoned#stringValue:
config_simulator:
- default: "two"
+ default: { FrontLeft: "two", Rear: "one", =: "general" }
org.example.echo.EchoZoned#intValue:
config_simulator:
default: 11
- range: [10, 33]
+ range: { FrontLeft: [10, 33], Rear: [0, 11] }
org.example.echo.EchoZoned#zonedValue:
config_simulator:
@@ -35,16 +67,10 @@ org.example.echo.EchoZoned#rangedValueWithDefault:
range_high: 150
range_low: 0
-org.example.echo.Echo#intValue:
- config_simulator:
- default_value: 61
- range_high: 150
- range_low: 0
-
org.example.echo.EchoZoned#contact:
config_simulator:
zoned: true
- default: [ "foo", 23, true, 1234 ]
+ default: { FrontLeft: [ "foo", 23, true, 1234 ], Rear: [ "bar", 1, false, 3456 ] }
org.example.echo.EchoZoned#combo:
config_simulator:
@@ -59,6 +85,3 @@ org.example.echo.EchoZoned#comboList:
config_simulator:
default: [[ [ "foo", 23, true, 1234 ], WeekDay.Monday ], [ [ "bar", 21, false, "foo" ], WeekDay.Tuesday ]]
-org.example.echo.Echo#contactList:
- config_simulator:
- default: [[ "foo", 23, true, WeekDay.Monday ], [ "bar", 12, false, false ]]
diff --git a/tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp b/tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp
index 5f0bb73..542ea00 100644
--- a/tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp
+++ b/tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp
@@ -284,8 +284,8 @@ template <typename T> void tst_QIviPendingReply::qml_helper(TestObject *testObje
QCOMPARE(obj->property("replySuccess").toBool(), false);
QCOMPARE(obj->property("replyResultAvailable").toBool(), false);
- //Wait until the reply is ready
- QTest::qWait(100);
+ QSignalSpy spy(obj.data(), SIGNAL(callBackCalledChanged()));
+ spy.wait(1000);
QVERIFY(obj->property("callBackCalled").toBool());
QCOMPARE(obj->property("success").toBool(), !failed);
diff --git a/tests/auto/core/qivisimulationengine/tst_qivisimulationengine.cpp b/tests/auto/core/qivisimulationengine/tst_qivisimulationengine.cpp
index 79e149a..4edffc4 100644
--- a/tests/auto/core/qivisimulationengine/tst_qivisimulationengine.cpp
+++ b/tests/auto/core/qivisimulationengine/tst_qivisimulationengine.cpp
@@ -661,7 +661,7 @@ void tst_QIviSimulationEngine::testAnimations()
QCOMPARE(obj->property("propertyInBase"), 130);
//we expect at least 2 animation steps (intermediate step and final step)
- QVERIFY2(spy.count() > 2, qPrintable(QStringLiteral("Emitted signals: ") + QString::number(spy.count())));
+ QVERIFY2(spy.count() >= 2, qPrintable(QStringLiteral("Emitted signals: ") + QString::number(spy.count())));
}
void tst_QIviSimulationEngine::testFunctionCalls_data()