Qt

Skocz do: nawigacja, szukaj

Ogólnie o Qt

Qt Toolkit jest narzędziem umożliwiającym pisanie programów GUI dla wielu platform systemowych, w tym dla Linuxa. Najczęściej jest on używany w środowisku K Desktop Environment. Producentem Qt jest norweska firma Trolltech (wcześniej Quasar Technologies). Zdaniem twórców Qt powinno wymawiać się: "kute".

Biblioteka Qt została napisana w języku C++, jednak można jej używać w następujących językach: Python, Ruby, C, i Perl. Poza tym, że Qt pozwala na proste przenoszenie programów pomiędzy wieloma systemami, to zawiera jednocześnie wsparcie dla baz danych SQL, dokumentów pisanych w XML, grafiki trójwymiarowej OpenGL oraz pomaga w obsłudze plików i sieci.

Odmiany

Qt zostało wydane przez Trolltech na następujące platformy:

  • Qt/X11 — Qt dla Systemu X Window
  • Qt/Mac — Qt dla Apple Mac OS X
  • Qt/Windows — Qt dla Microsoft Windows
  • Qt/Embedded — Qt dla przenośnych urządzeń (PDA, Smartphone, ...)

Dla każdej z tych platform dostępne są cztery wydania Qt, są to:

  • Qt Console — edycja służąca do rozwoju aplikacji tekstowych (non-GUI).
  • Qt Desktop Light — jest to poziom podstawowy, ta edycja zawiera GUI, jest jednak pozbawiona wsparcia dla sieci oraz baz danych.
  • Qt Desktop — pełna edycja.
  • Qt Open Source Edition — pełna edycja, dla użytkowników open-source.

Pierwsze trzy z wymienionych wydań są zastrzeżone i rozpowszechniane na licencji komercyjnej; podczas gdy edycja Open Source jest dostępna pod GPL oraz dodatkowo dla Qt/X11 w QPL (Q Public License).

In case of the X11 platform, the QPL allows the final application to be licensed under various open source licenses, such as the LGPL or the Artistic License. For the Windows and MacOs X platforms, the GPL is the only Open Source license available so the applications developed with it must be GPL as well.

All editions support a wide range of compilers, including the GCC C++ compiler, and in the case of the commercial Qt/Windows, the Visual Studio suite [1].

There is a project to port the Open source Qt/X11 version of Qt to Windows, along with KDE. The project was started for Qt3 to provide a version of Qt on Windows suitable for free software programs :

  • Qt/Windows Free Edition — a free version of Qt released by the KDE on Cygwin project. This version is based entirely on the Qt/X11 source code and licensed under GPL.

The release of Qt4 under the GPL for the Unix, MacOS and Windows platforms makes the project less relevant.

Current

Trolltech released Qt 4 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 is dual-licensed under GPL and proprietary licenses on all supported platforms including Windows (while Qt/Windows 3.3 is only released under a proprietary license).

History

Haavard Nord and Eirik Chambe-Eng (the original developers of Qt and the CEO and President of Trolltech respectively) 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 beautiful in Haavard's Emacs font, and T was inspired by Xt, the X toolkit.

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 open source and free software movements were worried that an essential piece of one of their major operating systems would be under commercial control.

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 that was meant to supplant KDE entirely. The GNOME Desktop uses the GTK+ toolkit which was written for the GIMP, and mainly uses the C programming language.

Until version 1.45, Qt used the FreeQt license — which was neither open source nor free software 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 wherein 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 license should no open source version of Qt be released during 12 months.

The first versions of Qt had only two flavors: Qt/X11 for Unix and Qt/Windows for the Windows platform. The Windows platform was only available under the commercial license. 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 commercial license, until June 2003, where Trolltech released the version 3.2 with Mac OS X support available under the GPL license. Then came June 2005, with the addition of the Windows platform to the Open Source edition. Qt4 hence support the same set of platforms in the commercial edition as in the Open Source editions.

Projekt

Od pierwszego wydania nowatorstwo QT polegało na kilku rozwiązaniach.

Complete abstraction of the GUI

Qt uses its own paint engine and controls. It emulates the look of the different platforms it runs on. This made the porting work easier because very few classes in Qt depended really on the target platform. The drawback is that Qt had to emulate precisely the look of the different platforms. This drawback however no longer applies because the latest versions of Qt use the native styles API of the different platforms to draw the Qt controls.

Other portable graphical toolkits have made a different design decision, such as wxWidgets, MFC (Windows only), and the Java based SWT[2] which use the toolkit of the target platform for their implementation.

Meta Object Compiler

Znany jako moc. Jest to narzędzie, które analizuje kod źródłowy programu w Qt przed jego kompilacją. Efektem pracy moc jest wygenerowanie "Informacji Meta" o klasach użytych w programie. Informacje meta są używane przez Qt w celu dostarczenia cech, które nie są dostępne w w C++: Introspection, signal/slot system.

Użycie dodatkowego narzędzia było krytykowane przez część społeczności C++, twierdząc że programowanie w Qt podąża do wykpienia C++. In particular, the choice of an implementation based on macros has been criticized for its absence of type safety and pollution of the namespace. This is viewed by Trolltech as a necessary trade-off to provide introspection and dynamically generated slots or signals. Further, when Qt 1.x was released, consistency between compiler template implementations could not be relied upon.

Zobacz również

GIMP Toolkit

Linki zewnętrzne

Po polsku: