Launching a Qt application over the Internet

I am writing an application using Qt and want to try and deploy it as a web application. I want the user to be able to use my application by accessing it through a web browser. I guess what is a web application? What are my options? I have never done anything like this, but I would like to learn something new.

EDIT: What if I deployed my application to a Linux server and had access to it / through it through a terminal? I think writing a web application will be harder than I thought.

+7
source share
6 answers

If all you have is a Qt application, then the best you can do is use Qt 5 and run it using the remote visualization package:

  1. Use WebGL streaming introduced in Qt 5.10. Qt provides an interface with the ability to connect to the browser directly, without the need for third-party code.

  2. For Qt 5.0-5.9, you can use the vnc platform plugin. Then connect using a vnc client based web browser .

For many purposes this may be enough, and, of course, it will require much less effort than coding a web application.

+2
source

You are looking for Wt, which provides a different set if drawing procedures for many Qt gui elements, turning them from strings on the screen into HTML controls.

http://www.webtoolkit.eu/wt

It also handles websocket calls for interactivity. It seems like a great idea to let us know how this works in practice.

+3
source

In the case of QML, there is QmlWeb , which is a JavaScript library that is able to parse QML code and create a website for its use using ordinary HTML / DOM elements and absolute positions in CSS, translating QML properties into CSS properties.

QmlWeb is a small Lauri Paymen project that has been under development for several years. QmlWeb, of course, does not yet support all Qts QML implementations, but it already supports a completely usable subset. It supports almost all of the basic QML syntax. In addition, it supports HTML input elements (Button, TextInput, TextArea is currently supported, not all).

Well, QmlWeb is not finished. I hope Digia helps in this project to prepare it with mature features.

+3
source

Interestingly, you can compile Qt applications in javascript using emscripten-qt. They work pretty quickly with the Firefox interpreter asm.js:

http://vps2.etotheipiplusone.comhaps0176/redmine/projects/emscripten-qt/wiki

+2
source

Qt does not support recording web browser-based applications. Unfortunately.

To do this, you need to use common web programming technologies. There are many ways, but Qt is not one of them.

+1
source

Try Qt for Web Build .

Web build allows you to compile and run C / C ++ code inside most browsers:

WebAssembly (Wasm, WA) is a web standard that defines a binary format and corresponding assembly-like text format for executable code on web pages .... It is executed in the sandbox in a web browser after the verification step. Programs can be compiled from high-level languages ​​into Wasm modules and loaded as libraries from JavaScript applets ... The initial goal is to support compilation from C and C ++, although support for other source languages ​​such as Rust and .NET also appears.

0
source

Source: https://habr.com/ru/post/971617/


All Articles