1 /****************************************************************************
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
6 ** This file is part of the documentation of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
17 ** GNU Free Documentation License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Free
19 ** Documentation License version 1.3 as published by the Free Software
20 ** Foundation and appearing in the file included in the packaging of
21 ** this file. Please review the following information to ensure
22 ** the GNU Free Documentation License version 1.3 requirements
23 ** will be met: http://www.gnu.org/copyleft/fdl.html.
26 ****************************************************************************/
30 \title What's New in Qt 4
32 \startpage index.html Qt Reference Documentation
33 \nextpage The Tulip Container Classes
35 This document covers the most important differences between Qt 3
36 and Qt 4. Although it is not intended to be a comprehensive
37 porting guide, it tells you about the most important portability
38 issues that you may encounter. It also explains how to turn on Qt
39 3 compatibility support.
41 \section1 New Technologies in Qt 4
43 Qt 4 introduces the following core technologies:
46 \o \l{The Tulip Container Classes}{Tulip}, a new set of template container classes.
48 \o \l{The Interview Framework}{Interview}, a model/view architecture for item views.
50 \o \l{The Arthur Paint System}{Arthur}, the Qt 4 painting framework.
52 \o \l{The Scribe Classes}{Scribe}, the Unicode text renderer with a public API
53 for performing low-level text layout.
55 \o \l{The Qt 4 Main Window Classes}{Mainwindow}, a modern action-based
56 mainwindow, toolbar, menu, and docking architecture.
58 \o The new \l{The New Qt Designer}{\QD} user interface design tool.
61 \section1 Recent Additions to Qt 4
63 The following features have been added to Qt since the first release of Qt 4.
67 \o \l{Qt Quick} 1.1 offers changes to the \l{QML Elements} and performance
73 \o Declarative UI Development with \l{Qt Quick}, technologies for creating
74 fluid, dynamic user interfaces.
75 \o Support for \l{Bearer Management}{network bearer management}, enabling
76 features such as control over network interfaces and support for roaming
78 \o Feature and performance improvements in QtWebKit, including a new tiled
79 backing store, control over scroll bars used in frames and framesets,
80 accelerated compositing and \l{The QtWebKit Bridge}{support for hybrid
82 \o General performance improvements, including the use of "alien widgets"
83 on Mac OS X, the QStaticText class for optimized text rendering, a new
84 \l{QPainter::drawPixmapFragments()}{API for rendering pixmap fragments}
85 and an updated version of the JavaScriptCore engine for the QtScript
86 module with improved performance.
91 \o Support for \l{The Symbian platform - Introduction to Qt}{the Symbian Platform}
92 as a mainstream Qt platform, with integration into the S60 framework.
93 \o The \l{The Animation Framework}{animation framework} allows animations to be
94 created using both widgets and graphics items.
95 \o The \l{The State Machine Framework}{state machine framework} provides a robust
96 state chart implementation based on Harel statecharts and SCXML.
97 \o Support for \l{QTouchEvent}{touch input} and \l{Gestures Programming}{gestures}
98 enable developers to create intuitive user interfaces for touch-based devices.
99 \o A \l{QWebElement}{DOM access API} for QtWebKit provides a cleaner and safer way
100 to access elements and structures of Web pages without the use of JavaScript.
101 \o A collection of performance improvements, covering QGraphicsView, QPixmapCache,
102 QNetworkAccessManager, QContiguousCache class, hardware-accelerated rendering
103 support through \l{OpenVG Rendering in Qt}{OpenVG}, and the removal of Win9x
105 \o A collection of \l{QGraphicsEffect}{graphics effects} make it easy to apply
106 and simple effects to graphics items and combine them to produce more complex
108 \o Support for XML schema validation in the QtXmlPatterns module covering
109 large parts of version 1.0 of the specification.
110 \o Qt3D enablers, including math primitives for \l{QMatrix4x4}{matrix multiplication},
111 \l{QVector3D}{vectors}, \l{QQuaternion}{quaternions} (client-side), and an API
112 for \l{QGLShader}{vertex and fragment shaders}, GLSL/ES.
113 \o \l{QtMultimedia Module}{Multimedia services} providing low-level access to the
114 system's audio system.
119 \o The WebKit browser engine included with Qt has been
120 upgraded to the latest upstream (trunk) version of WebKit,
121 bringing the latest features and improvements to Qt applications.
122 \o Qt for Mac OS X has been substantially rewritten to use
123 Apple's Cocoa API, enabling Qt applications to be deployed on
124 64-bit Macintosh hardware.
125 \o The QtXmlPatterns module has been extended to cover XSLT, a
126 transformation language for XML documents.
127 \o Qt Script introduced its debugger,
128 providing error reporting for scripts, and to let users track down
129 bugs in their own scripts.
130 \o Qt 4.5 includes support for writing rich text documents as
131 OpenDocument files via the newly-introduced QTextDocumentWriter
133 \o Qt Linguist can load and edit multiple translation
134 files simultaneously.
135 \o Support for ARGB top-level widgets (i.e., translucent
141 \o \l{WebKit in Qt}{Qt WebKit integration}, making it possible for developers
142 to use a fully-featured Web browser to display documents and access online
144 \o A multimedia API provided by the \l{Phonon Overview}{Phonon Multimedia Framework}.
145 \o \l{QtXmlPatterns Module}{XQuery and XPath} support, providing facilities for
146 XML processing beyond that supported by the QtXml module.
147 \o Support for embedded widgets in \l{Graphics View} scenes.
148 \o The \l{Thread Support in Qt}{QtConcurrent framework} for
149 concurrent programming using Qt paradigms and threading features.
150 \o An \l{QtHelp Module}{improved help system} that can be used in conjunction
151 with Qt Assistant or as an independent help resource manager.
152 \o Printing system improvements, including the QPrinterInfo, QPrintPreviewWidget
153 and QPrintPreviewDialog classes.
154 \o Support for \l{Windows CE - Introduction to using Qt}{Qt for Windows CE} as
155 a mainstream Qt platform.
156 \o Improvements in performance of Qt for Embedded Linux and extended support for
162 \o Support for different \l{The Qt 4 Main Window Classes}{main window paradigms and styles},
163 such as those found in Visual Studio or KDevelop.
164 \o The \l{QtScript} module, providing support for application scripting with ECMAScript.
165 \o Improved graphics features, including an experimental Direct3D paint engine
166 and improved provision for hardware accelerated rendering with OpenGL, and
167 support for OpenGL ES in Qt for Embedded Linux.
168 \o \l{QSvgGenerator}{Scalable Vector Graphics (SVG) export}, allowing SVG drawings to
169 be created using the standard QPainter API.
170 \o Support for arbitrary matrix transformations and set operations on painter paths.
171 \o Native look and feel on Windows Vista; improved look and feel on Mac OS X.
172 \o An improved \l{QMdiArea}{Multiple Document Interface (MDI)} implementation.
173 \o Continuous improvements to \QD, including support for
174 \l{Qt Designer's Widget Editing Mode#The Property Editor}{dynamic properties}.
175 \o Support for Secure Socket Layer (SSL) communications via the QSslSocket class.
176 \o Support for XML Localization Interchange File Format (XLIFF) files in \QL.
177 \o A new font subsystem for Qt for Embedded Linux.
182 \o The \l{Graphics View} framework for producing interactive graphics.
183 \o \l{Desktop Integration}{Desktop integration} facilities for applications.
184 \o \l{Qt Style Sheets} enable easy, yet powerful customization of
186 \o Support for the \l{intro-to-dbus.html}{D-Bus} Inter-Process Communication (IPC) and Remote Procedure Calling (RPC) mechanism.
187 \o An \l{Undo Framework}{Undo framework} based on the
188 \l{Books about GUI Design#Design Patterns}{Command pattern}.
189 \o Support for model-based \l{QCompleter}{text completion} in standard and
191 \o New widgets and GUI features, such as QCalendarWidget and
192 QGLFramebufferObject.
193 \o Classes to provide higher level application infrastructure, such as
194 QFileSystemWatcher and QDataWidgetMapper.
199 \o Integrated support for rendering
200 \l{The Arthur Paint System#SVG Rendering Support}{Scalable Vector Graphics}
201 (SVG) drawings and animations.
203 \l{QWidget#Transparency and Double Buffering}{child widget transparency}
205 \o A Portable Document Format (PDF) backend for Qt's printing system.
206 \o A \l{QTestLib Manual}{unit testing framework} for Qt applications and
208 \o Modules for \l{QtDesigner}{extending \QD} and
209 \l{QtUiTools}{dynamic user interface building}.
210 \o New \l{Proxy Models}{proxy models} to enable view-specific sorting and
211 filtering of data displayed using item views.
212 \o Support for \l{Installing Qt for Mac OS X}{universal binaries} on Mac OS X.
213 \o Additional features for developers using \l{QtOpenGL}{OpenGL}, such as
214 support for pixel and sample buffers.
215 \o A flexible \l{QSyntaxHighlighter}{syntax highlighting class} based on the
216 \l{Scribe} rich text framework.
217 \o Support for \l{QNetworkProxy}{network proxy} servers using the SOCKS5
219 \o Support for OLE verbs and MIME data handling in \l{ActiveQt}.
222 For more information about improvements in each Qt release, see
223 the \l{http://qt.nokia.com/developer/changes/}
224 {detailed lists of changes}.
226 \section1 Significant Improvements
228 The following modules have been significantly improved for Qt 4:
231 \o A fully cross-platform \l{accessibility}
232 module, with support for the emerging SP-API Unix standard in
233 addition to Microsoft and Mac Accessibility.
234 \o The \l{qt4-sql.html}{SQL module}, which is now based on the
235 Interview model/view framework.
236 \o The \l{qt4-network.html}{network module}, with better support
237 for UDP and synchronous sockets.
238 \o The \l{qt4-styles.html}{style API}, which is now decoupled from
239 the widgets, meaning that you can draw any user interface element on
240 any device (widget, pixmap, etc.).
241 \o Enhanced \l{qt4-threads.html}{thread support}, with signal-slot
242 connections across threads and per-thread event loops.
243 \o A new \l{resource system} for embedding images
244 and other resource files into the application executable.
247 \section1 Build System
249 Unlike previous Qt releases, Qt 4 is a collection of smaller
250 libraries. A complete list of libraries in the current release
251 of Qt can be found on the \l{All Modules} page. The following
252 table describes the initial set of libraries released with Qt 4.
255 \header \o Library \o Description
256 \row \o \l{QtCore} \o Core non-GUI functionality
257 \row \o \l{QtGui} \o Core GUI functionality
258 \row \o \l{QtNetwork} \o Network module
259 \row \o \l{QtOpenGL} \o OpenGL module
260 \row \o \l{QtSql} \o SQL module
261 \row \o \l{QtSvg} \o SVG rendering classes
262 \row \o \l{QtXml} \o XML module
263 \row \o \l{Qt3Support} \o Qt 3 support classes
264 \row \o \l{QAxContainer} \o ActiveQt client extension
265 \row \o \l{QAxServer} \o ActiveQt server extension
266 \row \o \l{QtHelp} \o Classes for integrating online documentation
267 \row \o \l{QtDesigner} \o Classes for extending and embedding Qt Designer
268 \row \o \l{QtUiTools} \o Classes for dynamic GUI generation
269 \row \o \l{QtTest} \o Tool classes for unit testing
272 QtCore contains tool classes like QString, QList, and QFile, as
273 well as kernel classes like QObject and QTimer. The QApplication
274 class has been refactored so that it can be used in non-GUI
275 applications. It is split into QCoreApplication (in \l QtCore)
276 and QApplication (in \l QtGui).
278 This split makes it possible to develop server applications using Qt
279 without linking in any unnecessary GUI-related code and without
280 requiring GUI-related system libraries to be present on the target
281 machine (e.g. Xlib on X11, Carbon on Mac OS X).
283 If you use qmake to generate your makefiles, qmake will by default
284 link your application against QtCore and QtGui. To remove the
285 dependency upon QtGui, add the line
287 \snippet doc/src/snippets/code/doc_src_qt4-intro.pro 0
289 to your .pro file. To enable the other libraries, add the line
291 \snippet doc/src/snippets/code/doc_src_qt4-intro.pro 1
293 Another change to the build system is that moc now understands
294 preprocessor directives. qmake automatically passes the defines set
295 for your project (using "DEFINES +=") on to moc, which has its own
296 built-in C++ preprocessor.
298 To compile code that uses UI files, you will also need this line in
301 \snippet doc/src/snippets/code/doc_src_qt4-intro.pro 2
303 \section1 Include Syntax
305 The syntax for including Qt class definitions has become
307 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 3
311 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 4
313 This is guaranteed to work for any public Qt class. The old syntax,
315 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 5
317 still works, but we encourage you to switch to the new syntax.
319 If you attempt to include a header file from a library that isn't
320 linked against the application, this will result in a
321 compile-time warning (e.g., "QSqlQuery: No such file or
322 directory"). You can remedy to this problem either by removing
323 the offending include or by specifying the missing library in the
324 QT entry of your \c .pro file (see \l{Build System} above).
326 To include the definitions for all the classes in a library, simply
327 specify the name of that library. For example:
329 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 6
333 Qt 2 introduced a class called Qt for global-like constants
334 (e.g., \c{Qt::yellow}). The C++ namespace construct was not used
335 because not all compilers understood it when it was released.
337 With Qt 4, the Qt class has become the Qt namespace. If you want
338 to access a constant that is part of the Qt namespace, prefix it
339 with \c{Qt::} (e.g., \c{Qt::yellow}), or add the directive
341 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 7
343 at the top of your source files, after your \c #include
344 directives. If you use the \c{using namespace} syntax you don't
345 need the prefix (e.g., \c yellow is sufficient).
347 When porting Qt 3 applications, you may run into some source
348 compatibility problems with some of these symbols. For example,
349 in Qt 3, it was legal to write \c QWidget::yellow instead of \c
350 Qt::yellow, because QWidget inherited from Qt. This won't work in
351 Qt 4; you must write \c Qt::yellow or add the "using namespace"
352 directive and drop the \c{Qt::} prefix.
354 The \l{qt3to4 - The Qt 3 to 4 Porting Tool}{qt3to4} porting tool
355 automates this conversion.
357 \section1 QObject/QWidget Constructors
359 In Qt 4 we have tried to simplify the constructors of QObject/QWidget
360 subclasses. This makes subclassing easier, at the same time as it
361 helps make the Qt library more efficient.
363 Constructors no longer take a "const char *name" parameter. If
364 you want to specify a name for a QObject, you must call
365 QObject::setObjectName() after construction. The object name is
366 now a QString. The reasons for this change are:
369 \o Code that used it looked confusing, for example:
371 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 8
373 \c label1 is a QLabel that displays the text "Hello"; \c
374 label2 is a QLabel with no text, with the object name
377 \o From surveys we did, most users didn't use the name, although
378 they blindly followed Qt's convention and provided a "const
379 char *name" in their subclasses's constructors. For example:
381 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 9
383 \o The name parameter was in Qt since version 1, and it always
384 was documented as: "It is not very useful in the current
385 version of Qt, but it will become increasingly important in
386 the future." Ten years later, it still hasn't fulfilled its
390 QWidget's \c WFlags data type has been split in two:
391 Qt::WindowFlags specifies low-level window flags (the type of
392 window and the frame style), whereas Qt::WidgetAttribute
393 specifies various higher-level attributes about the widget (e.g.,
394 WA_StaticContents). Widget attributes can be set at any time
395 using QWidget::setAttribute(); low-level window flags can be
396 passed to the QWidget constructor or set later using
397 QWidget::setParent(). As a consequence, the constructors of most
398 QWidget subclasses don't need to provide a \c WFlags parameter.
400 The \e parent parameter of all QObject classes in Qt defaults to
401 a 0 pointer, as it used to do in Qt 1. This enables a style of
402 programming where widgets are created without parents and then
403 inserted in a layout, at which point the layout automatically
406 \section1 Dynamic Casts
408 Qt 4 provides a qobject_cast<>() function that performs a dynamic cast
409 based on the meta-information generated by moc for QObject
410 subclasses. Unlike the standard C++ dynamic_cast<>() construct,
411 qobject_cast<>() works even when RTTI is disabled, and it works correctly
412 across DLL boundaries.
414 Here's the Qt 3 idiom to cast a type to a subtype:
416 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 10
418 The Qt 4 idiom is both cleaner and safer, because typos will always
419 result in compiler errors:
421 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 11
423 \section1 QPointer<T>
425 The QPointer<T> class provides a pointer to type T (where T inherits
426 from QObject) that is automatically set to 0 when the referenced
427 object is destroyed. Guarded pointers are useful whenever you want to
428 store a pointer to an object you do not own.
432 \snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 12
434 QPointer<T> is more or less the same as the old QGuardedPtr<T> class,
435 except that it is now implemented in a much more lightweight manner
436 than before. The cost of one QPointer<T> object is now approximately
437 the same as that of a signal--slot connection.
439 \section1 Paint Events
441 Qt 4 supports double buffering transparently on all platforms. This
442 feature can be turned off on a per-widget basis by calling
443 QWidget::setAttribute(Qt::WA_PaintOnScreen).
445 A consequence of this is that all painting must now be done from the
446 paintEvent() function. This is also required by the HIView API on Mac
447 OS X. In practice, this is seldom a problem, since you can call
448 update() from anywhere in your code to create a paint event, with the
449 region to update as the argument.
451 To help porting, QWidget supports a Qt::WA_PaintOutsidePaintEvent
452 attribute that can be set to make it possible to paint outside
453 \l{QWidget::paintEvent()}{paintEvent()} on Windows and X11.
455 \section1 Qt 3 Support Layer
457 Qt 4 provides an extension library that applications based on Qt 3,
458 called Qt3Support, that Qt applications can link against. This allows
459 for more compatibility than ever before, without bloating Qt.
462 \o Classes that have been replaced by a different class with the
463 same name, such as QListView, and classes that no longer exist in Qt 4
464 are available with a \c 3 in their name (e.g., Q3ListView, Q3Accel).
466 \o Other classes provide compatibility functions. Most of these are
467 implemented inline, so that they don't bloat the Qt libraries.
470 To enable the Qt 3 support classes and functions, add the line
472 \snippet doc/src/snippets/code/doc_src_qt4-intro.pro 13
474 to your \c .pro file.
476 On Visual C++ 7 and GCC 3.2+, using compatibility functions often results
477 in a compiler warning (e.g., "'find' is deprecated"). If you want to turn
478 off that warning, add the line
480 \snippet doc/src/snippets/code/doc_src_qt4-intro.pro 14
482 to your \c .pro file.
484 If you want to use compatibility functions but don't want to link
485 against the Qt3Support library, add the line
487 \snippet doc/src/snippets/code/doc_src_qt4-intro.pro 15
491 \snippet doc/src/snippets/code/doc_src_qt4-intro.pro 16
493 to your \c .pro file, depending on whether you want compatibility
494 function calls to generate compiler warnings or not.
498 \page qt4-8-intro.html
499 \title What's New in Qt 4.8
501 Qt 4.8 provides many improvements and enhancements over the previous
502 releases in the Qt 4 series. This document covers the most important
503 features in this release, separated by category.
505 A list of other Qt 4 features can be found on the \bold{\l{What's
508 \section1 Qt Quick 1.1
509 Qt Quick 1.1 introduces \l{What's New in Qt Quick}{new changes} such as
510 new properties and better performance.
513 \o \l {QML Right-to-left User Interfaces}{Right-To-Left} text support
514 \o Improved image caching
515 \o Text input improvements - Support for split-screen virtual keyboard
516 \o \l PinchArea Element - enables simple pinch gesture handling
517 \o New properties for \l{QML Elements}.
521 \section1 Qt Platform Abstraction -- \e Lighthouse
523 \e QPA allows porting Qt to different windowing systems and devices
524 easier. It provides a clean abstraction layer for porting QtGui to new
527 \note QPA is considered an experimental feature in Qt 4.8. In Qt 5 it
528 is a supported and complete feature.
530 \section1 Qt WebKit 2.2
532 The new Qt WebKit release introduces bug fixes, performance improvements,
533 and greater compiler compatibility.
535 \section1 Threaded OpenGL
537 Many Qt OpenGL functions are now thread-safe. Threads that cater to
538 different situations are now available.
541 \o Buffer swapping thread
542 \o Texture uploading thread
543 \o \l QPainter thread
546 \section1 Deprecated Items in Qt 4.8
548 As part of Open Governance, modules in Qt 4.8 will receive maintainers and
549 receive different support levels.
551 Currently, a module has an activity classification, the \e{Module Maturity Level}.
552 As well, a list of modules and their maturity level is in the \l{Qt Developer Network}.
555 \o \l{Qt Modules' Maturity Level - Description} - description of the
556 different \e{maturity levels}
557 \o \l{Qt Modules' Maturity Levels - Modules List} - list of the Qt
558 modules and their maturity level
560 \section1 Additions to the Qt API
562 Qt 4.8 introduces changes to the Qt API.
565 Qt supports some of the features of the C++11 standard. QList, QVector and
566 QStringList can be initialized with initializer lists. Most of the tool
567 classes have a move operator. It is possible to use lambda functions in some
568 of the QtConcurrent functions.
572 Changes to the Localization APIs include improvements to \l QLocale and more
573 support for different language code formats.
576 \o \l {QLocale::quoteString()} - for localized quotes
577 \o \l {QLocale::createSeparatedList()} - for localized list separation (e.g. "1, 2 and 3")
578 \o \l {QLocale::bcp47Name()} - for locale names in the canonical form
579 according to \l {RFC 5646 - BCP47}
580 \o \l {QLocale::matchingLocales()} - to get a list of locales that match a
581 criteria - e.g. a list of locales that use French language.
582 \o \l {QLocale::firstDayOfWeek()}
583 \o \l {QLocale::weekdays()}
584 \o \l{QLocale::currencySymbol()}
585 \o \l{QLocale::toCurrencyString()} - number formatting for currencies
586 \o \l{QLocale::uiLanguages()}
587 \o \l{QLocale::nativeLanguageName()}
588 \o \l{QLocale::nativeCountryName()}
591 \o Multithreaded HTTP
592 \o QThreadLocalStorage can now store simple objects in addition to pointers
595 \section1 New Classes, Functions, Macros, etc.
600 \page qt4-7-intro.html
601 \title What's New in Qt 4.7
603 Qt 4.7 provides many improvements and enhancements over the
604 previous releases in the Qt 4 series. This document covers the
605 most important features in this release, separated by category.
607 A list of other Qt 4 features can be found on the \bold{\l{What's
610 \section1 Declarative UI Development with Qt Quick
612 \image quick_screens.png
614 Qt 4.7 introduces \l{Qt Quick}, the Qt UI Creation Kit. that enables
615 the creation of dynamic user interfaces, easier and more effective
616 than possible with existing UI technologies. This UI Creation Kit
617 consists of three technologies:
620 \i QML is a declarative language oriented on JavaScript that utilizes
621 Qt's Meta-Object capabilities to enable designers and developers to
622 collaborate tightly and create animated and fluid user experiences,
623 using existing knowledge in script language and design.
625 \i Qt Declarative is a C++ library that provides the underlying engine,
626 which translates the declarative description of the UI in QML into
627 items on a QGraphicsScene. The library also provides APIs to bind
628 custom C++ types and elements to QML, and to connect the QML UI with
629 the underlying application logic written in C++.
631 \i Qt Creator has been improved to support interactive editing of
632 QML UIs through drag-and-drop. The text editor supports the QML
633 syntax and provides authoring assistance such as auto-completion,
634 error lookup, help lookup and easy preview of QML UI's. The Qt
635 Quick features in Qt Creator will be released with Qt Creator 2.1
638 \section1 Network Bearer Management
640 Bearer Management controls the connectivity state of the system.
641 The new Bearer Management API in the QtNetwork module allows the
642 application to identify whether the system is online and how many
643 interfaces there are, as well as start and stop interfaces, or
644 roam transparently between access points.
646 QNetworkAccessManager uses this API for HTTP level roaming.
648 \section1 Feature Improvements in QtWebKit
650 The QGraphicsWebView class has a new tiled backing store, which
651 improves scrolling and zooming performance. You can even create
652 animated zoom-in or zoom-out effects (see
653 QWebSettings::TiledBackingStoreEnabled).
655 On mobile platforms, it is often useful to avoid displaying
656 separate scrollbars for iframes and framesets. If you switch on
657 frame flattening, QtWebKit will resize frames to fit their content
658 to avoid separate scrollbars (see
659 QWebSettings::FrameFlatteningEnabled).
661 Qt 4.7 adds support for accelerated compositing, which enhances
662 the performance of CSS animations and transitions. Read more in
663 \l{http://labs.trolltech.com/blogs/2010/05/17/qtwebkit-now-accelerates-css-animations-3d-transforms/}{this blog}.
665 For hybrid QtWebKit and C++ projects, Qt 4.7 has added support for
666 transporting \l{QPixmap}s between Qt C++ and WebKit. We have also
667 improved the documentation for hybrid development. Read more here:
668 \l{The QtWebKit Bridge}.
670 \section1 QtWebKit Performance Benchmarks
672 We have introduced a set of performance benchmarks for QtWebKit,
673 and made numerous improvements in rendering performance, page
674 loading performance, scrolling performance and CSS performance.
675 Here are some examples from the benchmarks run on a 64-bit Linux
676 workstation with the raster graphics system.
678 In a benchmark that measures the scrolling performance on popular
679 websites, we found out that Qt 4.7.0 on this platform is 350%
680 faster than Qt 4.6.0, thanks to several rendering related
683 Our page loading benchmark shows an improvement of 16% in Qt 4.7.0
684 from Qt 4.6.0. This is due to improvements in text layout speed,
685 image decoding, resource loading and event handling.
687 Several CSS animation benchmarks indicate a speed improvement of
688 31% from Qt 4.6.0 to Qt 4.7.0. These benchmarks are effectively
689 showing the improvement we get from accelerated compositing (see
692 \section1 Other Performance Related Improvements
694 In addition to the QtWebKit module, performance has been a focus
695 area in Qt 4.7 throughout the Qt framework. Here are a couple of
696 examples about performance related feature improvements.
698 On Mac OS X, Qt now uses a different widget implementation (called
699 "alien widgets"), which improves the responsiveness of
700 applications that have complex user interfaces with several
703 Qt 4.7 introduces the QStaticText class, which can be used to
704 improve text rendering performance. More info is available from
705 \l{http://labs.trolltech.com/blogs/2010/03/01/insanity-is-shaping-the-same-text-again-and-expecting-a-different-result/}{this blog}.
707 The QPainter class has a new API for rendering pixmap fragments
708 (QPainter::drawPixmapFragments), which can improve the rendering
709 performance of applications that need to render
710 \l{QPainter::drawPixmapFragments()}{pixmap fragments}.
712 Qt 4.7 has an updated version of the JavaScriptCore engine for the
713 QtScript module, which improves JavaScript execution performance.
715 \section1 New Classes, Functions, Macros, etc.
717 Links to new classes, elements, functions, macros, and other items
718 introduced in Qt 4.7.
724 \page qt4-6-intro.html
725 \title What's New in Qt 4.6
727 Qt 4.6 provides many improvements and enhancements over the
728 previous releases in the Qt 4 series. This document covers the
729 most important features in this release, separated by category.
732 A comprehensive list of changes between Qt 4.5 and Qt 4.6 is
733 included in the \c changes-4.6.0 file
734 \l{http://qt.nokia.com/developer/changes/changes-4.6.0}{available
735 online}. A \l{Known Issues in %VERSION%}{list of known issues}
736 for this release is also available.
738 Changes between this release and the previous release are provided
739 in the \c{changes-%VERSION%} file (also
740 \l{http://qt.nokia.com/developer/changes/changes-%VERSION%}{available online}).
743 A list of other Qt 4 features can be found on the \bold{\l{What's
746 \section1 Support for Symbian
748 Qt 4.6 is the first release to include support for the Symbian
749 platform, with integration into the S60 framework. The port to
750 Symbian and S60 provides all functionality required to develop
751 rich end-user applications for devices running S60 3.1 and
754 See the \l{The Symbian platform - Introduction to Qt} for more information.
756 \section1 Animation Framework
758 The animation framework helps build highly animated,
759 high-performance GUIs without the hassle of managing complex
760 structures, timers, and easing curves, not to mention the large
761 state graphs that all animated GUIs tend to be full of.
763 The framework makes it easy to animate \l{QObject}s, including
764 QWidgets, by allowing Qt properties to be animated. It also allows
765 creating custom animations and interpolation functions. Graphics
766 views are not left out; one can animate \l{QGraphicsWidget}s and
767 new \l{QGraphicsObject}s which inherit from QGraphicsItem
768 (and thereby enable properties).
770 Animations are controlled using easing curves and can be grouped
771 together. This enables animations of arbitrary complexity.
773 The API is easy to grasp with functions such as start(), stop(),
774 pause(), and currentTime(). Here is an image from one of the
775 examples that come with the framework:
777 \image whatsnewanimatedtiles.png
779 The animation framework also plugs into the new Qt Statemachine by
780 allowing an animation to be played when transitions are triggered.
781 The state machine framework is introduced in 4.6 and is described
784 See \l{The Animation Framework} documentation for more information.
786 \section1 State Machine Framework
788 The state machine framework provides a robust state chart
789 implementation based on Harel statecharts and SCXML. Qt's API lets
790 you construct such state graphs and execute them. The key benefits
791 of a state machine are:
794 \o Simplify complex application semantics.
795 \o Use of states to reduce code bloat.
796 \o Use states to improve maintainability.
797 \o Makes event-driven programming robust and more
801 It is especially the last item here that makes using a state
802 machine worthwhile. A key characteristic of event-driven systems
803 (such as Qt applications) is that behavior often depends not only
804 on the last or current event, but also the events that preceded
805 it. With statecharts, this information is easy to express.
807 The framework fits neatly into Qt by allowing transitions to
808 trigger on signals and \l{QEvent}s. By inserting animations into
809 the state machine, it is also easier to use the framework for
810 animating GUIs, for instance.
812 See \l{The State Machine Framework} documentation for more information.
814 \section1 Touch and Gestures
816 Support for touch input enables users to interact with many
817 parts of a user interface at the same time, and provides the basis
818 for gestures. Additional infrastructure for gesture recognition
819 allows a sequence of touch inputs to be combined to create gestures
820 that can be used to activate features and trigger actions in an
825 This new functionality brings a number of benefits:
828 \o Allows users to interact with applications in more natural ways.
829 \o Simplifies finger-based interaction with UI components.
830 \o Combines support for common basic gestures and touch gestures
831 in a single general framework.
832 \o Enables extensibility by design.
835 See the QTouchEvent class documentation for more information on touch
836 input and QGestureEvent for gestures.
838 \section1 DOM Access API
840 Web pages and XML both have very complex document object models.
841 The W3C selector API provides a very simple way to access and
842 manipulate such structures. This API makes it intuitive to access
843 DOM, helps reuse CSS selector knowledge, and gives little
844 maintenance or footprint overhead.
846 \snippet webkitsnippets/webelement/main.cpp FindAll
848 See the QWebElement class documentation for more information.
850 \section1 Performance Optimizations
852 As always, Qt continuously strive to optimize its performance.
853 For this release, we have:
856 \o Rewritten the QGraphicsView rendering algorithm.
857 \o Made QPixmapCache support efficient Key data structure.
858 \o Reduced overhead in QNetworkAccessManager.
859 \o Added the QContiguousCache class, which provides efficient caching of
861 \o Added support for hardware-accelerated rendering through
862 \l{OpenVG Rendering in Qt}{OpenVG}
863 \o Removed Win9x support.
866 \section1 Graphics Effects
868 Effects can be used to alter the appearance of UI elements such as
869 \l{QGraphicsItem}s and \l{QWidget}s. A couple of standard effects such
870 as blurring, colorizing and drop shadow are provided, and it is
871 possible to implement custom effects.
875 \o{2,1} \img graphicseffect-plain.png
877 \o \img graphicseffect-blur.png
878 \o \img graphicseffect-colorize.png
880 \o \img graphicseffect-opacity.png
881 \o \img graphicseffect-drop-shadow.png
884 See the QGraphicsEffect class documentation for more information.
886 \section1 XML Schema Validation
888 The QtXmlPatterns module can now be used to validate schemas, either
889 through C++ APIs in the Qt application, or using the xmlpatternsvalidator
890 command line utility. The implementation of XML Schema Validation supports
891 the specification version 1.0 in large parts.
895 See the \l{XML Processing} and QXmlSchema class documentation for more
898 \section1 Qt3D Enablers
900 As more of Qt, and more of the applications built on Qt go 3D,
901 API's should be provided to simplify this. Mainly, the new API
902 aims to make it more easy to create 3D applications with OpenGL.
903 It will also unify the Qt OpenGL codebase, and enable
904 cross-platform 3D codebase.
906 The main features of the Qt3D enablers are currently: Math
907 primitives for matrix multiplication, vectors, quaternions
908 (client-side), and an API for vertex and fragment shaders, GLSL/ES.
909 Future research will, among other things include stencils,
910 scissors, vertex buffers and arrays, texture manipulation, and
913 \section1 Multimedia Services
915 Qt 4.6 comes with new classes for handling audio. These classes
916 provide low-level access to the system's audio system. By
917 specifying the audio format (QAudioFormat) and supplying audio
918 data through a QIODevice, you get direct access to the
919 functionality of the sound device. The API also comes with
920 functions to query audio devices for which audio formats they
923 See the \l{QtMultimedia Module} documentation for more information.
925 \section1 New Classes, Functions, Macros, etc.
927 Links to new classes, functions, macros, and other items
928 introduced in Qt 4.6.
935 \page qt4-5-intro.html
936 \title What's New in Qt 4.5
938 Qt 4.5 provides many improvements and enhancements over the previous releases
939 in the Qt 4 series. This document covers the most important features in this
940 release, separated by category.
942 A comprehensive list of changes between Qt 4.4 and Qt 4.5 is included
943 in the \c changes-4.5.0 file
944 \l{http://qt.nokia.com/developer/changes/changes-4.5.0}{available online}.
945 A \l{Known Issues in %VERSION%}{list of known issues} for this release is also
948 Changes between this release and the previous release are provided
949 in the \c{changes-%VERSION%} file (also
950 \l{http://qt.nokia.com/developer/changes/changes-%VERSION%}{available online}).
952 A list of other Qt 4 features can be found on the
953 \bold{\l{What's New in Qt 4}} page.
955 \section1 Qt WebKit Integration
957 \image webkit-netscape-plugin.png
959 The WebKit browser engine included with Qt has been upgraded to the latest
960 upstream (trunk) version of WebKit, bringing the latest features and
961 improvements to Qt applications. These include:
964 \o Support for full page zooming, with appropriate rescaling of images and fonts.
965 \o The CSS-based transformation and animation features provided by a WebKit
967 \o Performance improvements due to faster JavaScript engine and optimized
971 Standards compatibility improvements include provision for the Netscape plugin
972 API, allowing most Netscape plugins to be used in-process, support for HTML 5
973 audio and video elements using Qt's Phonon integration, and
974 \l{Web Application Support}{facilities for client-side storage of Web content}.
976 \section1 Performance Improvements
978 The introduction of the QtBenchLib performance benchmarking library enables
979 performance benchmarking and regression testing. Core parts of Qt itself have
980 undergone focused re-engineering for improved graphics performance, including
981 paint engine and text rendering improvements, Graphics View and style sheet
982 performance improvements.
984 The X11 paint engine now uses XSHM (the X shared memory extension), resulting
985 in reduced overhead for painting operations.
987 A new OpenGL ES 2.0-based paint engine complements the existing OpenGL paint
988 engine, but with a focus on embedded devices.
990 Qt now features a pluggable graphics system, making it possible for users
991 and developers to select raster, OpenGL or native graphics systems to take
992 into account the specific needs of their applications and get the best
993 performance out of them.
995 \section1 Mac OS X Cocoa Support
999 Qt for Mac OS X has been substantially rewritten to use Apple's Cocoa API,
1000 enabling Qt applications to be deployed on 64-bit Macintosh hardware.
1001 In addition, the new QMacCocoaViewContainer and QMacNativeWidget classes
1002 provide integration with Cocoa's own features and controls.
1004 For many applications, a simple recompilation is all that is required
1005 to produce an executable for 64-bit systems. Applications that use
1006 specific features may require a few changes first.
1008 \section1 Windows CE Feature Parity
1010 Qt for Windows CE has been updated to bring features of Qt 4.4 and Qt 4.5
1011 to the Windows CE platform, including:
1014 \o Phonon Multimedia Framework, using a Direct-Show based backend for audio
1015 and video playback and a Simple WaveOut backend for devices without DirectShow.
1016 \o The inclusion of Qt WebKit integration features previously unavailable for
1017 Qt 4.4 on Windows CE.
1020 Support on all Windows CE platforms; recommended for WinCE 6 and higher.
1022 The inclusion of these features enables developers to easily integrate Web and
1023 multimedia content into Qt applications on Windows CE Standard Edition while
1024 retaining full cross-platform compatibility with other Qt platforms.
1026 \section1 XML Transformations with XSLT
1028 The QtXmlPatterns module has been extended to cover XSLT, a transformation language
1029 for XML documents. A common application of this is the transformation of XML data
1030 into human-readable formats for reporting purposes.
1032 XSLT makes it simple to reformat XML content without changing data structures,
1033 removes the need for an intermediate DOM layer for presentation, and enables
1034 rapid solutions to be created; for example, creating reports as HTML or PDF.
1036 \section1 Qt Script Debugger
1038 \image qtscript-debugger-small.png
1040 Developers using Qt Script in their applications can take advantage of
1041 the new \l{Qt Script Debugger Manual}{Qt Script Debugger} to provide
1042 error reporting for scripts, and to let users track down bugs in their
1045 Many standard features of GUI debugging tools are present, allowing the
1046 developer to step through running script code, inspect variables,
1047 automatically catch exceptions, and set conditional breakpoints.
1049 \section1 OpenDocument File Format Support
1051 Qt 4.5 includes support for writing rich text documents as OpenDocument files via
1052 the newly-introduced QTextDocumentWriter class. This provides an generic mechanism
1053 for file export that can be used to introduce support for additional formats in
1056 \section1 Improved Network Proxy Support
1058 Qt's networking classes have been updated with
1059 \l{QtNetwork Module#Support for Network Proxies}{improved proxy support}.
1060 This includes improved integration with system proxy settings and the added
1061 ability to handle non-trivial proxy cases.
1063 \section1 Qt Designer Improvements
1065 \image designer-screenshot-small.png
1067 Qt Designer 4.5 boasts some improvements on usability, for example:
1070 \o \bold{Icon Mode} for the widget box which substantially reduces
1072 \o \bold{Morphing Widgets} which lets you morph similar widget types,
1073 e.g., a QWidget to a QFrame, types via the context menu's
1074 \e{Morph into} entry.
1075 \o \bold{Filters} for the \gui{Property Editor} that lets you find
1076 properties or widgets quickly.
1077 \o \bold{Find option} for the \gui{Object Inspector} that performs an
1078 incremental search on the form's widgets. Also, the objects' layout
1079 state is displayed here with using an icon on the left. Broken
1080 layouts are represented with the same icon used for the
1081 \e{Break Layout} action.
1084 In addition, Qt Designer now features an \gui{Embedded Design} tab that can
1085 be found in the \gui Preferences dialog. Within this tab, you can define
1086 embedded device profiles. These profiles contains screen settings, e.g.,
1087 display resolution, default font and default style. Qt Designer will use
1088 these settings when you edit forms.
1090 More information about these improvements can be found in the
1091 \l{What's New in Qt Designer 4.5} overview.
1093 \section1 Qt Linguist Improvements
1095 Qt Linguist can now load and edit multiple translation files simultaneously.
1097 Support for XML Localization Interchange File Format (XLIFF) files, previously added
1098 to the \c lupdate tool in Qt 4.3, has been improved and extended to the rest of the
1099 Qt Linguist toolchain. This enables files stored in Qt's TS translation format to
1100 be exported for use with other tools.
1102 The GNU Gettext PO format, which is commonly used in Open Source projects,
1103 is now supported by Qt Linguist.
1105 Support for a new way to annotate messages, using comments in the source code,
1106 has been added to the toolchain. See the QObject::tr() documentation for a detailed
1107 description and examples.
1109 The new \c lconvert filter tool facilitates conversion between file formats and
1110 can be used to perform other transformations on collections of translatable strings.
1112 \section1 Graphics Enhancements
1114 In addition to the performance improvements in this release, a number of graphics
1115 enhancements extend support for existing features to more platforms and expand Qt's
1116 core set of features with successful add-ons.
1118 Widget style sheets can now be used on Mac OS X, making this approach to theming
1119 and styling viable for truly cross-platform applications.
1121 Support for ARGB top-level widgets, previously available as a separate solution,
1122 is now provided as an integral part of Qt. This makes it possible to create windows
1123 with translucent regions on systems with the appropriate support from the user's
1124 window system. See the \l{QWidget#Creating Translucent Windows}{Creating Translucent
1125 Windows} section of the QWidget documentation for details of this feature.
1128 \image gtk-style-screenshot.png
1130 Improved GTK+ integration provided by the QGtkStyle class improves the look and feel
1131 of Qt applications in GNOME and other GTK-based environments. The screenshot above
1132 illustrates this clearly.