I need to update the GUI from multiple threads. So far I've taken the following approach:
connect(this,
SIGNAL(setGUILabel
(QString)), label,
SLOT(setText
(QString const
&)), Qt
::QueuedConnection);
connect(this, SIGNAL(setGUILabel(QString)), label, SLOT(setText(QString const&)), Qt::QueuedConnection);
To copy to clipboard, switch view to plain text mode
and it works... What bothers me is that the argument of the signal is of QString type (so that I make a copy of the string in the signal issuing thread), but the argument of the slot is QString const&. Is this mixing of references and object types allowed by Qt?
Bookmarks