Jump to content

Qt (software): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Neurocod (talk | contribs)
Bulletxt (talk | contribs)
No edit summary
Line 175: Line 175:


<!-- Only applications with Wikipedia articles, please -->
<!-- Only applications with Wikipedia articles, please -->
* [[AcetoneISO]], a software to mount most common images
* [[Adobe Photoshop Album]], an image organizing application<ref>[http://www.qtsoftware.com/qt-in-use/story/app/adobe-photoshop-album Qt Software — Adobe Photoshop Elements Album]</ref>
* [[Adobe Photoshop Album]], an image organizing application<ref>[http://www.qtsoftware.com/qt-in-use/story/app/adobe-photoshop-album Qt Software — Adobe Photoshop Elements Album]</ref>
* [[Avidemux]], a [[Free Software]] program designed for multi-purpose [[non-linear editing system|video editing]] and processing, has a Qt frontend since version 2.4
* [[Avidemux]], a [[Free Software]] program designed for multi-purpose [[non-linear editing system|video editing]] and processing, has a Qt frontend since version 2.4

Revision as of 23:46, 6 November 2009

Qt
Developer(s)Qt Development Frameworks (formerly known as Trolltech)
Stable release
4.5.3 / October 1, 2009; 15 years ago (2009-10-01)
Repository
Written inC++
Operating systemCross-platform
TypeWidget toolkit
LicenseGNU LGPL
GNU GPL with Qt special exception
Proprietary[1]
Websiteqt.nokia.com

Qt (pronounced as the English word "cute"[2]) is a cross-platform application development framework, widely used for the development of GUI programs (in which case it is known as a widget toolkit), and also used for developing non-GUI programs such as console tools and servers. Qt is most notably used in Adobe Photoshop Album, Google Earth, KDE, Opera, OPIE, Skype, Qt Extended, and VirtualBox. It is 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, on June 17, 2008.[3]

Qt uses standard C++, but makes extensive use of the C pre-processor to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on all major platforms, and 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.

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.[4]

Controversy erupted around 1998 when it became clear that KDE was going to become one of the leading desktop environments for Linux. As KDE 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.

This gave rise to two efforts: the Harmony toolkit, which sought to duplicate the Qt Toolkit under a free software license, and the GNOME desktop, which intended to supplant KDE entirely. The GNOME Desktop uses the GTK+ toolkit, which was originally written for the GIMP, and primarily uses the C programming language.

The first two versions of Qt had only two flavours: Qt/X11 for Unix and Qt/Windows for the Windows platform. The Windows platform was only available under the proprietary license which meant free/open source applications written in Qt for X11 could not be ported to Windows without purchasing the QPL edition. In the end of 2001, Trolltech released Qt 3.0 which added support for the Mac OS X platform. The Mac OS X support was available only in the proprietary license, until June 2003, where Trolltech released Qt 3.2 with Mac OS X support available under the GPL.

In 2002 members of the KDE on Cygwin project began porting the GPL licensed Qt/X11 code base to Windows.[5] This was in response to Trolltech's refusal to license Qt/Windows under the GPL on the grounds that Windows was not a free software/open source platform.[6][7] 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.

Nokia acquired Trolltech ASA in 2008 and changed the name first to Qt Software, then to Qt Development Frameworks. Since then it has focused on Qt development to turn it into the main development platform for its devices, including a port to the Symbian S60 platform. Also the source code was made available over Gitorious, an community oriented git source code repository, in order to gather an even broader community that is not just using Qt, but also helping to improve it.

License

At all times, Qt was available under a commercial license which allows the development of proprietary applications without restrictions on licensing. In addition to that, Qt was at all times licensed under an increasing number of increasingly free licenses:

Until version 1.45, source code for Qt was released under the FreeQt license — which 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.

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 were 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 software/open source version of Qt be released during 12 months.

Later, the GPL v2 and subsequently v3 with special exception[8] were added as licensing options. The GPL exception allows the final application to be licensed under various GPL-incompatible free software/open source licenses such as the Artistic License.

As announced on January 14, 2009, Qt version 4.5 adds another option, the LGPL, [9] which should make Qt even more attractive for non-GPL open source projects and for closed applications.[10]

All editions support a wide range of compilers, including the GCC C++ compiler and the Visual Studio suite.

Varieties

Qt is released by Nokia on the following platforms:

Qt Software on October 20, 2008 announced a version of Qt on S60 platform.[12][13][14][15][16][17][18][19] Qt is to replace Nokia's Avkon as the supported UI SDK for the development of Symbian applications by Symbian^4.[2]

In addition to the editions of Qt above, the following products exist but commercial support and development has stopped[20][21]:

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

External ports

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

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.

Qt 4.1, released on December 19, 2005, introduced integrated SVG Tiny support, a PDF backend to Qt's printing system, and a few other features.

Qt 4.2, released on 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.

Qt 4.3, released on May 30, 2007, improved Windows Vista support, improved OpenGL engine, SVG file generation, added QtScript (ECMAScript scripting engine based on QSA).[24]

Qt 4.4, released on 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.

Qt 4.5, released on 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.

Bindings

Qt has a range of bindings for various languages which implement some or all of its widget set.

Migration tools

Design

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

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 APIs of the different platforms to draw the Qt controls, and so do not suffer from such issues.[25]

Meta object compiler

Known as the moc, this 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.

Criticism

The use of an additional tool has been criticized for making Qt programming different from pure C++ programming. In particular, the choice of an implementation based on macros has been criticized for its absence of type safety and pollution of the namespace.[3] Implementations in native C++ exist in other libraries, but Trolltech viewed macros as a necessary trade-off to provide introspection and the dynamically generated slot and signal mechanism.[4]

QtScript ECMAScript interpreter

Qt Script for Applications 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,[26] which is based on QSA,[27] is integrated as a core part of Qt and is no longer a separate library.

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
2. Copy paste the above program as Hello.cpp in folder Hello
3. At Hello folder run

 a. qmake -project
 b. qmake 
 c. make/gmake/nmake - as needed by OS and your compiler setups

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

Application development support

There are many applications already written for Maemo based on the previous Internet Tablets. The Nokia N900 also supports Qt. The Forum Nokia Wiki has quality-controlled articles which support Qt development. The Maemo operating system has a development group on the Forum Nokia Wiki at Forum Nokia Wiki Maemo.
The programming language Python is supported along with C++. The Qt for Symbian development group has many quality-controlled articles available.

Applications built using Qt

Popular examples of applications which use Qt include:

References

  1. ^ http://www.qtsoftware.com/products/licensing
  2. ^ http://video.google.com/videoplay?docid=-1435432529445611697
  3. ^ Qt Software — Nokia acquired Trolltech
  4. ^ "A Brief History of Qt". Retrieved 2007-12-20.
  5. ^ Q../Windows Edition history, 5 June 2006
  6. ^ E-mail to the kde-cygwin mailing list by Chris January, 4 February 2003
  7. ^ Qt Non-commercial FAQ, 5 October 2003
  8. ^ Nokia Corporation Qt GPL Exception Version 1.3
  9. ^ LGPL License Option Added to Qt January 14, 2009
  10. ^ ICS Whitepaper on the Implications of Qt under LGPL for Commercial and Government users
  11. ^ Qt Software — Qt for Windows CE
  12. ^ Nokia - Nokia enriches application development with Qt for S60
  13. ^ Qt for S60 - Forum Nokia Wiki
  14. ^ Symbian - Nokia enriches application development with Qt for S60
  15. ^ All About Symbian - Nokia Announce Technology preview of Qt on S60
  16. ^ ars technica - Nokia releases first Qt preview for Symbian S60
  17. ^ Qt Labs Blogs - We’re porting Qt to S60!
  18. ^ Qt Software — Technology Preview - Qt for S60
  19. ^ Qt Software — How to get Qt running on your S60 phone
  20. ^ Qt Software — Discontinues Qt Extended
  21. ^ Qt Software — To discontinue Qt Jambi after 4.5 release
  22. ^ [1]
  23. ^ Qt 4 Application and UI Framework for eCS
  24. ^ Trolltech: What’s New in Qt 4.3
  25. ^ 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.'
  26. ^ Qt 4.3: QtScript Module
  27. ^ QSA 1.2: Qt Script for Applications
  28. ^ Qt Software — Adobe Photoshop Elements Album
  29. ^ Qt Software — Qt in use - Skype
  30. ^ TOra uses the Qt library

Bibliography

See also