PDA

View Full Version : How to use Qt::QueuedConnection?



vishal.chauhan
30th July 2007, 07:50
Hi All,

I m using Qt 4.1.5 on my MAC.

I m emitting a Signal with QString as a argument from a Thread as passing it in a SLOT as

SLOT(ShowRoot(const QString&, const QString&)

In which I am passing QString from SIGNAL and use these QString to set the TreeWidgetItem text.

I want to use a Queued connecion so that when I emit a Signal it will show as one by one in the TreeWidget.

But I am unable to use Qt::Queued connction because I think the QString should be passes as a Meta object but I am not able to do that.


So If any body knows then plz help me out.

Thanks.

marcel
30th July 2007, 09:04
It is OK if you use QString with Qt::QueuedConnection.
Anyway, if you made the implementation, you already use QueuedConnection, since it is the default across threads.

But note that nothing guarantees that the items will be created sequentially. It depends on the GUI thread load. They might not even show up in the order you expect.

Regards