Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Language Bindings: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(add rust)
m (Removed; Qt Quick as css, which was wrong. Edited the languages Qt language bindings section)
 
(33 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{LangSwitch}}
{{LangSwitch}}


== Programming Language Support & Language Bindings ==
==Programming Language Support & Language Bindings==


The Qt API is implemented in C++, and provides additional features for easier cross-platform development. QML – introduced with Qt Quick is a CSS and JavaScript-like declarative, language designed to describe the user interface of a program: both what it looks like, and how it behaves. Bindings to Qt exist for several other languages, including Ada, Pascal, Perl, PHP, Ruby, Python and Java™.
The Qt API is implemented in C++, and provides additional features for easier cross-platform development. QML – introduced with Qt Quick and JavaScript-like declarative, language designed to describe the user interface of a program: both what it looks like, and how it behaves.  
As an alternative to using C++, Qt offers other languages, including Python .
Officially, Python bindings are being maintained by the project, under the name of [https://pyside.org Qt for Python].


== C++ Development with Qt ==
==C++ Development with Qt==


Qt provides an intuitive C++ class library with a rich set of application build blocks for C++ development. Qt goes beyond C++ in the areas of inter-object communication and flexibility for advanced GUI development. Qt adds the following features to C+'':
Qt provides an intuitive C++ class library with a rich set of application build blocks for C++ development. Qt goes beyond C++ in the areas of inter-object communication and flexibility for advanced GUI development. Qt adds the following features to C++'':''


* Powerful mechanism for inter-object communication called [https://doc.qt.io/qt-5/signalsandslots.html signals and slots]
*Powerful mechanism for inter-object communication called [https://doc.qt.io/qt-5/signalsandslots.html signals and slots]
* Queryable and designable [https://doc.qt.io/qt-5/properties.html#qt-s-property-system object properties ]
*Queryable and designable [https://doc.qt.io/qt-5/properties.html#qt-s-property-system object properties]
* Powerful [https://doc.qt.io/qt-5/eventsandfilters.html events and events filters ]
*Powerful [https://doc.qt.io/qt-5/eventsandfilters.html events and events filters]
* Contextual [https://doc.qt.io/qt-5/i18n.html string translation for internationalization ]
*Contextual [https://doc.qt.io/qt-5/i18n.html string translation for internationalization]
* Sophisticated interval driven [https://doc.qt.io/qt-5/timers.html timers] that make it possible to elegantly integrate many tasks in an event-driven GUI
*Sophisticated interval driven [https://doc.qt.io/qt-5/timers.html timers] that make it possible to elegantly integrate many tasks in an event-driven GUI
* Hierarchical and queryable [https://doc.qt.io/qt-5/objecttrees.html object trees] that organize object ownership in a natural way
*Hierarchical and queryable [https://doc.qt.io/qt-5/objecttrees.html object trees] that organize object ownership in a natural way
* [https://doc.qt.io/qt-5/qpointer.html Guarded pointers] that are automatically set to 0 when the referenced object is destroyed, unlike normal C++ pointers which become dangling pointers when their objects are destroyed
*[https://doc.qt.io/qt-5/qpointer.html Guarded pointers] that are automatically set to 0 when the referenced object is destroyed, unlike normal C++ pointers which become dangling pointers when their objects are destroyed
* A [https://doc.qt.io/qt-5/metaobjects.html dynamic cast ] works across library boundaries.
*A [https://doc.qt.io/qt-5/metaobjects.html dynamic cast] works across library boundaries.


== QML Development with Qt Quick ==
==QML Development with Qt Quick==


QML is a declarative, JavaScript-based language designed to describe the user interface of a program: both what it looks like, and how it behaves. In QML, a user interface is specified as a tree of objects with properties.
QML is a declarative, JavaScript-based language designed to describe the user interface of a program: both what it looks like, and how it behaves. In QML, a user interface is specified as a tree of objects with properties, like in JSON.


* JavaScript, HTML and CSS skills can be used to code complete apps
*JavaScript, HTML and CSS skills can be used to code complete front-end apps
* Optimized for touch-based, animated mobile UIs
*Optimized for touch-based, animated mobile UIs
* Includes a set of graphical and behavioral building blocks: [http://doc.qt.nokia.com/4.7/qdeclarativeelements.html QML Elements ]
*Includes a set of graphical and behavioral building blocks: [http://doc.qt.io/qt-5/qmltypes.html QML Types]
* No C++ knowledge required for UI creation, but can be extended with C++
*No C++ knowledge required for UI creation, while it can be extended with C++


[http://doc.qt.nokia.com/4.7/qdeclarativeintroduction.html Find out more about Qt Quick]
[http://doc.qt.io/qt-5/qtquick-index.html Find out more about Qt Quick]


== These are third party language bindings for Qt ==
==Qt for Python==


=== [http://www.pyside.org PySide: Python for Qt] (LGPL) ===
The ''Qt for Python'' project provides the '''PySide2''' module allowing users to develop Qt and QML application easily from Python.


* [[:Category:LanguageBindings::PySide|Wiki]]
*You can find more information for the project, which is currently available as a Technical Preview, in the [https://wiki.qt.io/PySide2 wiki page].
* [[PySideDocumentation|Documentation (Guides and Tutorials)]]
*Compatible with Qt 5.11, and Python 2.7 and 3.5+.
* [[PySideDevelopment|Development]]
* [[PySideDownloads|Downloads]]
* [http://lists.qt-project.org/mailman/listinfo/pyside Mailing list]
* [http://code.qt.io/cgit/?q=pyside Source code]
* [https://bugreports.qt.io/browse/PYSIDE Bug tracker]


=== [http://www.riverbankcomputing.com/news PyQt] (GPL 3/commercial) ===
Qt for Python (PySide2) is the official set of Python wheels that The Qt Company provides.


* [https://wiki.python.org/moin/PyQt/Tutorials Tutorials]
[https://www.qt.io/qt-for-python Find out more about Qt for Python]
* [http://pyqt.sourceforge.net/Docs/PyQt4/ Reference Guide (PyQt4)]
* [http://pyqt.sourceforge.net/Docs/PyQt4/classes.html API Documentation (PyQt4)]
* [http://pyqt.sourceforge.net/Docs/PyQt5/index.html Reference Guide (PyQt5)]
* [http://pyqt.sourceforge.net/Docs/PyQt5/class_reference.html API Documentation (PyQt5)]
* [http://www.qtrac.eu/pyqtbook.html Book]
* [http://www.riverbankcomputing.com/software/pyqt/whitepaper Whitepaper]


=== [http://qt.gitorious.org/qt-jambi Qt for Java] (QtJambi, Windows/Mac/Linux) ===
==These are third party language bindings for Qt==


Qt Jambi – Qt bindings to the Java programming language – is maintained by the community. You can find more information from http://qt-jambi.org.
===[http://www.riverbankcomputing.com/news Qt for Python] (PyQt)===


* [http://qt-jambi.org/ Jambi Community]
(PyQt is developed by [http://www.riverbankcomputing.com/ Riverbank Computing], not to be confused with [https://pyside.org Qt for Python (PySide)] from TQtC)
* [http://doc.qt.digia.com/qtjambi-4.4/html/com/trolltech/qt/qtjambi-tutorial.html Old tutorial]
* [http://doc.qt.digia.com/qtjambi-4.4/html/index.html Old API Javadoc]
* [[Building Qt Jambi on Windows using MinGW]]


=== [http://ring-lang.sourceforge.net/doc/qt.html Qt for Ring] (RingQt) ===
*[https://wiki.python.org/moin/PyQt/Tutorials Tutorials]
*[http://pyqt.sourceforge.net/Docs/PyQt5/index.html Reference Guide (PyQt5)]
*[http://pyqt.sourceforge.net/Docs/PyQt5/class_reference.html API Documentation (PyQt5)]
*[http://www.qtrac.eu/pyqtbook.html Book]
*[http://www.riverbankcomputing.com/software/pyqt/whitepaper Whitepaper]
 
===[https://ring-lang.github.io/doc1.16/qt.html Qt for Ring] (RingQt)===


RingQt is a binding of the Qt framework to the [http://ring-lang.net/ Ring programming language.]
RingQt is a binding of the Qt framework to the [http://ring-lang.net/ Ring programming language.]
Ring uses Qt as its toolkit to provide cross-platform abilities.
Ring uses Qt as its toolkit to provide cross-platform abilities.


=== [https://github.com/rust-qt Qt for Rust] (Rust-Qt) ===
===[https://qtjambi.io/ Qt for Java and Kotlin] (QtJambi)===
QtJambi is Qt bindings for the Java programming language originally developed by Trolltech, the predecessor of The Qt Company.
 
The successive open source project provides bindings of Qt5 and Qt6 releases for latest Java JDK versions, GraalVM and Kotlin.
 
*[https://qtjambi.io/ Project on Github]
*[https://qtjambi.io/wiki Introduction]
*[https://doc.qtjambi.io/5.15 QtJambi for Qt5 API Documentation]
*[https://doc.qtjambi.io/latest QtJambi for Qt6 API Documentation]


Qt bindings for Rust language
===[https://github.com/KDAB/cxx-qt/ Qt for Rust] (CXX-Qt)===
Safe interop between Rust and Qt using [https://cxx.rs/ CXX]


* [https://github.com/rust-qt Project on github]
CXX-Qt is a set of Rust crates for creating bidirectional Rust ⇄ C++ bindings with Qt. It can be used to integrate Rust into C++ applications using CMake or used to build Rust applications with Cargo. CXX-Qt provides tools for implementing QObject subclasses in Rust which can be used from C++, QML, and JavaScript.


*[https://github.com/KDAB/cxx-qt/ Project on Github]
*[https://kdab.github.io/cxx-qt/book/ Rust Book with Getting Started guide]


=== [http://techbase.kde.org/Development/Languages/Ruby Qt for Ruby] (QtRuby) ===
===[https://github.com/rust-qt Qt for Rust] (Rust-Qt)===


The project provides complete bindings to both the KDE API and the Qt APIs. The Korundum package includes both a QtRuby Qt-only binding along with the full combined Qt/KDE one. The QtRuby package contains just Qt bindings with no dependencies on KDE.
Qt bindings for the Rust language


* [http://www.darshancomputing.com/qt4-qtruby-tutorial/ Tutorial]
*[https://github.com/rust-qt Project on Github]
* [http://www.pragmaticprogrammer.com/titles/ctrubyqt/ Book] (for Qt 3)


=== [http://www.kbasic.com/ Qt for BASIC] (KBasic) ===
===[https://github.com/woboq/qmetaobject-rs Qt Quick for Rust] (qmetaobject-rs)===


KBasic uses Qt as its toolkit to provide cross-platform abilities. KBasic is a further BASIC dialect and is related to VB.NET™, Visual Basic®, Visual Basic for Application® and Java™. It combines several features and includes built-in backward support for QBasic®.
QML bindings for the Rust language


=== [http://www.qtada.com/ Qt for Ada 2005] (QtAda) ===
*[https://github.com/woboq/qmetaobject-rs Project on Github]
*[https://www.youtube.com/watch?v=6pcOhCWLd_U Presentation on Qt YouTube channel]


QtAda is an Ada2005 language prividing bindings to the Qt libraries and a set of useful tools. QtAda supports Qt version 4.6 and later.
===[https://github.com/White-Oak/qml-rust Qt Quick for Rust] (qml-rust)===


* [[qtada_fedora | Building QtAda on Fedora 16]]
*QML bindings for the Rust language
**[https://github.com/White-Oak/qml-rust Project on Github]


===[https://github.com/flanfly/qmlrs Qt Quick for Rust] (qmlrs)===


-----
*QML bindings for the Rust language
**[https://github.com/flanfly/qmlrs Project on Github]


=== Perl bindings ===
===[https://github.com/kassane/qml_zig Qt Quick for Zig] (qml_zig)===


==== [https://projects.kde.org/projects/kde/kdebindings/perl official PerlQt and PerlKDE] ====
*QML bindings for the Zig language
*
*


This is what the Linux distros ship. Expect updates for Qt5 in 2013. Subscribe to the [http://lists.kde.org/?l=kde-bindings kde-bindings list] for news.
===[https://github.com/vesim987/zqml Qt Quick for Zig] (zqml)===


This repository used to be at [http://code.google.com/p/perlqt4/ Google code], then moved to KDE in 2012. Some outdated code snapshots are on [http://search.cpan.org/~cburel/; CPAN] prefer the KDE repository.
*QML bindings for the Zig language


==== [http://search.cpan.org/~vadiml/ Vadim Likhota bindings] ====
===[https://github.com/Papierkorb/qt5.cr Qt for Crystal]   (qt5.cr)===


One-man effort, last updated 2008. [http://www.opendesktop.org/content/show.php/?action=content&content=69748 opendesktop.org mirror]
*Qt bindings for the Crystal language


==== [http://search.cpan.org/~dongxu/ Dongxu Ma bindings] ====
===[https://github.com/jerous86/nimqt Qt for Nim] (nimqt)===


One-man effort, last update 2012. [https://github.com/dxma/cpan/wiki GitHub mirror]
*Qt bindings for Nim


==== [http://sf.net/projects/perlqt PerlQt3] ====
===[https://github.com/filcuc/nimqml Qt Quick for Nim] (nimqml)===


Outdated, Qt3 only.
*QML bindings for Nim


==== [http://search.cpan.org/dist/PerlQt/ PerlQt] ====
===[https://github.com/therecipe/qt Qt for Go] (qt)===


Outdated, Qt2 and Qt1 only.
*Qt bindings for Go language
**[https://github.com/therecipe/qt Project on Github]


*QML bindings for Go language
**[https://github.com/go-qamel/qamel Project on Github]


-----
===[https://github.com/bytedeco/javacpp-presets/tree/master/qt Qt for Java] (javacpp-presets)===


=== [http://techbase.kde.org/Development/Languages/QtSharp Qt for C#] (Qyoto) ===
*Qt bindings for Java
Qyoto makes it possible to develop Qt and KDE applications using C#, or any other .NET language. Qyoto uses SMOKE, and offers access to almost all Qt and KDE classes.


=== [http://www.dsource.org/projects/qtd Qt for D] (QtD) ===
===[https://gitlab.com/ddobrev/QtSharp Qt for C#/Mono/.Net] (QtSharp)===
This project aims to create Mono/.NET libraries that wrap Qt thus enabling its usage through C#. It relies on the excellent CppSharp.


QtD is a binding of the Qt framework to the [http://www.digitalmars.com/d/2.0/index.html D programming language version 2.]
===[https://github.com/pauldotknopf/Qml.Net Qt for C#/Mono/.Net] (Qml.Net)===
Qml.Net is cross-platform integration of Qml/QtQuick for .NET Core/.NET Framework/Mono. It is a binding that brings .NET types into JavaScript with full interoperability.
===[https://github.com/MGWL/QtE5 Qt for D] (QtE5)===


=== [http://wiki.lazarus.freepascal.org/Qt4_binding Qt for Pascal] (FPC Qt4 Binding) ===
QtE5 is a binding of the Qt framework to the [https://dlang.org/ D programming language version 2.]


The Free Pascal Qt4 binding allows Free Pascal to interface with the C++ Library Qt. This binding does not cover the whole Qt4 framework but only the classes needed by the Cross Platform Lazarus IDE to use Qt as a Widget set. More [http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html info]
===[http://www.isptech.co.uk/qtHaskell/index.html Qt for Haskell] (qtHaskell)===
The qtHaskell project provides a comprehensive set of Haskell bindings for 50 Qt modules with extensive examples and demo programs including qtHaskell versions of Tetrix, DiagramScene, PathDeform and the Qt Asteroids game which uses FRP (Functional Reactive Programming) techniques to control game states and behaviors.


=== [http://www.nongnu.org/libqtlua/ Qt for Lua] (QtLua) ===
===[https://khumba.net/projects/qtah/ Qtah]===


The QtLua library are trying to make Qt4 applications scriptable using the Lua scripting language as an alternative to the QtScript module.
The qtah project provides a set of Haskell bindings for Qt.  


=== [http://qthaskell.berlios.de/ Qt for Haskell] (qtHaskell) ===
**[https://gitlab.com/khumba/qtah Source code and build instructions]


The qtHaskell project provides a set of Haskell bindings for Qt. Haskell programmers can access the "Signals and Slots" interface logic, design interfaces using Qt Designer and write scripted applications using the Qt ECMA/Javascript engine.
===[https://github.com/barche/QML.jl Qt for Julia] (QML.jl)===
This project provides bindings to Julia.


=== [http://www.gekkou.co.uk/software/hsqml/ Qt Quick for Haskell] (HsQML) ===
===[http://www.gekkou.co.uk/software/hsqml/ Qt Quick for Haskell] (HsQML)===


HsQML provides a Haskell binding to the Qt Quick framework. It allows you to write graphical applications where the front-end is written in Qt Quick's QML language (incorporating JavaScript) and the back-end is written in Haskell.
HsQML provides a Haskell binding to the Qt Quick framework. It allows you to write graphical applications where the front-end is written in Qt Quick's QML language (incorporating JavaScript) and the back-end is written in Haskell.


=== [http://kakadu.github.io/lablqt/ Qt Quick for OCaml] (lablqt) ===
===[https://github.com/Kakadu/lablqml Qt Quick for OCaml] (lablqml)===
 
QML Bindings to OCaml.
 
===[https://github.com/nodegui/nodegui Node.js and Qt Widgets] (NodeGui)===
Build performant, native and cross-platform desktop applications with '''Node.js''' and '''CSS like styling'''.  NodeGUI is powered by Qt Widgets  which makes it CPU and memory efficient as compared to other chromium based solutions like electron.


=== [http://sourceforge.net/projects/php-qt/ Qt for PHP] (PHP-Qt) ===
===[https://github.com/BrigJS/brig Qt Quick for Node.js] (Brig)===
Qt Quick: The Brig project provides library for Qt Quick framework, making it possible to write graphical applications in JavaScript and QML languages.


=== [http://wiki.call-cc.org/eggref/4/qt Qt for Chicken Scheme] (Qt 4 egg) ===
===[https://github.com/Nelson-numerical-software/nelson QML bindings for Nelson language]===
Nelson is an array programming language providing a powerful open computing environment for engineering and scientific applications using modern C/C++ libraries and others state of art numerical libraries.


An incomplete binding which supports loading UI files, binding to GUIs thus instantiated, and networking and dbus functionality.
The QML engine enables nelson programs to display and manipulate graphical content using Qt's QML framework.
see some examples: https://www.youtube.com/watch?time_continue=1&v=L3fsg4zhTjE

Latest revision as of 14:30, 13 April 2023

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

Programming Language Support & Language Bindings

The Qt API is implemented in C++, and provides additional features for easier cross-platform development. QML – introduced with Qt Quick and JavaScript-like declarative, language designed to describe the user interface of a program: both what it looks like, and how it behaves. As an alternative to using C++, Qt offers other languages, including Python . Officially, Python bindings are being maintained by the project, under the name of Qt for Python.

C++ Development with Qt

Qt provides an intuitive C++ class library with a rich set of application build blocks for C++ development. Qt goes beyond C++ in the areas of inter-object communication and flexibility for advanced GUI development. Qt adds the following features to C++:

QML Development with Qt Quick

QML is a declarative, JavaScript-based language designed to describe the user interface of a program: both what it looks like, and how it behaves. In QML, a user interface is specified as a tree of objects with properties, like in JSON.

  • JavaScript, HTML and CSS skills can be used to code complete front-end apps
  • Optimized for touch-based, animated mobile UIs
  • Includes a set of graphical and behavioral building blocks: QML Types
  • No C++ knowledge required for UI creation, while it can be extended with C++

Find out more about Qt Quick

Qt for Python

The Qt for Python project provides the PySide2 module allowing users to develop Qt and QML application easily from Python.

  • You can find more information for the project, which is currently available as a Technical Preview, in the wiki page.
  • Compatible with Qt 5.11, and Python 2.7 and 3.5+.

Qt for Python (PySide2) is the official set of Python wheels that The Qt Company provides.

Find out more about Qt for Python

These are third party language bindings for Qt

Qt for Python (PyQt)

(PyQt is developed by Riverbank Computing, not to be confused with Qt for Python (PySide) from TQtC)

Qt for Ring (RingQt)

RingQt is a binding of the Qt framework to the Ring programming language.

Ring uses Qt as its toolkit to provide cross-platform abilities.

Qt for Java and Kotlin (QtJambi)

QtJambi is Qt bindings for the Java programming language originally developed by Trolltech, the predecessor of The Qt Company.

The successive open source project provides bindings of Qt5 and Qt6 releases for latest Java JDK versions, GraalVM and Kotlin.

Qt for Rust (CXX-Qt)

Safe interop between Rust and Qt using CXX

CXX-Qt is a set of Rust crates for creating bidirectional Rust ⇄ C++ bindings with Qt. It can be used to integrate Rust into C++ applications using CMake or used to build Rust applications with Cargo. CXX-Qt provides tools for implementing QObject subclasses in Rust which can be used from C++, QML, and JavaScript.

Qt for Rust (Rust-Qt)

Qt bindings for the Rust language

Qt Quick for Rust (qmetaobject-rs)

QML bindings for the Rust language

Qt Quick for Rust (qml-rust)

Qt Quick for Rust (qmlrs)

Qt Quick for Zig (qml_zig)

  • QML bindings for the Zig language

Qt Quick for Zig (zqml)

  • QML bindings for the Zig language

Qt for Crystal (qt5.cr)

  • Qt bindings for the Crystal language

Qt for Nim (nimqt)

  • Qt bindings for Nim

Qt Quick for Nim (nimqml)

  • QML bindings for Nim

Qt for Go (qt)

Qt for Java (javacpp-presets)

  • Qt bindings for Java

Qt for C#/Mono/.Net (QtSharp)

This project aims to create Mono/.NET libraries that wrap Qt thus enabling its usage through C#. It relies on the excellent CppSharp.

Qt for C#/Mono/.Net (Qml.Net)

Qml.Net is cross-platform integration of Qml/QtQuick for .NET Core/.NET Framework/Mono. It is a binding that brings .NET types into JavaScript with full interoperability.

Qt for D (QtE5)

QtE5 is a binding of the Qt framework to the D programming language version 2.

Qt for Haskell (qtHaskell)

The qtHaskell project provides a comprehensive set of Haskell bindings for 50 Qt modules with extensive examples and demo programs including qtHaskell versions of Tetrix, DiagramScene, PathDeform and the Qt Asteroids game which uses FRP (Functional Reactive Programming) techniques to control game states and behaviors.

Qtah

The qtah project provides a set of Haskell bindings for Qt.

Qt for Julia (QML.jl)

This project provides bindings to Julia.

Qt Quick for Haskell (HsQML)

HsQML provides a Haskell binding to the Qt Quick framework. It allows you to write graphical applications where the front-end is written in Qt Quick's QML language (incorporating JavaScript) and the back-end is written in Haskell.

Qt Quick for OCaml (lablqml)

QML Bindings to OCaml.

Node.js and Qt Widgets (NodeGui)

Build performant, native and cross-platform desktop applications with Node.js and CSS like styling. NodeGUI is powered by Qt Widgets which makes it CPU and memory efficient as compared to other chromium based solutions like electron.

Qt Quick for Node.js (Brig)

Qt Quick: The Brig project provides library for Qt Quick framework, making it possible to write graphical applications in JavaScript and QML languages.

QML bindings for Nelson language

Nelson is an array programming language providing a powerful open computing environment for engineering and scientific applications using modern C/C++ libraries and others state of art numerical libraries.

The QML engine enables nelson programs to display and manipulate graphical content using Qt's QML framework. see some examples: https://www.youtube.com/watch?time_continue=1&v=L3fsg4zhTjE