How to debug lost events posted from non-GUI thread in Qt?
Posted
by gp
on Stack Overflow
See other posts from Stack Overflow
or by gp
Published on 2010-05-02T13:45:00Z
Indexed on
2010/05/02
13:47 UTC
Read the original article
Hit count: 173
As the subject says, I'm posting events from non-GUI thread (some GStreamer thread, to be precise). Code looks like this:
GstBusSyncReply on_bus_message(GstBus* bus, GstMessage* message, gpointer data)
{
bool ret = QMetaObject::invokeMethod(static_cast<QObject*>(data), "stateChanged", Qt::QueuedConnection);
Q_ASSERT(ret);
return GST_BUS_PASS;
}
The problem is, stateChanged
(doesn't matter whether it is a slot or signal) is not called. I've stepped into QMetaObject::invokeMethod
with debugger, followed it till it called PostMessage
(it is Qt 4.6.2 on Windows, by the way) – everything seemed to be OK.
Object pointed to by data
lives in GUI thread, I've double-checked this.
How can I debug this problem? Or, better, maybe sidestep it altogether?
© Stack Overflow or respective owner