简体   繁体   中英

It is possible to just use QT and WebAssembly (instead of HTML + CSS + JavaScript) to develop a front-end web?

I am a C++ programmer, but for some reason, I have to develop a website by myself(My own commercial project). I don't want to take a lot of time to study JavaScript and something else. It is possible to just use QT and WebAssembly (instead of HTML + CSS + JavaScript) to develop a front-end web?

Yes, it's absolutely possible and I'm currently doing it for a project but you should do it carefully based on the project requirements, running environment and your own backgrounds. Here are some problems you may encounter:

  1. The output .wasm file may get too large. Generally, it won't be suitable for public domain applications.
  2. In low-end devices, maybe you find it laggy if you don't do enough code level optimizations.
  3. Threads are not officially supported yet (as of Dec. 2019) by major browsers but tech-preview is available. This is not a real big problem as it would be a standard feature soon.
  4. Native virtual keyboard won't work on mobile devices but the work is in progress.

These were my own major problems with Qt for WebAssembly. Despite this, I find it much more flexible than HTML+CSS. QML is really a nice language for UI development. Creating animated UIs is quite easy and straight-forward. You can also use many JavaScript libraries in your QML code like Lodash and Moment or any other js library that does not refer or manipulate window DOM.

Yes, it is possible. But you should do not do it if only reason is reject for learning new technologies. For now (I'am writing this answer when Qt 5.14 is present) Qt for webassembly is deployed as official platform. Unfortunately it is young platform support with a lot of problems and possible future changes. Qt team do really good job so next version will be better. 5.14 is much better than 5.13 in webassembly context but still need fixes. You should know Qt for webassembly will support only a few Qt modules, excluding widget. Yes, you can only use QML for GUI. Qt for webassembly was created for the purpose of port one code base in other platform (it it generally Qt develop way, please see Qt for MCU). With other technologies in this stack like QRemoteObject is very interesting technologies. It was not created for websites in normal network. Main Qt for webassembly target are internal network systems and remote control of devices. Pay attention about this. Unfortunately, not all browser will support webassembly right. Please see Qt for weassembly support notes. Additional, in Qt you can't find build-in rest-API handle or other standard web technologies to integrate with your existing backed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM