Qt 4.5 - how do I perform a queued connection with

2019-04-14 06:22发布

问题:

I am trying to do a connect with a std::vector<FrameData*>& using queued connection

   connect(this, SIGNAL(process(QVector<FrameData*>&)), 
           this, SLOT(beginProcess(QVector<FrameData*>&),
           Qt::ConnectionType::QueuedConnection);

What parameters should I pass for QRegisterMetaType for this to work?

Thanks in advance!

回答1:

You can't use non-const references in signals and slots.

EDIT: ...when using Queued connections.



回答2:

std::vector or QVector? presumably the following should work,

int type = qRegisterMetaType< QVector<FrameData*> >("QVector<FrameData*>");



标签: qt qt4