Qt (software)

Qt (read cute english, pronunciation [ kju ː t]) is a C class library for cross-platform, graphical interface. In addition to the development of graphical user interfaces Qt offers comprehensive functions for internationalization and database functions and XML support and is available for various operating systems and graphics platforms such as X11 ( Unix derivatives ), eComStation, Mac OS X, Windows, and as a PDA version. Software Compilation 4 Qt is used in particular in the libraries of KDE, which simultaneously represents the most prominent flagship example of the class library.

The class library is up to version 4.4 both under the GNU General Public License (GPL ) or under a proprietary license. The proprietary license is, however, only required if products are developed with the library, which are under any free license (see Dual licensing system ). Since version 4.5, Qt will also be released under the LGPL.

Qt uses a preprocessor, called MOC (meta object compiler ), so C to skills will be enriched, which are not included in the standard language, such as signals and slots as well as introspection. The thus generated code follows the C standard, so that it can be translated with commercial compilers. Nokia also offers a Java API under the name Qt Jambi as well as building on a QtScript API (ECMAScript ) to. There are also bindings for Python ( PyQt, PySide ), Ruby ( qtruby ), C # ( Qyoto project), Java ( Qt Java), PHP (PHP - Qt ), D ( QTD ), Haskell ( qtHaskell ), Perl ( PerlQt ), Pascal ( Qt4Pas ), Ada ( QtAda ), QtScript with KDE support ( QtScript -smoke ) and Falcon, though this may not supervised by the project itself.

  • 2.1 Qt 3 in Project Trinity
  • 2.2 External Ports
  • 5.1 Library construction
  • 5.2 Programming Example
  • 5.3 Signal - slot concept
  • 5.4 GUI simulation
  • 6.1 Meta -Object Compiler
  • 8.1 Multimedia
  • 8.2 Science and Technology
  • 8.3 Communication
  • 8.4 Games
  • 8.5 Other Applications
  • 9.1 See also
  • 9.2 Literature
  • 9.3 External links
  • 9.4 Notes and references

History

Was of the Norwegian company Trolltech Qt (formerly Quasar Technologies) developed. In early 2008 the company was acquired by Nokia and continued to develop in the Qt Development Frameworks division. In October 2011, Nokia has given the project under the name Qt Project as free software in the hands of the open source community.

Beginnings and development name

Haavard Nord and Eirik Chambe -Eng ( the original developers of Qt and later CEO of Trolltech ) began with the development of Qt in 1991, three years before the company Quasar Technologies was founded. Later they changed the name to Troll Tech and then Trolltech.

The name of Qt comes from the fact that the Q was particularly nice to look after Haavard Nord's taste in his Emacs and the t to Xt (the X toolkit ) remembered.

Qt is pronounced officially as cute the English word. This word is intended to express the views of the developers that the source text and the API of Qt just be cute, what is called in German, among others, as much as sweet, pretty, etc, but also smart.

Licensing

Controversy disputes arose about the year 1998, when it became clear that KDE would prevail as the default desktop on Linux. Since KDE is largely based on Qt, made himself a lot of the open source and free software community worry that such an important part of the system was under commercial control. This led to two developments: first, the Harmony toolkit was developed, which copy the functions from Qt exactly, but should be under a free software license. Second, work began on the Gnome desktop, which should provide functionality similar to KDE, but used the GIMP Toolkit ( GTK ), a free software was, but is programmed in C.

Up to version 1:45 Trolltech used the FreeQt -License for Qt. This was neither an open source still a free license. While it was allowed to view the source code, but modified versions were not allowed to be published. With the release of version 2.0 Trolltech joined the Q Public License ( QPL ), an open -source license, but was classified by the Free Software Foundation as incompatible with the GPL. As the pressure on Trolltech became larger and the Debian project refused because of licensing problems, distribute KDE, Trolltech changed in 2000, the license for the Linux version of the toolkit. Since version 2.2 there must henceforth be the Linux distribution under two licenses: GPL and QPL (see Dual licensing system ).

The first version of Qt had only two variants, Qt/X11 for Unix and Qt / Windows for Windows. The Windows version was only available under a commercial license. Towards the end of 2001, Trolltech released Qt 3.0 with added support for the Mac OS X platform. The Mac OS X version was also available only under a commercial license until June 2003 Trolltech introduced the version 3.2 of the Mac OS X version under the GPL.

In February 2005, Trolltech announced that they would make Qt as of version 4.0 for the Windows platform under the GPL. This was confirmed when in June 2005, Trolltech released a single dual license system for all supported platforms. Today there are for each platform proprietary and open source edition ( GPL Edition).

Since the version 4.3.1 from August 9, 2007 Trolltech admits derogations from the licensed by the GPL open source version, which makes it possible to publish programs that use Qt under a non GPL compatible license. The accepted licenses are entered in a separate list. Furthermore, the source code of the company Trolltech program must be made available to the same extent as he is also available to other users, and the rights of the author to lead discussions about the program and make it available to the source code for each, may not by any remedies ( such as special contracts) to be circumcised.

Trolltech has announced plans to publish additional versions of Qt under the third version of the GPL.

In January 2009, Qt Software announced that version 4.5 will be available under the LGPL. On 3 March 2009, this was released. Through the LGPL, it is possible even without a paid license to develop proprietary software with Qt without having to publish the source code. These changes must be published as source code only to changes to the source code of Qt itself.

In March 2011, Nokia announced that it has submitted its business with commercial licensing and services to Digia. In August 2012, the remaining parts of Digia Location. Digia took over the Nokia Qt Development Department for € 4 million. The price for the acquisition of commercial activity in 2011 has not been announced. 2008 Nokia still paid € 150 million for the acquisition of Trolltech.

Hedge over the KDE Free Qt Foundation

Even before Qt was double- licensed, in 1998 the KDE Free Qt Foundation launched to prevent that Qt would fall in the event of insolvency or acquisition of Trolltech under a more restrictive license than the QPL. It consists of two representatives from Trolltech and the KDE eV, the latter being in doubt, have the majority of votes. If Trolltech should provide more than twelve months no updates ( updates) under an open source license, the "KDE Free Qt Foundation " is entitled to release the last free version of Qt under a BSD license.

Variants

There are the following variants of the Qt toolkit running on different platforms. They are all available in both under LGPL as well as under a proprietary license.

  • Qt/X11 - Qt for the X Window System, which runs on Unix and Unix derivatives such as GNU / Linux, AIX, HP- UX and Solaris.
  • Qt / Windows - Qt for Microsoft Windows ( XP and later ).
  • Qt / Mac Carbon - Qt for Apple Mac OS X - using the Carbon framework from Apple.
  • Qt / Mac Cocoa - Qt for Apple Mac OS X - released with Qt 4.5, the Cocoa framework makes use of Apple.
  • Qt for Embedded Linux ( formerly Qtopia Core, formerly Qt / Embedded) - Qt / Embedded Trolltech introduced a variant that uses the Linux framebuffer instead of the X Window System. This is mainly used in embedded devices based on Linux, for example PDAs, smartphones and embedded Linux.
  • Qt for Windows CE - Qt for Windows CE and Windows Mobile
  • Qt for Symbian S60 - Nokia's Qt for S60 smartphone operating system
  • Qt for Maemo - Qt for Nokia's Maemo smartphone operating system

In addition to the Qt toolkit Qt yet Extended ( formerly Qtopia ), a PDA and smartphone platform existed based on Qt / Embedded. She was known primarily for the Zaurus PDA from Sharp. The development was set on 3 March 2009, in order not to operate alongside Qt parallel development.

Qt 3 in Project Trinity

The Trinity Project, which is developing a spin-off from KDE 3, maintains a fork of Qt 3 and sees himself since November 2011 as a focal point for Qt 3 development. On the part of Nokia's points Knut Yrvin, Community Manager at Trolltech / Nokia on Trinity.

External Ports

After Nokia has released the Qt source code, various ports for the following platforms are yet emerged, some of which are still very experimental: OpenSolaris, Haiku, OS / 2 eCS platform, AmigaOS 4, iPhone, Android, HP webOS ( Palm Pre), Amazon Kindle DX. Digia announced to want to offer up to 2013 ports for iOs and Android. A preview is already included in the current Qt 5.1.

Current Version

Currently stable (English stable) is version 5.2 dated 12 December 2013.

With Qt 4.0 on 28 June 2005, Trolltech has introduced five new techniques:

  • Tulip - A new set of container classes
  • Interview - A MVC architecture for element-based views
  • Arthur - A new 2D drawing framework
  • Scribe - Unicode text output with a public API to support simple text layouts
  • Main Window - A more modern main window architecture, toolbars, menus and dockable windows allows

Qt 4.1 was released on 19 December 2005 and brought SVG -Tiny support, a PDF backend for Qt printing system, and other enhancements and improvements.

Qt 4.2 was released on 4 October 2006 and brought native CSS support for designing widgets. The QCanvas classes of Qt 3.x for representing two-dimensional graphics objects by a framework called QGraphicsView were replaced for rendering graphical objects on the screen.

Since May 30, 2007 is version 4.3 available. She brought enhanced Windows Vista support, improved OpenGL engine, and the ability to generate SVG files. In addition, an ECMAScript engine called QtScript and support for SSL connections have been added.

Qt 4.4 was released on May 6, 2008. First time It includes support for Windows CE, WebKit used as an HTML rendering engine and an improved API for programming multi-threaded applications.

Since March 3, 2009, there is with Qt 4.5, the new development environment Qt Creator, so applications for Linux, Mac OS X and Windows can be generated without additional development tools.

On 1 December 2009, Qt was released in version 4.6, which now supports multi-touch and the platforms Symbian OS and MeeGo.

As of 21 September 2010, Version 4.7 is available. With this version, the declarative Qt Meta Language or Qt Modeling Language ( QML ) finds its way into the library.

On December 15, 2011, Qt was released in version 4.8. The new version offers the Qt Platform Abstraction, threaded OpenGL support and multi-threaded support for HTTP and optimized file system access.

Qt 5.0 was released on 19 December, 2012. The new major version brings inter alia, an OpenGL -based scene graph, the drawing surfaces in Qt's own programming language QML - is said to have written accelerate - also called Qt Meta Language or Qt Modeling Language. In addition QtQuick has been extended to new possibilities for graphical effects based on OpenGL and a canvas -based system for drawing imperative in QtQuick. For Linux Qt 5 offers in addition to the X Window System support for the newer Wayland. Furthermore, the new version provides functions for handling JSON and better support for IPv6. The built- in Qt Web rendering engine QtWebKit will now have full support for HTML5. However, the most important change is the further modularization of the library that enable easier handling of the code and aim to produce a lower memory usage for applications that use only specific parts of the library. Especially the more modular with the result that not Qt 5.0 and not ABI API compatible Qt 4.8. However, it was trying to achieve the widest possible API compatibility, the jump from Qt 4 to Qt 5 therefore does not constitute so strong break down as the version jump 3 to 4

Qt 5.1 was presented on 3 July 2013. Compared with the old version 3000 improvements have been made, and there is an iOS and Android support preliminary. Their full support is promised for Qt 5.2 which is to be completed in late 2013.

Editions

From Qt Development Frameworks

To download a complete development kit (SDK ) is available since Qt 4.5 for Linux, Windows and Mac OS X, the mitliefert addition to the required Qt libraries and the extensive Qt documentation and the GCC compiler and the Qt Creator. In addition, versions of which (ie the developer libraries, and documentation as well as the basic Qt tools) include only the framework offered. These are available for all supported platforms; For Windows, there is also a version for use with the Visual C compiler from Microsoft.

Up to and including version 4.4 was between versions Qt Console ( for the development of programs without GUI), Qt Desktop Light (there are no network, database and OpenGL support, and the Graphics View), Qt desktop (the full library) and the Open Source Edition (the full library for developing open source applications) distinguished. This subdivision does not exist anymore.

From other providers

Since this is free software with Qt, there are also editions other providers:

  • Qt / Windows Free Edition - The KDE / Cygwin project worked on a native Windows version of Qt 3, in view of KDE, which has been ported from the free source code of Qt/X11-Variante and is therefore fully GPL - licensed. The project was started in order to also program free software for Windows can. With the release of Qt 4, this endeavor has lost of attention and is maintained only with smaller patches of qtwin project further. In the future, the project aims to continue its efforts to patch the Qt Open Source Edition of Qt Development Frameworks, so that they then support other compilers (Microsoft, Borland and Embarcadero Technologies).
  • Qt / Haiku - For the open BeOS successor Haiku there is a port of Qt4 under an open source project. Due to the high development effort with respect to a limited number of free programmers each new release of Trolltech is not ported to this platform. The aim of the project is to make Qt based open source applications on the Haiku platform available and thereby increase the supply of native applications.
  • Qt / Amiga - Qt has been ported by a single developer in version 4.5 on the Amiga platform ( AmigaOS 4.X ).
  • Qt iPhone ̣ - The goal of this project is to bring Qt applications on iPhone to run. The QtCore module compiled already, the QtGui module is still under construction.

Design

Library construction

Since version 4.0, the entire library is divided into modules, making smaller and faster programs are possible because only the modules used must be included:

  • QtCore - core classes that are used by all other modules
  • QtGui - components that are used for design of graphical user interfaces ( GUIs)
  • QtNetwork - classes for network programming
  • QtOpenGL - Support for OpenGL
  • QtMultimedia - Low- level access to multimedia devices and files.
  • QtSql - Class for Database Integration with SQL
  • QtXml - classes for using XML
  • QtSvg - classes for use of SVG files (since 4.1)
  • QtDesigner - Classes for extending Qt Designer
  • QtUiTools - classes for dynamic use of Qt Designer forms in applications
  • QtAssistant - Support for Online Help
  • Qt3support - Qt 3 compatibility classes
  • QtTest - tools for testing your own applications
  • WebKit - classes for the representation of Web pages (since 4.4)
  • Phonon (KDE) - classes for the integration of multimedia content (since 4.4)

In the commercial editions are still the modules QAxContainer and QAxServer for ActiveX support available. The Unix variants contain a module called QtDBus for inter-process communication using the D- bus.

As more commercial library there QSA - Qt Script for Applications, which allows developers to extend their Qt applications with scripting capabilities. It is since Qt 4.3, however outdated (support ended on December 1, 2008) and been replaced by the better in many ways QtScript, the ECMAScript / JavaScript compatible.

Programming Example

The following example creates a window with a title which, however, is hidden due to the small window size, a label field (label) and a button (Button). The functions are connected by " signals" and " slots " so that the program is terminated at a click of the button. The two widgets are then drawn in the background and the window finally appears. The sample program is compiled by calling qmake-project && qmake && make within the folder in which the file is located.

# include   int main (int argc, char ** argv ) { / / A QApplication always represents the base QApplication app ( argc, argv );   / / Create a window with a title QWidget window; window.setWindowTitle ( " Qt4 Example" );   / / Create a label with a text QLabel * label = new QLabel ("Hello World!"); label -> setAlignment (Qt :: Align Center );   / / Create a button with shortcut Alt -E, which terminates the application QPushButton * button = new QPushButton ( " & Exit "); QObject :: connect ( button, SIGNAL ( clicked () ), & app, SLOT ( quit () ) );   / / Align Both the label and the button horizontally QVBoxLayout * layout = new QVBoxLayout; layout-> addWidget (label ); layout-> addWidget ( button ); window.setLayout ( layout );   / / Display the window, start the application and return its result ( the operating system ) window.show (); return app.exec (); } User interfaces can be used with either Qt explicitly programmed or designed with Qt Designer.

Signal - slot concept

A special feature is the use of " signals" and " slots ", which provides a simple way to communicate between objects. For most other class libraries by the callback functions (callback function) is realized. From the perspective of the developer callback functions have the advantage of a higher execution speed, but the signal-slot implementation only allows a run-time checking of the call parameters with respect to their type, but not at compile time.

To use the signal-slot approach to the use of the MOC preprocessor is essential that the necessary to test run-time information adds the respective classes.

GUI simulation

Qt used to the newest version of its own character engine and controls. It simulated the different appearance on the various platforms (GUI simulation). This made porting easier, because only very few classes were dependent on the platform used in Qt. The disadvantage was, however, that Qt had to mimic the appearance of each platform precisely what was not always possible. Since Qt 4.0, there are, however, the possibility ( as in many other toolkits such as wxWidgets or SWT) to use the operating system's routines to draw the elements. There is therefore now the native QWindowsVistaStyle, QWindowsXPStyle and QMacStyle. These "styles " only work on the appropriate operating system ( and there are also the default). There are still but also platform-independent "Styles ", this can be easily (eg by command line) to activate.

Tools

In addition to the libraries Qt contains a number of other additional utilities, some of which are essential for working with Qt.

  • The following programs are used by programmers to edit XML files with a comfortable user interface: Qt Designer - to create forms (. * Ui (XML) ) and resource files (*. Qrc (XML) )
  • Qt Linguist - for translations of the program (. * Ts (XML) )
  • The following programs allow for easy translation. To control the Qt project file is used: lupdate - Extracts from all the source code files to be translated strings (. → * ts (XML) )
  • Lrelease -. * ts (XML) → * sqm.
  • Lconvert -. . Converts between * po * ts, * and * xlf sqm files..
  • Qmake - Created with the Qt project file, a Makefile that controls the creation process (* per. ). Besides the usual programs like compilers and linkers also the following programs are used: moc - (. . * h → moc_ * cpp ) Meta -Object Compiler, create meta- information about classes of the program, see below.
  • Uic - user interface compiler generates a C source code from UI files (* ui (XML) → UI_ * h. . )
  • Rcc - Resource Compiler (* qrc (XML) → qrc_ * cpp. . )

To use the online documentation of the Qt Assistant is used, which can also be integrated into your own projects.

Meta -Object Compiler

The Meta -Object Compiler, also known as moc, is a tool which examines the header files of a project and Meta - collects information about classes and other program components. This is done with the help of " marks", which are later removed from the standard preprocessor. From this information, he again created C code, be implemented in the functions which are not available without additional libraries in C , such as introspection and the signal - slot concept. Other macros are expanded in self-written header files to provide the function declarations.

The use of an additional tool was criticized by a part of the C programmers. They claimed that Qt programming is not a C programming more. In fact, the implementation is based on C macros, which are not type-safe and well known, the namespace contaminate. From the perspective of Trolltech but that is necessary to implement the signal - slot concept elegant. As Qt 1.x was released, the compiler differences with respect to generic programming were still too big for you to template classes (templates) could leave. Nor can the pollution of the name space by using the macro QT_NO_KEYWORDS avoid.

Other links

  • Qt Jambi - Since June 2007, developed by Trolltech / Qt version for Java software itself exists. However, this is no longer being developed by Qt Software since version 4.5, but the community it is open source available.
  • PyQt - The British company Riverbank Computing Limited. has a Python API developed under this name, which is available for Windows, Linux / Unix ( X11) and Mac OS X, as before Qt itself, either under the GPL or a commercial license.
  • PySide - Nokia is developing itself to a PyQt Python bindings for Qt4 compatible under the LGPL because PyQt will not be published under this License.
  • PHP - Qt - an open- source project on the use of Qt in PHP scripts
  • Qtruby - the KDE project page can be found bindings for Ruby
  • Qyoto - connecting Qt and KDE libraries to use in C # and other NET languages ​​using Mono.
  • QTD - connecting Qt to the D programming language
  • Qt4Pas - integration of Qt on the programming language Pascal

The following table shows the connection to different programming languages ​​and the degree of implementation of each sub- libraries.

Examples of use

The KDE Software Compilation 4 probably one of the largest and most prominent software project based on Qt. In addition, the library is also widely used in other applications.

Multimedia

Science and Technology

  • The astronomy program Stellarium
  • The graphical user interface of VirtualBox from Oracle, formerly Sun Microsystems
  • The simulation software of ESA
  • The program package Mathematica Wolfram Research Company

Communication

  • The VoIP software Skype ( only in the Linux version )
  • The proprietary voice conferencing software TeamSpeak ( since version 3.0)

Games

  • The racing game Need for Speed: The Run
  • The adventure game Tales of Monkey Iceland

Other Applications

  • The Office library of publishers Duden, Brockhaus and Langenscheidt
  • The virtual globe Google Earth

Appendix

666780
de