diff options
author | Mike Krus <mike.krus@kdab.com> | 2017-07-24 17:26:58 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2017-07-26 15:29:29 +0000 |
commit | 70f0d06b30d55fa9b79c79af2ca60ab7ab7c2a9a (patch) | |
tree | c6652641f0cc64a853c1390cd62c25ba323cb34e /tests | |
parent | 01cb9bf3923101bcae3d9b122ae0343af4f2a1c7 (diff) | |
download | qtivi-70f0d06b30d55fa9b79c79af2ca60ab7ab7c2a9a.tar.gz |
Add ability to override interface creation
Add a “interfaceBuilder” annotation which should be a function that
returns a list of interface instances. Instanced should be created
in the same order as interface ids are defined.
Change-Id: Ie1fd7575c8cb79125d02583ed99d71dd3417de49
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'tests')
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/core/ivigenerator/org.example.echo.qface b/tests/auto/core/ivigenerator/org.example.echo.qface index 3419558..f9db973 100644 --- a/tests/auto/core/ivigenerator/org.example.echo.qface +++ b/tests/auto/core/ivigenerator/org.example.echo.qface @@ -1,6 +1,7 @@ /** * module */ +@config: { interfaceBuilder: "echoInterfaceBuilder" } module org.example.echo 1.0 /** diff --git a/tests/auto/core/ivigenerator/projects/org-example-echo/backend_simulator/backend_simulator.cpp b/tests/auto/core/ivigenerator/projects/org-example-echo/backend_simulator/backend_simulator.cpp new file mode 100644 index 0000000..f0dca77 --- /dev/null +++ b/tests/auto/core/ivigenerator/projects/org-example-echo/backend_simulator/backend_simulator.cpp @@ -0,0 +1,15 @@ +#include "echobackend.h" +#include "echozonedbackend.h" +#include "echoplugin.h" + +QT_BEGIN_NAMESPACE + +extern QVector<QIviFeatureInterface *> echoInterfaceBuilder(EchoPlugin *plugin) +{ + QVector<QIviFeatureInterface *> res; + res << new EchoBackend(plugin); + res << new EchoZonedBackend(plugin); + return res; +} + +QT_END_NAMESPACE diff --git a/tests/auto/core/ivigenerator/projects/org-example-echo/backend_simulator/backend_simulator.pro b/tests/auto/core/ivigenerator/projects/org-example-echo/backend_simulator/backend_simulator.pro index 554896a..e1bdc6d 100644 --- a/tests/auto/core/ivigenerator/projects/org-example-echo/backend_simulator/backend_simulator.pro +++ b/tests/auto/core/ivigenerator/projects/org-example-echo/backend_simulator/backend_simulator.pro @@ -14,3 +14,5 @@ QT += core ivicore QFACE_FORMAT = backend_simulator QFACE_SOURCES = ../../../org.example.echo.qface + +SOURCES += backend_simulator.cpp |