[Kde-bindings] possible bug with signals in KTextEditor::View
    Stefano Crocco 
    stefano.crocco at alice.it
       
    Sun Aug 10 08:46:19 UTC 2008
    
    
  
I've run into a weird issue with signals emitted from KTextEditor::View which 
have a QString among their argument and I don't know whether I'm doing 
something wrong or it is a bug.
The involved signals are:
- KTextEditor::View::textInserted (KTextEditor::View *view, const KTextEditor::Cursor &position, const QString &text)
- KTextEditor::View::informationMessage (KTextEditor::View *view, const QString &message)
If I connect a slot or a block to them, when the signal is emitted I get an 
error like this:
Cannot handle 'QString*' as slot argument (ArgumentError)
It seems this is only related to this class, since I tried with the signal 
KCompletion::match(const QString &)
and it worked correctly.
Here's an example program which causes this issue.
require 'korundum4'
require 'ktexteditor'
data = KDE::AboutData.new "kruby", "", KDE::ki18n("KRuby"), "0.0.1"
KDE::CmdLineArgs.init [], data
app = KDE::Application.new
doc = KTextEditor::EditorChooser.editor('katepart').create_document( nil)
doc.openUrl KDE::Url.from_path(__FILE__)
view = doc.create_view(nil)
view.connect(SIGNAL('textInserted(KTextEditor::View*, const KTextEditor::Cursor &, const QString &)')) do |v,c, t|
  puts t
end
view.show
app.exec
Entering a character in the text editor gives the following error message:
/usr/lib/ruby/site_ruby/1.8/KDE/korundum4.rb:36:in `qt_metacall': Cannot handle 'QString*' as slot argument (ArgumentError)
        from /usr/lib/ruby/site_ruby/1.8/KDE/korundum4.rb:36:in `method_missing'
        from /usr/lib/ruby/site_ruby/1.8/KDE/korundum4.rb:36:in `exec'
        from prova.rb:15
Is it a bug or am I doing something wrong?
Stefano
    
    
More information about the Kde-bindings
mailing list