QtScript bindings

Aaron J. Seigo aseigo at kde.org
Tue Sep 15 01:44:25 CEST 2009


On September 14, 2009, Tommi Mikkonen wrote:
> > can you provide some concrete examples?
> 
> QFrame vs. Frame and QWebView vs. Webview is QtScriptGenerator and
> Plasmoids, 

Frame is not a QFrame, it's a Plasma::Frame. 
WebView is not a QWebView, it's a Plasma::WebView.

> and at the same time QtVertical in native Qt, QtScriptGenerator and
> Plasmoids

any suggestions for getting enums into the JS namsepace?

> . Another  issue is with types when
> adding a Qt widget that has been instantiated in C++. At least
> http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/CheatSheet
> documents that at times a QPainter etc is expected as parameter whereas
> Plasma uses name Painter etc.

mm.. afiacs it's always QPainter?

> As the error message I get is 'script
> could not be initialized' or something similar when misspelling a class
> name, it is very frustrating to debug API usage.

yes, there isn't a nice debugging system yet..
 
> This is not a major issue, and any convention will be ok for me.
> However, if we have two scripting systems --- one wirh privileges and
> another without --- it will be confusing if type names etc. are
> different.

i'm not so sure. learning the difference between Plasma::WebView and WebView, 
depending on the script bindings used, is probably pretty nominal compared to 
becoming acquainted with the entire Qt API.

also note that the simple applet JS bindings do not bind the entire API of all 
the classes offered, either.

> An additional issue is that if we have these two sets, the
> restricted one should not fail without error messages if someone tests
> privileged APIs but give an error message etc.

well, yes. this is currently unimplemented.
 
-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- 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/20090914/a28e7cfb/attachment.sig 


More information about the Plasma-devel mailing list