Hiya, I have a QObject (c++) that sends a signal to the qml engine. A qml Connections() element receives the signal and in turn calls a slot in a custom QDeclarativeItem.
Everything is running in the same (main) thread. I thought that the above scenario would behave like a direct connection; as if I was directly invoking the QDeclarativeItem's slot through a function call. This doesn't seem to be the case though. Instead, it looks like the c++ code just returns immediately after emitting the signal: QTimerElapsed m_timer; m_timer.start(); ... void SomeQObject::someFunction { qint64 time_before = m_timer.elapsed(); emit signalReceivedByQmlEngine(); qint64 time_after = m_timer.elapsed(); } time_before always == time_after. If I time how long it takes for the QDeclarativeItem's slot to complete, I see it takes several ms. I'm on Linux, so timing resolution shouldn't be a problem... and just to be sure, I repeated the timing tests with system timers as well [us resolution] with the same results. SomeQObject::someFunction returns immediately, but the QDeclarativeItem's slot takes a measurable amount of time to complete. Could someone please explain the underlying behavior here?
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest