[Qt-qml] Setting the source with a click on QML component

Girish Ramakrishnan girish at forwardbias.in
Mon Oct 3 05:11:32 CEST 2011


Hi,
On Mon, Oct 3, 2011 at 8:03 AM, Bartosh Wroblevksy <bartosh at live.com> wrote:
>> It sounds like the problem is that you're deleting the QML scene while in
>> the
>> middle of the signal handler.
> Yes exactly that was the problem. And adding a timer to delay the slot is
> another good tip. In the end, we went with a top-level Loader item in the
> qml file and a C++ method (doit()) that changes the source property. This
> C++ method is triggered by a signal. Do you see any possible dangers in
> this?

One advantage of the loader approach is that you can animate between
the two sources i.e you can slide out the old QML and slide in the QML
etc (using multiple loaders, for example).

Girish


More information about the Qt-qml mailing list