That's great, thanks. Would this also make it available to Javascript in WebKit? There's a possibility I'd like to do the same thing there.
That's great, thanks. Would this also make it available to Javascript in WebKit? There's a possibility I'd like to do the same thing there.
I have no idea. Anybody else?
Johannes
I don't think you can. At least not currently. What do you need it for? Can't you use regular javascript arrays?
I'd use a regular Javascript array, but I'm not sure what the best method would be to get it to the C++ side. The application is using sampled data, so an array of floats makes the most sense. I'd like to build a tutorial module for the application, but I don't have a whole lot of time to spend on it, so I'd really like to use WebKit and just develop some HTML as the interface for the tutorial. That means either have the sample data created on the C++ side and exposed to Javascript or creating it in Javascript and exposing it to C++. I don't really have a preference either way. The problem is figuring out the correct (best?) way to share data between the two different sides of the application. If I can just share the Javascript array, that's great, but I've been unable to figure out how to do it thus far.
Well... you can't access WebKit's "memory space" from C++ (yet!) so this is really meaningless.
What do you need javascript for? Maybe importing the web technology is more of a burden than real help?That means either have the sample data created on the C++ side and exposed to Javascript or creating it in Javascript and exposing it to C++. I don't really have a preference either way. The problem is figuring out the correct (best?) way to share data between the two different sides of the application. If I can just share the Javascript array, that's great, but I've been unable to figure out how to do it thus far.
You can use QtScript in C++ code and Qt is quite good in providing visual interface to the logic behind the application.
No doubt that Qt's great for building interfaces (I do it all the time), but for this particular usage of WebKit could have been a great fit. By having the tutorials themselves be on an intranet as web pages, I'd be free to update them as time permits without having to worry about a new release of the software -- just update the HTML and Javascript on the servers. At the same time, I'd be able to allow the users to provide their own sample data for use in the tutorial. There are still ways to do it, but it would have been nice for the Javascript to have direct access to the float arrays I'm using in the application for display in HTML.
It's not a showstopper or anything, it would have just been a nice solution for this particular component.
Bookmarks