c++ - How to register reference to Qt containers? -


I QQueue . I want to pass the queue from context because I do not want to copy the data, when I change the queue element in the slot. Therefore, I should register this meta type which has QiQunction I when I register it like this:

  qRegisterMetaType & lt; QQueue & lt; Double & gt; & Amp; & Gt; ("QQueue & lt; double & gt; & amp; quot;);   

I get the following error:

  Error: 'qRegisterMetaType (const char [16])' does not match to make calls'   

How do I register it?

Whatever register you register it without reference.

  qRegisterMetaType & lt; QQueue & lt; Double & gt; & Gt; ();   

You will also have to declare the metatip in each compilation unit where it will be used - ideally you should have an AF typed in your header file: < Pre> // ww. H. #fdf wquyuh #define dvalequayuh #includes & lt; QQueue & gt; Typipfif QUUU & LT; Double & gt; DoubleQueue; Q_DECLARE_METATYPE #endif

Then you will have to continuously use and register DoubleQueue - Remember that for moc , a Type is part of the text after snatching references, it must match exactly.

  qRegisterMetaType & lt; Doublequite & gt; ();    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -