[Kde-bindings] Signal-slot with hash param

Enrico Pilotto pioz at pioz.it
Mon Oct 3 01:21:58 UTC 2011


Hi,
  Im using qtbindings for ruby (https://github.com/ryanmelt/qtbindings)
and i would emit a signal with an hash param...

Something like this:

#----------------------
require 'Qt'

class Foo < Qt::Object

  signals 'my_signal(Hash)'
  slots 'my_slot(Hash)'

  def initialize(parent = nil)
    super(parent)
    connect(self, SIGNAL('my_signal(Hash)'), self, SLOT('my_slot(Hash)'))
  end

  def emit_my_signal
    emit my_signal({:foo => :bar})
  end

  def my_slot(hash)
    puts hash.inspect
  end
end

o = Foo.new
o.emit_my_signal
#----------------------

If I run this script I get the error: Cannot handle 'Hash' as slot
argument (ArgumentError).
If I use int instead of Hash everything is fine.

There is a way to do this?? How?

Thanks.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20111003/fe40055f/attachment.sig>


More information about the Kde-bindings mailing list