tags:

views:

388

answers:

2

I am trying to do a connect with a std::vector& 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!

+2  A: 

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

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

Bob
Is it possible with std::vector? I figured that perhpas it would be easier to use QVector
Extrakun
should work with std::vector too, according to the api docs "Any class or struct that has a public constructor, a public copy constructor, and a public destructor can be registered."
Bob
+3  A: 

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

EDIT: ...when using Queued connections.

Intransigent Parsnip
Are you sure!? As far as I know this is only true for Queued connections and non built in types.
TimW
You're right, you can use them in direct connections. Edited my answer. You can't use them in queued connections regardless of whether they're registered metatypes or "built in types". A queued connection makes a copy of the signal arguments, which can't be done sensibly for references.
Intransigent Parsnip