开发者

How to run C++ applications on a webpage?

开发者 https://www.devze.com 2023-03-31 00:01 出处:网络
Are there any tools to run C++ applications written in QT on standard web browsers? My C++ app has to run from a web开发者_JS百科page, do some math, and return the result back to the webpage.Check ou

Are there any tools to run C++ applications written in QT on standard web browsers?

My C++ app has to run from a web开发者_JS百科page, do some math, and return the result back to the webpage.


Check out NaCl (Native Client). No Qt, but you can use c++.


You can't. You can write the server side in a web app in C++, of course, but the Qt GUI framework is only for applications that show their user interface on the machine they are running on. (With the usual caveats in the case of remote X11 connections and so forth, but that won't help you for a web app).


I have read about a sample application like this. I think you can search for this term "Qt WebKit Hybrid application". In that example, the user interface is written in HTML and Javascript and the backend in C++. Even, the C++ objects ownerships can be transferred to Javascript. I'm not sure I'm correct but I'm partially correct.

EDIT: Here is the link. https://developer.qt.nokia.com/wiki/Server-Driven_UI_with_Hybrid_QtWebkit


It's possible to compile C++ code to JavaScript using Emscripten, and then call compiled C++ functions from JavaScript, as explained here. This will allow you to run C++ code in a web browser or other JavaScript environment, without any additional plugins.


There is one more solution to this, you can write a browser plugin. I think that this is better then ActiveX and NaCl. For details on how to write plugins check this: How to write a C++ FireFox 3 plugin (not extension) on Windows?


Maybe you could embed the code in an ActiveX control.

0

精彩评论

暂无评论...
验证码 换一张
取 消