Results 1 to 3 of 3

Thread: QSignalSpy a QHash signal

  1. #1
    Join Date
    Apr 2019
    Posts
    2
    Qt products
    Qt5

    Default QSignalSpy a QHash signal

    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.

  2. #2
    Join Date
    Jul 2012
    Posts
    244
    Thanks
    27
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSignalSpy a QHash signal

    Int is, but QHash<int,int> probably isnt. You have to do qRegistermetaType<QHash<int,int>>().


    Generally, always shows code + full error message.

  3. #3
    Join Date
    Apr 2019
    Posts
    2
    Qt products
    Qt5

    Default Re: QSignalSpy a QHash signal

    Got it,

    Thank you for your help.

Similar Threads

  1. qhash in qtscript
    By ivareske in forum Qt Programming
    Replies: 0
    Last Post: 18th December 2011, 12:43
  2. QSignalSpy
    By QTInfinity in forum Qt Programming
    Replies: 2
    Last Post: 29th June 2009, 12:00
  3. Replies: 1
    Last Post: 10th February 2009, 10:42
  4. QHash
    By coderbob in forum Qt Programming
    Replies: 2
    Last Post: 2nd July 2008, 15:29
  5. Can QHash::capacity() be smaller than QHash::size()?!?
    By iw2nhl in forum Qt Programming
    Replies: 2
    Last Post: 24th August 2007, 02:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.