[Qt-interest] A few questions about exporting QObjects to javascript in webkit

Alexander Vassilev avasilev at voipgate.com
Wed Feb 4 17:15:25 CET 2009


Hi all,

I am researching the capabilities of exporting C++ code to javascript in
webkit. What I need, besides the exporting of a QObject to javascript, is:

 - Dynamically (at runtime) select what methods of an exported object
are visible to javascript. I have several sets of methods and I would
like to export only some of them, depending on a runtime condition. I
would like all these methods to belong to the same javascript object.
Having several QObject implementations and choosing which one to export
is not a feasible solution since the combinations will be quite a few.
So is there another way, e.g. 'hiding' some of the slots of the QObject
before calling addToJavaScriptWindowObject(), or if I have to do it at
the low level, directly interfacing with WebKit, could someone point me
to a simple example how to do it, I have checked several source files
but I'm not sure if they are the right place to look.
 - Defining a javascript class prototype and returning objects of that
class from js-exported methods. I guess I would have to do it at the low
level with webkit directly. If yes, could you point me to an example,
and, just to ask, is support for this planned for qt 4.5? What would be
the lifetime of such objects, will they be garbage collected?
I apologize if some of the questions are newbie questions, that is
because I'm new to Qt and webkit.

Thanks in advance

Best regards
Alex

-------------- next part --------------
A non-text attachment was scrubbed...
Name: avasilev.vcf
Type: text/x-vcard
Size: 134 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090204/79c33d14/attachment.vcf 


More information about the Qt-interest-old mailing list