ruby - webview

David Palacio dpalacio at uninorte.edu.co
Sat Oct 3 21:19:45 CEST 2009


On Sábado 03 Octubre 2009 11:41:24 Petr Sigut escribió:
> Hi all!
> 
> I am trying to make simple Plasma Ruby Web Applet, i followed this outdated
> tutorial:
> 
> http://techbase.kde.org/Development/Tutorials/Plasma/RubyApplet
> 
> and modified it, but I am unable to use url method, the method is undefined
> 
> web = Plasma::WebView.new()
> web.url = Qt::Url.new("http://dot.kde.org/")
> 
> `method_missing': undefined method `url=' for #<Plasma::WebView:0xa8e99d98
> objectName=""> (NoMethodError)
> 
> This "works":
> 
> web = Qt::WebView.new()
> web.load(Qt::Url.new("http://www.google.com"))
> 
> but I can't see any result because I am unable to add it to the layout
> 
> layout = Qt::GraphicsLinearLayout.new Qt::Horizontal, self
> layout.add_item web
> 
> RubyWidget::Main
> /usr/share/kde4/apps/plasma_scriptengine_ruby/applet.rb:1047:in
> `method_missing': undefined method `addItem' for
> #<Qt::GraphicsLinearLayout:0xa8e8bd4c> (NoMethodError)
> 
> I've installed all libraries which seems to have something common with QT
>  and Ruby and plasma:)
> 
> I am sorry if I've overlooked something, but the documentation for ruby
>  which I found was very poor...
> 
> Thank you very much,
> 
> Peter
> 
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
> 
WebView::setUrl requires a KUrl. So obviously QUrl will not work.

url = KDE::Url.new 'http://kde.org/'
web = Plasma::WebView.new
web.url = url
=> #<KDE::Url:0x7f99828f3978 url="http://kde.org/", protocol="http">

qurl = Qt::Url.new 'http://qt.com/'
web.url = qurl
NoMethodError: undefined method `url=' for #<Plasma::WebView:0x7f99709ed480 
objectName="">
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20091003/8f98c11c/attachment-0001.sig 


More information about the Plasma-devel mailing list