Results 1 to 5 of 5

Thread: what datatypes allowed in signals/slots

  1. #1
    Join Date
    Jan 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default what datatypes allowed in signals/slots

    hi,

    i have connected a signal with the parameters (quint8, QString&, quint32) to an accordant slot and when the signal was fired i got the following message in debug mode:

    Qt Code:
    1. QObject::connect: Cannot queue arguments of type 'quint32'
    To copy to clipboard, switch view to plain text mode 

    does it mean that i cannot put quint's into signal signature???
    what datatypes are allowed in signals?

    thanks in advance

    smalls

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    85
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: what datatypes allowed in signals/slots

    Any type is allowed with direct connections. But I assume you have a queued connection (thread A to thread B). Here you have to inform Qt about your type with QMetaType - but it's strange that quint32 is unknown...

  3. #3
    Join Date
    Jan 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: what datatypes allowed in signals/slots

    yes, that's right, sender and receiver of the signal are living in different threads...

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    85
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: what datatypes allowed in signals/slots

    I don't know exactly how the signal / slot system works but I have an idea why you can't use quint32: In the connect you have to specify the type as a name, which is converted to a const char* by a macro. But how should the compiler guess that "unsigned int" is equal to "quint32"?

    Another problem is that the quint8 seems to work OR that the parameters are queued from right to left. Then connect could stop after the quint32.

    My suggestion is that you try to use unsigned int or do you really need exactly 32 bit, with more being an error?

  5. #5
    Join Date
    Jan 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: what datatypes allowed in signals/slots

    sorry, i forgot a quint32 as the first parameter in the signal/slot signature.
    so most probably it goes from left to right and stops already when reading the first quint32.

    rewrote the signals/slot with ordinary ints and up to now it's working.

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.