PDA

View Full Version : QSignalSpy a QHash signal



just10
2nd April 2019, 14:40
Hello,

I am trying to test a signal using QSignalSpy. The signal being emitted is of type QHash<int,int>. I am having issues during the construction of the QSignalSpy object. The warning says "Unable to handle parameter ' ' of type QHash<int,int> of method ...

I have looked into qregistermetatype, but from the documentation it says you only need to register the metatype if it is not known, and I believe that int(s) are a known metatype.

If anyone could point me in the right direction in regards to testing a signal that is emitting a QHash please let me know.

Thank you.

tuli
2nd April 2019, 15:38
Int is, but QHash<int,int> probably isnt. You have to do qRegistermetaType<QHash<int,int>>().


Generally, always shows code + full error message.

just10
2nd April 2019, 17:39
Got it,

Thank you for your help.