[Kde-bindings] Yet another segfault

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sun Oct 3 17:49:04 UTC 2004


On Sunday 03 October 2004 13:07, Han Holl wrote:
> Variations on a theme:
>
> require 'Qt'
>
> class Segdemo < Qt::Widget
>   def initialize(*k)
>       super(*k)
>       lay = Qt::HBoxLayout.new(self)
>       ed = Qt::LineEdit.new('blah',self)
> # next line should be: lay.addWidget(ed)
>       lay.addWidget(lay)
>   end
> end
>
> if $0 == __FILE__
>     a = Qt::Application.new(ARGV)
>     w = Segdemo.new
>     a.mainWidget = w
>     w.show
>     a.exec
> end
>
> Results in :
> client.rb:17: [BUG] Segmentation fault
> ruby 1.8.1 (2004-03-08) [i686-linux-gnu]
>
> Aborted
>
> In my first two days with qtruby I made errors like this for real.
Try this version of qtuby.rb, it is a lot more fussy about arg type matching 
errors, and shouldn't crash if you make mistakes.

-- Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtruby.rb
Type: application/x-ruby
Size: 20092 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20041003/ea245223/attachment.bin>


More information about the Kde-bindings mailing list