Qt Bridges: Hiding C++ and bringing Qt UI to any language

Qt Bridges: Hiding C++ and bringing Qt UI to any language

Qt Bridges presented on stage at the Qt World Summit in Munich, by Qt project chief maintainer Volker Hilsheimer and director product management Maurice Kalinowski

At the Qt World Summit in Munich the Qt Company, maker of a widely used UI framework, unveiled its plan to bring Qt UI to any programming language, starting with Java, C#, Rust, Swift and Kotlin, and extending a technology that already exists for Python.

Qt is a cross-platform UI (user interface) framework with a 30-year history, originally based on widgets coded in C++. Beginning in 2009, an alternative approach to defining a Qt UI has evolved, called QML (Qt Meta-object language). QML includes a JavaScript runtime as well as a JSON-like format for defining the UI elements and their behavior. The UI framework associated with QML is called Qt Quick, and it is compiled into C++ binaries by the Qt Quick compiler. Qt Quick is not just a different way to define a Qt UI, but uses a different framework than Qt widgets.

“Qt Bridges is a future technology in the making, to enable QML and Qt Quick to be used as the front end for applications built in various languages, no longer exclusively C++ or Python,” explained Juhapekka Niemi, SVP product management, on the stage at the summit.

Why bother with Qt Bridges when there are already plenty of ways to use Qt via bindings from multiple languages, including all those mentioned? That is the obvious question. “The first thing to underline is this is not a binding, and we call it Bridges on purpose, because one of the the targets of this development was to allow people to start  using Qt without the need to write full Qt application,” Qt engineer Vladimir Minenko told DevClass.

Qt Bridges does not necessarily replace existing bindings, rather it is a new approach that allows developers coding in the target languages to use Qt only for the UI, not using other parts of Qt such as networking or storage. Qt Bridges uses only Qt Quick, not widgets.

This is potentially a big transition for Qt, allowing developers to use the Qt cross-platform UI while writing business logic and other code in their preferred programming language.

Part of the thinking here is that C++ is regarded as an unsafe language whereas the languages supported by Qt Bridges are safe languages, potentially escaping the notion that because Qt is C++, it is not as safe to use.

Qt Quick is a modern UI framework in comparison to widgets, and benefits from hardware graphics acceleration. Designers can also now use Figma to design a QML UI, another new feature previewed at the Summit.

Might other languages be supported in future? Minenko said that this is possible, and could even be implemented by Qt partners. He promised that the company will document how Bridges was implemented for the current set of languages so that others can be added.

What is the status of Qt Bridges? On this point DevClass found the company hard to pin down. Asked when it would be rolled out, Minenko said that “as a project manager, I would say as soon as possible.” However it is currently not documented beyond a press release, though a landing page asking for feedback is promised soon. It is beyond the concept stage, we were told. “There is real software which you will be able to use,” Minenko said; but it seems to us that it remains at an early stage.