Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Qt (software)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Qt software architecture == [[File:Free and open-source-software display servers and UI toolkits.svg|thumb|upright=1.35|Example of Qt usage in Linux-based systems]] === Qt concepts === Qt is built on these key concepts: ;Complete abstraction of the GUI: When first released, Qt used its own paint engine and controls, emulating the look of the different platforms it runs on when it drew its widgets. This made the porting work easier because very few classes in Qt really depended on the target platform; however, this occasionally led to slight discrepancies where that emulation was imperfect. Recent versions of Qt use the native style APIs of the different platforms, on platforms that have a native widget set, to query metrics and draw most controls, and do not suffer from such issues as often.<ref>{{cite web|url=http://qt.digia.com/Product/Qt-Core-Features--Functions/Library/|title=Library|quote=Qt uses the native graphics APIs of each platform it supports, taking full advantage of system resources and ensuring that applications have native look and feel.|publisher=Digia|url-status=dead|archive-url=https://web.archive.org/web/20131101011752/http://qt.digia.com/Product/Qt-Core-Features--Functions/Library/|archive-date=1 November 2013}}</ref> On some platforms (such as MeeGo and KDE) Qt ''is'' the native API. Some other portable graphical toolkits have made different design decisions; for example, [[wxWidgets]] uses the toolkits of the target platform for its implementations. ;[[Signals and slots]]: A language construct introduced in Qt for communication between objects<ref>{{cite web|url=https://doc.qt.io/qt-5/signalsandslots.html |title=Signals & Slots - QtCore 5.1 |publisher=Qt Project |date=4 July 2013|access-date=10 April 2015}}</ref> which makes it easy to implement the [[observer pattern]] while avoiding [[boilerplate code]]. The concept is that GUI [[GUI widget|widgets]] can send signals containing event information which can be received by other controls using special functions known as slots. ;Metaobject compiler: The [[metaobject]] compiler, termed ''moc'', is a tool that is run on the sources of a Qt program. It interprets certain macros from the C++ code as annotations, and uses them to [[Automatic programming|generate added C++ code]] with meta information about the classes used in the program. This meta information is used by Qt to provide programming features not available natively in C++: signals and slots, [[Type introspection|introspection]] and asynchronous function calls. ;Language bindings:Qt can be used in several [[programming language]]s other than C++, such as Python, Javascript, C# and Rust<ref> {{cite web|url=https://www.vandenoever.info/blog/2018/10/30/building_qt_apps_with_cargo.html|title=Qt applications with Cargo|date=30 October 2018|website=www.vandenoever.info|access-date=25 April 2019}}</ref> via [[language binding]]s; many languages have [[list of language bindings for Qt 5|bindings for Qt 5]] and [[list of language bindings for Qt 4|bindings for Qt 4]]. === Qt modules === Starting with Qt 4.0 the framework was split into individual modules.<ref>{{cite web|url=https://dot.kde.org/2005/06/28/trolltech-releases-qt-40|title=Trolltech Releases Qt 4.0|publisher=[[KDE]]|date=28 June 2005|access-date=5 August 2013}}</ref><ref>{{cite web |url=https://qt-project.org/doc/qt-4.8/modules.html |title=All Modules | Documentation |publisher=[[Qt Project]] |access-date=8 April 2013 |archive-url=https://web.archive.org/web/20130329130752/http://qt-project.org/doc/qt-4.8/modules.html |archive-date=29 March 2013 |url-status=dead }}</ref> With Qt 5.0 the architecture was modularized even further.<ref>{{cite web|author=Qt Blog |url=https://blog.qt.io/blog/2012/12/19/qt-5-0/ |title=Introducing Qt 5.0 | Qt Blog |publisher=Digia |date=19 December 2012 |access-date=8 April 2013}}</ref><ref>{{cite web|url=https://dot.kde.org/2012/12/24/qt-50-congratulations-qt-project|title=Qt 5.0 - Congratulations to the Qt Project|author=Kyle Morris|publisher=KDE|date=24 December 2012|access-date=5 August 2013}}</ref> Qt is now split into ''essential'' and ''add-on'' modules.<ref>{{cite web|url=https://doc.qt.io/qt-6/qtmodules.html |title=Qt 6 Documentation: All Modules |publisher=Qt Project |access-date=1 December 2022}}</ref> ==== Qt essentials ==== {|class="wikitable" |- !style="width:12em"|Module !Description |- | '''Qt Core''' |The only required Qt module, containing classes used by other modules, including the meta-object system, concurrency and threading, containers, event system, plugins and I/O facilities. |- |'''Qt GUI''' |The central GUI module. In Qt 5 this module now depends on [[OpenGL]], but no longer contains any widget classes. |- |'''Qt Widgets''' |Contains classes for classic widget based GUI applications and the QSceneGraph classes. Was split off from '''QtGui''' in Qt 5. |- |'''Qt QML''' |Module for [[QML]] and [[JavaScript]] languages. |- |'''Qt Quick''' |The module for GUI applications written using QML2. |- |'''Qt Quick Controls''' |Widget like controls for '''Qt Quick''' intended mainly for desktop applications. |- |'''Qt Quick Layouts''' |Layouts for arranging items in '''Qt Quick'''. |- |'''Qt Network''' |Network abstraction layer. Complete with support for [[Transmission Control Protocol|TCP]], [[User Datagram Protocol|UDP]], [[HTTP]], [[Transport Layer Security|TLS]], [[Secure Sockets Layer|SSL]] (in Qt 4) and [[SPDY]] (since Qt 5.3). |- |'''Qt Multimedia''' |Classes for audio, video, radio and camera functionality. |- |'''Qt Multimedia Widgets''' |The widgets from '''Qt Multimedia'''. |- |'''Qt SQL''' |Contains classes for database integration using [[SQL]]. |- |'''Qt WebEngine''' |A new set of Qt Widget and QML webview APIs based on [[Chromium (web browser)|Chromium]]. |- |'''Qt Test''' |Classes for unit testing Qt applications and libraries. |} ==== Qt add-ons ==== {|class="wikitable" |- !style="width:12em"|Module !Description |- |'''Active Qt''' |Classes for applications which use [[ActiveX]]. |- |'''Qt Charts''' |Provides functionality and widgets to plot charts of many kinds |- |'''Qt Bluetooth''' |Classes accessing [[Bluetooth]] hardware. |- |'''Qt D-Bus''' |Classes for IPC using the [[D-Bus]] protocol. |- |'''Qt NFC''' |Classes accessing [[near-field communication|NFC]] hardware. Only officially supported on BlackBerry hardware so far (or N9 in the MeeGo port). |- |'''Qt OpenGL''' |Legacy module containing the [[OpenGL]] classes from Qt 4. In Qt 5 the similar functionality in '''Qt GUI''' is recommended. |- |'''Qt Location''' |Classes for accessing [[GPS]] and other location services and for mapping and navigation. Split off from the Qt 4 Mobility module of '''Qt Location'''. Supported on Android, BlackBerry, iOS, Linux (using [[GeoClue]]), Windows and Sailfish OS. |- |'''Qt Quick 3D''' |Classes for rendering [[3D models]], [[video games]], simulations and [[3D user interaction|3D user interfaces]], with a '''Qt QML''' API, into a mixed 2D and 3D [[scene graph]]. |- |'''[[QtScript|Qt Script]]''' |Legacy module for scripting Qt application using ECMAScript/[[JavaScript]]. In Qt 5, using similar classes in '''Qt QML''' is recommended. |- |'''Qt Sensors''' |Classes for accessing various mobile hardware sensors. Used to be part of Qt Mobile in Qt 4. Supported on Android, BlackBerry, iOS, WinRT, Mer and Linux. |- |'''Qt Serial Port''' |Classes for access to hardware and virtual serial ports. Supported on Windows, Linux and macOS. |- |'''Qt WebChannel''' |Provides access to Qt objects to HTML/Js over [[WebSocket]]s. |- |'''Qt WebKit''' |Qt's [[WebKit]] implementation and API. |- |'''Qt WebKit Widgets''' |The widget API for '''Qt WebKit''' |- |'''Qt WebSockets''' |Provides a [[WebSocket]] implementation. |- |'''Qt XML''' |Legacy module containing classes for [[Simple API for XML|SAX]] and [[Document Object Model|DOM]] style [[XML]] APIs. Replaced with QXmlStreamReader and QXmlStreamWriter classes in '''Qt Core'''. |- |'''Qt XML Patterns''' |Support for [[XPath]], [[XQuery]], [[XSLT]] and [[XML Schema (W3C)|XML Schema]] validation. |} === Editions === There are four editions of Qt available: ''Community'', ''Indie Mobile'', ''Professional'' and ''Enterprise''.<ref name = "Qt Download">{{Cite web|url = https://www.qt.io/download/|title = Qt Download page|access-date = 21 November 2014|website = Download Qt|publisher = The Qt Company}}</ref> The Community version is under the open source licenses, while the Indie Mobile, Professional and Enterprise versions, which contain additional functionality and libraries, e.g. Enterprise Controls<ref name = "Qt Download" /> are commercially sold by The Qt Company. === Supported platforms === {{Main|List of platforms supported by Qt}} Qt works on many different platforms; the following are officially supported: {|class="wikitable" |- ! Platform || Description |- | colspan="2" style="text-align: left; background: #eaecf0;" | '''Linux/Unix''' |- |'''X11 ''' |Qt for [[X Window System]] ([[Linux]]<!-- Not officially(?): [[*BSD]], [[HP-UX]], [[Solaris (operating system)|Solaris]], [[AIX]], etc.-->);<ref>{{cite web|url=https://wiki.qt.io/Support_for_Linux_X11 |title=Qt Wiki – Support for Linux/X11 |publisher=Qt Project |date=24 March 2016 |access-date=27 July 2019}}</ref> [[FreeBSD]], [[NetBSD]], [[OpenBSD]], and [[DragonFly BSD]] have community support. |- |'''Wayland''' | Qt applications can switch between graphical backends like X and [[Wayland (display server protocol)|Wayland]] at [[load time]] with the -platform command line option.<ref>{{cite web | url = https://wiki.qt.io/Getting_Started_With_Lighthouse | title = Getting started with Lighthouse | access-date =25 November 2011 }}</ref><ref>{{cite web |url = https://qt.gitorious.org/qt/lighthouse/commit/6c5ea196ff086b92687033208f15e36591dc70f6 |first = Kristian |last = Høgsberg |date = 25 January 2011 |title = Add wayland lighthouse plugin |url-status = dead |archive-url = https://web.archive.org/web/20160203131659/https://qt.gitorious.org/qt/lighthouse/commit/6c5ea196ff086b92687033208f15e36591dc70f6 |archive-date = 3 February 2016 }}</ref> This allows a seamless transition of Qt applications from X11 to Wayland. [[SailfishOS]] uses Wayland only as it does not have X11.<ref>{{cite web |url=https://blog.qt.io/blog/2011/03/18/multi-process-lighthouse/ |title=Multi-process Lighthouse |publisher=Qt Project|first=Jørgen|last=Lind|date=18 March 2011|access-date=21 August 2013}}</ref> |- |'''Android''' |Qt for [[Android (operating system)|Android]]<ref name="Digia">{{cite web|url=https://wiki.qt.io/New-Features-in-Qt-5.1#New_Modules |title=New Features in Qt 5.1 - Support for New Platforms |publisher=Digia |date=3 July 2013 |access-date=10 April 2015}}</ref> (formerly known as Necessitas).<ref>{{cite web |url=https://necessitas.kde.org/ |title=Necessitas project |access-date=10 April 2015 |archive-url=https://web.archive.org/web/20160220103506/https://necessitas.kde.org/ |archive-date=20 February 2016 |url-status=dead }}</ref> |- |'''Embedded Linux''' |Qt for embedded platforms: [[personal digital assistant]], [[smartphone]], etc.<ref>{{cite web |url=https://wiki.qt.io/Support_for_Embedded_Linux |title=Qt Wiki – Support for Embedded Linux |publisher=Qt Project |date=12 August 2011 |access-date=10 April 2015}}</ref> Exists as multiple platforms depending on display technology. [[DirectFB]], [[Linux framebuffer|LinuxFB]] and EGLFS ([[EGL (API)|EGL]] Full Screen). |- | colspan="2" style="text-align: left; background: #eaecf0;" | '''Microsoft platforms''' |- |'''Windows''' |Qt for Microsoft [[Windows 7]],<ref>{{cite web|url=https://wiki.qt.io/Support_for_Windows |title=Qt Wiki – Support for Windows |publisher=[[Qt Project]] |date=11 August 2011 |access-date=11 August 2013}}</ref> [[Windows 8|8]] and [[Windows 10|10]]<ref>{{cite web|url=http://blog.qt.io/blog/2015/04/29/windows-10-support-in-qt/ |title=Windows 10 Support in Qt |publisher=[[The Qt Company]] |date=29 April 2015 |access-date=28 January 2016}}</ref> |- |'''Windows RT''' |Support for [[Windows Runtime|WinRT]]-based [[Windows 10 Mobile]] apps and [[Windows 10 IoT]]<ref name="auto">{{cite web |url=https://doc.qt.io/qt-5/winrt-support.html|title=Qt for WinRT|publisher=[[Qt Project]]|access-date=9 September 2014}}</ref> |- | colspan="2" style="text-align: left; background: #eaecf0;" | '''Apple platforms''' |- |'''macOS''' |Qt for Apple [[macOS]]; supports applications on [[Cocoa (API)|Cocoa]]<ref>{{cite web|url=https://wiki.qt.io/Support_for_Mac_OS_X |title=Qt Wiki – Support for OS X |publisher=Qt Project |date=14 August 2011 |access-date=21 August 2013}}</ref> |- |'''iOS''' |Qt for [[iOS]] platforms ([[iPhone]], [[iPad]])<ref>{{cite web|url=https://doc.qt.io/qt-5/supported-platforms.html |title=Supported Platforms|access-date=1 February 2014}}</ref> |- | colspan="2" style="text-align: left; background: #eaecf0;" | '''Other embedded platforms''' |- |'''Integrity''' |Qt for [[Integrity (operating system)|Integrity]]<ref>{{Cite web|url = https://www.qt.io/qt-framework/#section-4|title = Qt Product pages, Supported platforms|access-date = 21 November 2014|website = Qt - Product - Qt Framework|publisher = The Qt Company}}</ref> |- |'''QNX''' |Qt for [[QNX]]<ref>{{cite web |author=Katherine Barrios |url=http://blog.qt.io/blog/2011/11/29/qt-commercial-formally-supports-qnx-2/ |title=Qt Commercial Formally Supports QNX | Qt Blog |date=29 November 2011 |access-date=13 March 2018}}</ref><ref>{{cite web|url=http://doc.qt.io/qt-5/platform-notes-qnx.html|title=Platform and Compiler Notes - QNX {{!}} Qt 5.10}}</ref> |- |'''VxWorks''' |Qt for [[VxWorks]].<ref>{{cite web |author=Tuukka Turunen |url=https://blog.qt.io/blog/2012/06/28/qt-commercial-for-vxworks-2/ |title=Qt Commercial for VxWorks | Qt Blog |date=28 June 2012 |access-date=13 March 2018}}</ref><ref>{{cite web |url=https://doc.qt.io/qt-5/vxworks.html |title=Qt for VxWorks {{!}} Qt 5.10}}</ref> Only available under a [[proprietary software|proprietary]] (commercial) license. Qt 5.5. |- |'''QT for MCUs''' |QT for MCUs<ref>{{cite web |url=https://doc.qt.io/QtForMCUs-2.8/ |title=Qt for MCUs 2.8.1}}</ref> |} After Nokia opened the Qt source code to the community on [[Gitorious]], various ports appeared. There are also some ports of Qt that may be available, but are not supported anymore. These platforms are listed in [[List of platforms supported by Qt]]. See also there for current community support for other lesser known platforms, such as [[SailfishOS]]. === Licensing === Qt is available under the following free software licenses:<ref name="Qt Licensing">{{cite web |url=https://www.qt.io/faq/ |title=Legal - FAQ - Qt |publisher=The Qt Company|website=www.qt.io|access-date=25 April 2019}}</ref> [[GNU General Public License#Version 2|GPL 2.0]], [[GNU General Public License#Version 3|GPL 3.0]], [[GNU Lesser General Public License|LGPL 3.0]] and [[GNU Lesser General Public License|LGPL 2.1]] (with Qt special exception).<ref name="Qt Licensing 2016">{{cite web |url=http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ |title= New agreement with the KDE Free Qt Foundation and changes for the open source version |publisher= The Qt Company}}</ref><ref>{{cite web |url=https://doc.qt.io/qt-5/lgpl.html |title=Digia Qt LGPL Exception version 1.1}}</ref> Note that some modules are available only under a GPL license, which means that applications which link to these modules need to comply with that license.<ref>{{cite web |url=https://www.qt.io/terms-conditions/ |publisher=[[The Qt Company]] |access-date=7 January 2017 |title=Qt Licensing}}</ref> In addition, Qt has always been available under a commercial license, like the Qt Commercial License,<ref name="Qt Commercial Licenses">{{cite web |url=http://doc.qt.io/qt-5/licensing.html |title=Licenses}}</ref> that allows developing proprietary applications with no restrictions on licensing. === Qt tools === {{See also|Qt Creator}} Qt comes with its own set of tools to ease cross-platform development, which can otherwise be cumbersome due to different set of development tools. [[Qt Creator]] is a cross-platform [[Integrated development environment|IDE]] for C++ and QML. [[Qt Creator#History|Qt Designer]]'s [[GUI]] layout/design functionality is integrated into the IDE, although Qt Designer can still be started as a standalone tool. In addition to Qt Creator, Qt provides [[qmake]], a cross-platform [[Build Automation|build script generation tool]] that automates the generation of Makefiles for development projects across different platforms. There are other tools available in Qt, including the Qt Designer interface builder and the Qt Assistant help browser (which are both embedded in Qt Creator), the Qt Linguist translation tool, uic (user interface compiler), and moc (Meta-Object Compiler).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)