[Kde-bindings] Yet another segfault

Han Holl han.holl at pobox.com
Sun Oct 3 20:59:38 UTC 2004


On Sunday 03 October 2004 19:49, Richard Dale wrote:


> 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

Hi Richard,

Still everything isn'q quite right. Remember my awful blackout, with the 
misspelled Qstring& ? Correctly spelled it goes like this:

require 'Qt'

class Chooser <  Qt::Object
  slots 'setStyle(const QString&)'
  
  def setStyle(what)
    puts what
  end
end

a = Qt::Application.new(ARGV)
w = Qt::ComboBox.new('combo') do 
  insertStringList %w{ abc def geh }
  setCurrentText 'def'
end
c = Chooser.new
Qt::Object.connect(w, SIGNAL('activated(const QString&)'), c, 
SLOT('setStyle(const QString&)'))

a.mainWidget = w
w.show
a.exec

And with your newest qtruby.rb, I get:

/usr/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:356:in `initialize': unresolved 
constructor call Qt::ComboBox (ArgumentError)
        from /usr/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:356:in `call'
        from /usr/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:356:in `try_initialize'
        from /usr/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:353:in `callcc'
        from /usr/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:353:in `try_initialize'
        from bug.rb:14:in `new'
        from bug.rb:14

It runs just fine with the original qtruby.rb

Cheers,

Han Holl



More information about the Kde-bindings mailing list