[Interest] Having two QDeclerativeContexts , setSource of one through the other?

Sivan Greenberg sivan at omniqueue.com
Mon May 14 11:06:31 CEST 2012


On Mon, May 14, 2012 at 10:05 AM,  <kai.koehne at nokia.com> wrote:
>> In turn, necessitates reloading them by the user code, or alternatively - Can I
>> save the import list off the running App UX QDecelerativeContext  - and
>> reload them into the context myself, before the user's code is expecting to
>> find them when run again after the reload?
>
> Not sure what you mean by 'import list' - QML_PLUGIN_PATH?

Ah no sorry, I got confused- I thought that I'll need to take care of
re-executing the 'import' statements appearing in the QML code itself,
but it is now obvious to me that you just need to take care of state
(either of plugins / qml objects) since the rest will happen by
itself.

>
> In one case the .qml files load some plugins (that might be implemented in C++), and create objects from the plugins. In the other one the context of the app + backend is set up in main.cpp, and then the main.qml file is loaded ... It's about the entry point: Is your main executable defining the backend / logic, and loads QML that accesses the backend, or is the main.cpp just a generic runner (like qmlviewer/qmlscene) that loads any kind of .qml , which then again might load some C++ plugins? Both is possible.
>

I aim to provide this functionality: Allow a developer to use the
feedback system that will provide:
1) transparent way for the developed app to have its QML replaced in
run time (I will take a look at that QML 'reload' feature).
2) Allow the user to rate it on a scale and add a short text feedback.

To make life easy for the developer, I'd like to enable usage through:
1) The generic runner which I saw most apps use (presumably this would
be a C++ lib+interface). Being auto created through Qt Creator,
developer can choose when starting the project "Add CrowdQuick
support" and specify some required parameters (like server for data
collected data storage, etc),
2) 'pure' QML code- in which the developer is expected to just 'import
CrowdQuick 1.0' or so and define the setup parameters through Item
properties.
3) (quite in later stage) Arbitrary C++ code such that non QML code
can enable feedback. The feedback system will use QML for its UI
anyways.

In any of the cases I don't want to obtruse the user's code and other
than restarting the app when QML is replaced in a production app, make
it effortless otherwise to use.

>> Thank you for your elaborate replies!
>
> NP. A colleague of mine is actually right now looking into implementing QML 'reloading' functionality in the context of the QML Debugger: https://codereview.qt-project.org/#change,26028 , https://codereview.qt-project.org/#change,26026 .
>
I'll look into it, perhaps I can contribute something.

-Sivan



More information about the Interest mailing list