Jump to content

Qt (software)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Pattiewillford (talk | contribs) at 09:28, 4 November 2011 (External links). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Qt
Developer(s)Qt Project, Nokia, Digia, KDE
Initial release1992; 32 years ago (1992)
Stable release
4.7.4[1] / September 1, 2011; 13 years ago (2011-09-01)
Preview release
4.8.0 RC1[2] / October 13, 2011; 13 years ago (2011-10-13)
Repository
Written inC++
Operating systemEmbedded Linux, Mac OS X, Microsoft Windows, Linux/X11, Windows CE, Symbian, MeeGo, Haiku, Amiga OS
PlatformCross-platform
TypeApplication framework
LicenseGNU GPL[3] 3, with Qt special exception
GNU Lesser General Public License (LGPL v2.1) (Qt open-source version) [4]
Qt Commercial License (Qt Commercial version)[5]
Websiteqt.nokia.com

Qt (pronounced officially as cute /ˈkjuːt/, though often unofficially pronounced as Q.T. /ˈkjuːˈtiː/[6][7]) is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) (in which cases Qt is classified as a widget toolkit), and also used for developing non-GUI programs such as command-line tools and consoles for servers. Qt is most notably used in Autodesk Maya,[8][9], Adobe Photoshop Elements, OPIE, Skype, VLC media player,[10] VirtualBox, and Mathematica,[11] and by the European Space Agency,[12] DreamWorks,[13][14] Google, HP,[15] KDE[16], Lucasfilm,[17] Panasonic,[18] Philips,[19] Samsung,[20] Siemens,[21] Volvo,[22] and Walt Disney Animation Studios.[23]

It is currently produced by Nokia's Qt Development Frameworks division, which came into being after Nokia's acquisition of the Norwegian company Trolltech, the original producer of Qt.[24] Nokia announced that it is going to drop Symbian technologies and base their future smartphones on Microsoft platform instead in February 2011. One month later Nokia announced the sale of Qt's commercial licensing and professional services to Digia PLC, although Nokia will remain the main development force behind the framework.[25] On 9th May, it was announced on the Qt Labs website that the groundwork was being laid for the next major version of Qt, with the expectation that Qt 5 would be released in 2012. [26]

Qt uses standard C++ but makes extensive use of a special code generator (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, thread management, network support, and a unified cross-platform API for file handling.

Distributed under the terms of the GNU Lesser General Public License (among others), Qt is free and open source software. All editions support a wide range of compilers, including the GCC C++ compiler and the Visual Studio suite.

Platforms

Qt is released by Nokia on the following platforms:

External ports

Since Nokia opened the Qt source code to the community on Gitorious various ports have been appearing. Here are some of them:

Editions

There are three editions of Qt available on each of these platforms, namely:

  • GUI Framework – commercial entry level GUI edition, stripped of network and database support (formerly known as "Desktop Light")
  • Full Framework – complete commercial edition
  • Open Source – complete Open Source edition

Qt is available under the following copyright licenses:

Current

Trolltech released Qt 4.0 on June 28, 2005 and introduced five new technologies in the framework:

  • Tulip A set of template container classes.
  • Interview A model/view architecture for item views.
  • Arthur A 2D painting framework.
  • Scribe A Unicode text renderer with a public API for performing low-level text layout.
  • MainWindow A modern action-based main window, toolbar, menu, and docking architecture.
Version Release Date New Features
4.1 December 19, 2005 Introduced integrated SVG Tiny support, a PDF backend to Qt's printing system, and a few other features.
4.2 October 4, 2006 Introduced Windows Vista support, introduced native CSS support for widget styling, as well as the QGraphicsView framework for efficient rendering of thousands of 2D objects onscreen, to replace Qt 3.x's QCanvas class.
4.3 May 30, 2007 Improved Windows Vista support, improved OpenGL engine, SVG file generation, added QtScript (ECMAScript scripting engine based on QSA).[57]
4.4 May 6, 2008 Features included are improved multimedia support using Phonon, enhanced XML support, a concurrency framework to ease the development of multi-threaded applications, an IPC framework with a focus on shared memory, and WebKit integration.
4.5 March 3, 2009 Major included features are QtCreator, improved graphical engine, improved integration with WebKit, OpenDocument Format write support and new licensing options, as well as Mac OS X Cocoa framework support.
4.6 December 1, 2009 New APIs are Framework Animation, Gestures, Multi-touch. Now supports (as Tier 1) Symbian and (as Tier 2) Windows 7 and Mac OS X 10.6, support extended for some UNIX systems. Improvements have also been made to overall performance.
4.7 September 21, 2010 QML and Qt Quick.


Design

The innovation of Qt when it was first released relied on a few key concepts.

Modules

  • Modules for general software development
    • The QtCore module contains the core non-GUI classes, including the event loop and Qt's signal and slot mechanism. It also includes platform independent abstractions for Unicode, threads, mapped files, shared memory, regular expressions, and user and application settings.
    • The QtGui module contains the majority of the GUI classes. These include a number of table, tree and list classes based on the model-view-controller design pattern. Also provided is a sophisticated 2D canvas widget capable of storing thousands of items including ordinary widgets.
    • The QtMultimedia module implements low-level multimedia functionality.
    • The QtNetwork module contains classes for writing UDP and TCP clients and servers. It includes classes that implement FTP and HTTP clients and support DNS lookups. Network events are integrated with the event loop making it very easy to develop networked applications.
    • The QtOpenGL module contains classes that enable the use of OpenGL in rendering 3D graphics.
    • The QtOpenVG module is a plugin that provides support for OpenVG painting.
    • The QtScript module is an ECMAScript-based scripting engine
    • The QtScriptTools module provides additional components for applications that use QtScript.
    • The QtSql module contains classes that integrate with open-source and proprietary SQL databases. It includes editable data models for database tables that can be used with GUI classes. It also includes an implementation of SQLite.
    • The QtSvg module contains classes for displaying the contents of SVG files. It supports the static features of SVG 1.2 Tiny.
    • The QtWebKit module provides a WebKit-based layout engine as well as classes to render and interact with web content.
    • The QtXml module implements SAX and DOM interfaces to Qt's XML parser.
    • The QtXmlPatterns module provides support for XPath, XQuery, XSLT and XML Schema validation.
    • The Phonon multimedia API provides simple multimedia control.
    • The Qt3Support module provides classes that ease porting from Qt 3 to Qt 4.
    • The Qt Declarative [58] module is a declarative framework for building fluid user interfaces in QML
  • Modules for working with Qt's tools
    • QtDesigner
    • QtUiTools
    • QtHelp
    • QtTest
  • Modules for Unix developers
    • The QtDBus module is a library that you can use to perform Inter-Process Communication using the D-Bus protocol.
  • Modules for Windows developers
    • The QAxContainer module is an extension for accessing ActiveX controls and COM objects.
    • The QAxServer module is a static library that you can use to turn a standard Qt binary into a COM server.

Use of native UI-rendering APIs

Qt used to emulate the native look of its intended platforms, which occasionally led to slight discrepancies where that emulation was imperfect. Recent versions of Qt use the native style APIs of the different platforms to query the platform for the desired appearance of the Qt controls, and so do not suffer from such issues as much.[59]

One should note that, on some platforms (such as MeeGo and KDE), Qt is the native API.

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 generate additional 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++: the signal/slot system, introspection and asynchronous function calls.

QtScript ECMAScript interpreter

QtScript is a cross-platform toolkit that allows developers to make their Qt/C++ applications scriptable using an interpreted scripting language: Qt Script (based on ECMAScript/JavaScript).

From Qt 4.3.0 onward, the scripting API,[60] which is based on QSA,[61] is integrated as a core part of Qt and is no longer a separate library.

Bindings

As shown in the table below, Qt has a range of bindings for various languages[62] that implement some or all of its feature set.

Qt language bindings
Language Name - description of binding QtCore QtDesigner QtGui Equivalent for uic QtNetwork QtOpenGL QtSql QtScript QtSvg QtTest QtUiTools QtWebKit QtXml License for open-source apps License for proprietary applications
Ada QtAda Yes Yes Yes No No[63] Yes Yes No No No Yes No Yes GNU GPL GMGPL + fee
C++ Qt – native C++ Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes GPL or LGPL LGPL or Proprietary + fee
C# & .NET Qyoto – See also Kimono for KDE Yes Yes Yes Yes (uics) Yes Yes Yes Yes Yes Yes Yes Yes Yes
C# & .NET qt4dotnet Yes Yes WIP[64] Yes Yes Yes Yes Yes Yes Yes Yes Yes LGPL LGPL
D QtD Yes Yes Yes Yes (duic) Yes Yes No No Yes No No Yes Yes Boost Software License+GPL Boost Software License+GPL
Haskell Qt Haskell No
Harbour hbqt Yes Yes Yes Yes (hbmk2) Yes No Yes No No No No Yes No GNU GPL LGPL like
Java Qt Jambi Yes Yes Yes Yes (juic) Yes Yes Yes Yes Yes Yes Yes Yes Yes LGPL LGPL
Lisp CommonQt – Bindings for Common Lisp Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes BSD License BSD License
Lua lqt - Bindings Yes Yes Yes No Yes Yes Yes Yes Yes No Yes Yes Yes MIT MIT
Lua QtLua - Bindings and script engine LGPL LGPL
Pascal FreePascal Qt4
Perl PerlQt – See also PerlKDE for KDE Yes Yes Yes Yes (puic) Yes Yes Yes Yes Yes Yes Yes Yes Yes GNU GPL No
PHP PHP-Qt Yes Yes Yes WIP Yes Yes Yes Yes Yes Yes Yes Yes Yes LGPL LGPL
Python PyQt Yes Yes Yes Yes (pyuic) Yes Yes Yes Yes Yes Yes Yes Yes Yes GNU GPL Proprietary + fee
Python PySide – from OpenBossa (a subsidiary of Nokia). Yes Yes Yes Yes (pysideuic) Yes Yes Yes Yes Yes Yes Yes Yes LGPL LGPL
Python PythonQt LGPL LGPL
QML QML – It is part of the Qt Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes LGPL LGPL or Proprietary + fee
R qtbase Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes GPL No
Ruby QtRuby Yes Yes Yes Yes (rbuic) Yes Yes Yes Yes Yes Yes Yes Yes Yes LGPL LGPL
Scheme Qt Egg for Chicken Scheme No Yes Yes No Yes Yes No No No No Yes No No BSD License BSD License
Tcl qtcl No GNU GPL No
Language Name - description of binding QtCore QtDesigner QtGui Equivalent for uic QtNetwork QtOpenGL QtSql QtScript QtSvg QtTest QtUiTools QtWebKit QtXml License for open-source apps License for proprietary applications

Qt hello world

#include <QtGui>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QLabel label("Hello, world!");
    label.show();
    return app.exec();
}

Compiling and executing Qt hello world program

1. Create a folder named Hello (or any other name)
2. Copy and paste the above program as file Hello.cpp in directory Hello
3. With Hello as the current directory, run

 a. qmake -project
 b. qmake Hello.pro (or whatever the file is named)
 c. make/gmake/nmake - as needed by OS and compiler environment

4. Execute ./release/Hello (Or release\Hello.exe in Windows)

Tools

  • Qt Creator, a cross-platform IDE for C++ and QML
  • qmake, a tool that automates the generation of Makefiles for development project across different platforms
  • Qt Designer
  • Qt Assistant
  • Qt Linguist
  • lupdate
  • lrelease
  • lconvert
  • QVFb
  • makeqpf
  • uic (User Interface Compiler)
  • rcc (Resource Compiler)
  • qtconfig
  • qconfig
  • qtdemo
  • qt3to4
  • qdbusxml2cpp
  • D-Bus Viewer
  • Qt Visual Studio Add-in
  • Qt Eclipse Integration
  • Qt Simulator
  • Nokia Smart Installer for Symbian
  • qmlviewer
  • Qt Quick, a QML based user interface development kit

Migration tools

History

Haavard Nord and Eirik Chambe-Eng (the original developers of Qt and the CEO and President, respectively, of Trolltech) began development of "Qt" in 1991, three years before the company was incorporated as Quasar Technologies, then changed the name to Troll Tech and then to Trolltech.

The toolkit was called Qt because the letter Q looked appealing in Haavard's Emacs font, and "t" was inspired by Xt, the X toolkit.[65]

The first two versions of Qt had only two flavors: Qt/X11 for Unix and Qt/Windows for Windows. The Windows platform was only available under a proprietary license, which meant free/open source applications written in Qt for X11 could not be ported to Windows without purchasing the proprietary edition.

At the end of 2001, Trolltech released Qt 3.0, which added support for Mac OS X. The Mac OS X support was available only in the proprietary license until June 2003, when Trolltech released Qt 3.2 with Mac OS X support available under the GPL.

In June 2005, Trolltech released Qt 4.0.[66]

Nokia acquired Trolltech ASA on June 17, 2008 and changed the name first to Qt Software, then to Qt Development Frameworks. Since then it focused on Qt development to turn it into the main development platform for its devices, including a port to the Symbian S60 platform. Version 1.0 of the Nokia Qt SDK was released on 23 June 2010.[67] The source code was made available over Gitorious, a community oriented git source code repository, in order to gather an even broader community that is not only using Qt but also helping to improve it.

Licensing

At all times, Qt was available under a commercial license that allows the development of proprietary applications without restrictions on licensing. In addition, Qt has been gradually made available under a number of increasingly free licenses.

Until version 1.45, source code for Qt was released under the FreeQt license. This was viewed as not compliant with the open source principle by the Open Source Initiative and the free software definition by Free Software Foundation because while the source was available, it did not allow the redistribution of modified versions.

Controversy erupted around 1998 when it became clear that KDE’s KDE Software Compilation was going to become one of the leading desktop environments for Linux. As it was based on Qt, many people in the free software movement worried that an essential piece of one of their major operating systems would be proprietary.

With the release of version 2.0 of the toolkit, the license was changed to the Q Public License (QPL), a free software license but one regarded by the Free Software Foundation as incompatible with the GPL. Compromises were sought between KDE and Trolltech whereby Qt would not be able to fall under a more restrictive license than the QPL, even if Trolltech was bought out or went bankrupt. This led to the creation of the KDE Free Qt foundation, which guarantees that Qt would fall under a BSD-style license should no free/open source version of Qt be released during 12 months.

In 2000, Qt 2.2 was released under the GPL v2,[68] ending all controversy regarding GPL compatibility.

In 2002, members of the KDE on Cygwin project began porting the GPL licensed Qt/X11 code base to Windows.[69] This was in response to Trolltech's refusal to license Qt/Windows under the GPL on the grounds that Windows was not a free/open source software platform.[70][71] The project achieved reasonable success although it never reached production quality.

This was resolved when Trolltech released Qt/Windows 4 under the GPL in June 2005. Qt 4 now supports the same set of platforms in the free software/open source editions as in the proprietary edition, so it is now possible to create GPL-licensed free/open source applications using Qt on all supported platforms. The GPL v3 with special exception[72] was later added as an additional licensing option. The GPL exception allows the final application to be licensed under various GPL-incompatible free software/open source licenses such as the Mozilla Public License.

On January 14, 2009, Qt version 4.5 added another option, the LGPL,[73] which should make Qt even more attractive for non-GPL open source projects and for closed applications.[74]

Uses

UI Environments

Window Managers for the X Window system

The following window managers utilize the Qt toolkit:

Applications

Software libraries

See also

Other widget toolkits

  • Wt, a C++ library and application server for developing and deploying web applications. It resembles Qt, using also a widget tree and event-driven signal/slot programming model.
  • GTK+, another widely used open-source widget toolkit.
  • wxWidgets - cross platform open source C++ widgets toolkit developed by community

References

Notes

  1. ^ "Qt 4.7.4 released". 1 September 2011. Retrieved 2011-09-02.
  2. ^ "Qt 4.8.0 Release Candidate available". 13 October 2011. Retrieved 2011-10-24.
  3. ^ a b "Qt GNU GPL v. 3.0 Version".
  4. ^ a b "Qt GNU LGPL v. 2.1 Version".
  5. ^ a b "Qt Commercial version under the Qt Commercial License".
  6. ^ "That Smartphone Is So Qt". Ashlee Vance. The New York Times. 16 February 2010. Retrieved 2010-02-19.
  7. ^ "The Qt 4 Dance" (video). Retrieved 2010-02-19.
  8. ^ "Qt in Autodesk".
  9. ^ "Qt in visual effects".
  10. ^ "Qt in VideoLan Player".
  11. ^ "Qt delivered advanced, cross-platform C++ GUI for Mathematica's development team".
  12. ^ "Qt in the European Space Agency".
  13. ^ "Behind the Scenes at DreamWorks Animation: Making the Apps that Make the Movies".
  14. ^ "UI & System Design Challenges for the NxG Lighting Tool".
  15. ^ "Developing Innovative Desktop and Embedded HP Products with Qt".
  16. ^ "The KDE development platform".
  17. ^ "Lucasfilm Entertainment Company Ltd".
  18. ^ "Panasonic selects Qt for HD video system".
  19. ^ "Qt in IP Communications".
  20. ^ "Qt in Home Media".
  21. ^ "Qt helped Siemens deliver a C++ development platform for manufacturing software GUIs".
  22. ^ "Volvo Mobility Systems".
  23. ^ "Qt helped Walt Disney reduce development time spent on its cross-platform feature film production application".
  24. ^ Qt Software — Nokia acquired Trolltech
  25. ^ Nystrom, Sebastian (2011-03-07). "Nokia and Digia working together to grow the Qt community". Retrieved 2011-03-08.
  26. ^ ">Knoll, Lars (2011-05-09). "Thoughts about Qt 5". Retrieved 2011-05-09.
  27. ^ Qt Wiki - Support for Linux/X11
  28. ^ Qt Wiki - Support for Mac OS X
  29. ^ Qt Wiki - Support for Windows
  30. ^ Qt Wiki - Support for Embedded Linux
  31. ^ Qt Wiki - Support for Windows CE and Windows Mobile
  32. ^ Qt Wiki - Support for Symbian
  33. ^ Nokia - Nokia enriches application development with Qt for S60
  34. ^ Qt for S60 - Forum Nokia Wiki
  35. ^ Symbian - Nokia enriches application development with Qt for S60
  36. ^ All About Symbian - Nokia Announce Technology preview of Qt on S60
  37. ^ ars technica - Nokia releases first Qt preview for Symbian S60
  38. ^ Qt Labs Blogs - We’re porting Qt to S60!
  39. ^ Qt Software — Technology Preview - Qt for S60
  40. ^ Qt Software — How to get Qt running on your S60 phone
  41. ^ David Wood: S60 / Avkon are dead
  42. ^ Qt Wiki - Qt on Maemo/MeeGo
  43. ^ "Getting started with Lighthouse". Retrieved 17 December 2010.
  44. ^ Kristian Høgsberg (25 January 2011). "Add wayland lighthouse plugin".
  45. ^ KDE on OpenSolaris
  46. ^ Qt Applications and UI Framework for Haiku
  47. ^ Qt 4 Application and UI Framework for eCS
  48. ^ OS4Depot page for "First Alpha release of Qt 4.7 for AmigaOS Native"
  49. ^ Experimental development of qt for the iPhone
  50. ^ Qt-iPhone project
  51. ^ Qt webOS port
  52. ^ Blog: Qt on the Palm Pre
  53. ^ Blog: Qt on Amazon Kindle DX
  54. ^ Necessitas project
  55. ^ "First Alpha of Qt For Android Released". Slashdot. February 22, 2011. Retrieved February 22, 2011.
  56. ^ Github project
  57. ^ Trolltech: What’s New in Qt 4.3
  58. ^ [1]
  59. ^ Products - Qt – A cross-platform application and UI framework '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.'
  60. ^ Qt 4.3: QtScript Module
  61. ^ QSA 1.2: Qt Script for Applications
  62. ^ QT Language Bindings
  63. ^ [2] Supported Qt modules in QtAda
  64. ^ http://code.google.com/p/qt4dotnet/#Known_problems_/_missing_features
  65. ^ "A Brief History of Qt". Retrieved 2007-12-20.
  66. ^ http://dot.kde.org/2005/06/28/trolltech-releases-qt-40
  67. ^ http://labs.trolltech.com/blogs/2010/06/23/nokia-qt-sdk-10-released/
  68. ^ http://qt.nokia.com/about/news/archive/00000043 Trolltech offers a choice in licensing with the addition of GPL licensing for the upcoming release of Qt
  69. ^ Q../Windows Edition history, 5 June 2006
  70. ^ E-mail to the kde-cygwin mailing list by Chris January, 4 February 2003
  71. ^ Qt Non-commercial FAQ, 5 October 2003
  72. ^ Nokia Corporation Qt GPL Exception Version 1.3
  73. ^ LGPL License Option Added to Qt January 14, 2009
  74. ^ ICS Whitepaper on the Implications of Qt under LGPL for Commercial and Government users
  75. ^ "Razor-qt Project".
  76. ^ Egg Window Manager

Bibliography