On Thu, Sep 2, 2010 at 5:30 PM, Martin Jones <[email protected]> wrote:
> On Fri, 3 Sep 2010 07:37:17 am ext Alex wrote:
>> Hi all,
>>
>> I have several QML screens managed by a C++ application.  In some
>> cases, I need to reload a QML screen, in response to a signal emitted
>> from that screen.

>> What is the correct way to do this?
>
> You could create a different slot for the QML call that calls the actual
> reload slot asynchronously:
>
> void MyClass::reload()
> {
>        QMetaObject::invokeMethod(this, "doReload", Qt::QueuedConnection);
> }
>
> void MyClass::doReload()
> {
>        currentView->setSource(currentView->source());
> }
>
>
> I'll investigate using deleteLater() instead so that this isn't a problem in
> future.
>

Thanks, Martin.  That works great!

Alex

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to