[Kde-bindings] QtRuby virtual method callbacks

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Jul 15 17:57:41 UTC 2003


I've got QtRuby virtual method callbacks working, like paintEvent() in the 
example below. But I've hit a snag with calling the C++ super method from 
ruby, which is why 'super' has been commented out.

#!/usr/bin/ruby -w

require 'Qt';

class MyClass < Qt::PushButton
	def paintEvent(event)
		printf("In paintEvent...\n")
#		super
	end
end

a = Qt::Application.new(ARGV, ref nil);
hello = MyClass.new("Hello World", nil)
hello.resize(100, 30)
a.setMainWidget(hello)
hello.show()
a.exec()

I'm asking about it on the comp.lang.ruby list - you can't trap super calls 
with a custom method_missing implementation. But I don't think it's a 
showstopper - the main thing left to do now is slots/signals, and a lot of 
tidying up..

-- Richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtruby_0.4.tar.gz
Type: application/x-tgz
Size: 32771 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20030715/89ba8861/attachment.bin>


More information about the Kde-bindings mailing list