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

Alexander Vassilev avasilev at voipgate.com
Wed Feb 4 17:14:29 PST 2009

Hi all,
I have originally posted this mail to the qt-interst mailing list but I
think it could be more appropriate to post it here, so here are my two

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


This e-mail and any attached files are confidential and intended solely
for the use of the individual or entity to whom they are addressed. If
you have received this e-mail by mistake, please notify the sender
immediately and delete it from your system. You must not copy the
message or disclose its contents to anyone.

Think of the environment: don't print this e-mail unless you really need
to !


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Attached Message Part
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090205/d60940f6/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avasilev.vcf
Type: text/x-vcard
Size: 134 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090205/d60940f6/attachment.vcf>

More information about the webkit-dev mailing list