| 1 |
/**************************************************************************** |
| 2 |
** |
| 3 |
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). |
| 4 |
** All rights reserved. |
| 5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
| 6 |
** |
| 7 |
** This file is part of the documentation of the Qt Toolkit. |
| 8 |
** |
| 9 |
** $QT_BEGIN_LICENSE:FDL$ |
| 10 |
** GNU Free Documentation License |
| 11 |
** Alternatively, this file may be used under the terms of the GNU Free |
| 12 |
** Documentation License version 1.3 as published by the Free Software |
| 13 |
** Foundation and appearing in the file included in the packaging of |
| 14 |
** this file. |
| 15 |
** |
| 16 |
** Other Usage |
| 17 |
** Alternatively, this file may be used in accordance with the terms |
| 18 |
** and conditions contained in a signed written agreement between you |
| 19 |
** and Nokia. |
| 20 |
** |
| 21 |
** |
| 22 |
** |
| 23 |
** |
| 24 |
** $QT_END_LICENSE$ |
| 25 |
** |
| 26 |
****************************************************************************/ |
| 27 |
|
| 28 |
/*! |
| 29 |
\page qt4-intro.html |
| 30 |
\title What's New in Qt 4 |
| 31 |
|
| 32 |
\startpage index.html Qt Reference Documentation |
| 33 |
\nextpage The Tulip Container Classes |
| 34 |
|
| 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. |
| 40 |
|
| 41 |
\section1 New Technologies in Qt 4 |
| 42 |
|
| 43 |
Qt 4 introduces the following core technologies: |
| 44 |
|
| 45 |
\list |
| 46 |
\o \l{The Tulip Container Classes}{Tulip}, a new set of template container classes. |
| 47 |
|
| 48 |
\o \l{The Interview Framework}{Interview}, a model/view architecture for item views. |
| 49 |
|
| 50 |
\o \l{The Arthur Paint System}{Arthur}, the Qt 4 painting framework. |
| 51 |
|
| 52 |
\o \l{The Scribe Classes}{Scribe}, the Unicode text renderer with a public API |
| 53 |
for performing low-level text layout. |
| 54 |
|
| 55 |
\o \l{The Qt 4 Main Window Classes}{Mainwindow}, a modern action-based |
| 56 |
mainwindow, toolbar, menu, and docking architecture. |
| 57 |
|
| 58 |
\o The new \l{The New Qt Designer}{\QD} user interface design tool. |
| 59 |
\endlist |
| 60 |
|
| 61 |
\section1 Recent Additions to Qt 4 |
| 62 |
|
| 63 |
The following features have been added to Qt since the first release of Qt 4. |
| 64 |
|
| 65 |
In Qt 4.8: |
| 66 |
\list |
| 67 |
\o \l{Qt Quick} 1.1 offers changes to the \l{QML Elements} and performance |
| 68 |
upgrades |
| 69 |
\ |
| 70 |
\endlist |
| 71 |
In Qt 4.7: |
| 72 |
\list |
| 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 |
| 77 |
between networks. |
| 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 |
| 81 |
development}. |
| 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. |
| 87 |
\endlist |
| 88 |
|
| 89 |
In Qt 4.6: |
| 90 |
\list |
| 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 |
| 104 |
support. |
| 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 |
| 107 |
effects. |
| 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. |
| 115 |
\endlist |
| 116 |
|
| 117 |
In Qt 4.5: |
| 118 |
\list |
| 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 |
| 132 |
class. |
| 133 |
\o Qt Linguist can load and edit multiple translation |
| 134 |
files simultaneously. |
| 135 |
\o Support for ARGB top-level widgets (i.e., translucent |
| 136 |
windows). |
| 137 |
\endlist |
| 138 |
|
| 139 |
In Qt 4.4: |
| 140 |
\list |
| 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 |
| 143 |
services. |
| 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 |
| 157 |
display hardware. |
| 158 |
\endlist |
| 159 |
|
| 160 |
In Qt 4.3: |
| 161 |
\list |
| 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. |
| 178 |
\endlist |
| 179 |
|
| 180 |
In Qt 4.2: |
| 181 |
\list |
| 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 |
| 185 |
user interfaces. |
| 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 |
| 190 |
custom widgets. |
| 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. |
| 195 |
\endlist |
| 196 |
|
| 197 |
In Qt 4.1: |
| 198 |
\list |
| 199 |
\o Integrated support for rendering |
| 200 |
\l{The Arthur Paint System#SVG Rendering Support}{Scalable Vector Graphics} |
| 201 |
(SVG) drawings and animations. |
| 202 |
\o Support for |
| 203 |
\l{QWidget#Transparency and Double Buffering}{child widget transparency} |
| 204 |
on all platforms. |
| 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 |
| 207 |
libraries. |
| 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 |
| 218 |
protocol. |
| 219 |
\o Support for OLE verbs and MIME data handling in \l{ActiveQt}. |
| 220 |
\endlist |
| 221 |
|
| 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}. |
| 225 |
|
| 226 |
\section1 Significant Improvements |
| 227 |
|
| 228 |
The following modules have been significantly improved for Qt 4: |
| 229 |
|
| 230 |
\list |
| 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. |
| 245 |
\endlist |
| 246 |
|
| 247 |
\section1 Build System |
| 248 |
|
| 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. |
| 253 |
|
| 254 |
\table |
| 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 |
| 270 |
\endtable |
| 271 |
|
| 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). |
| 277 |
|
| 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). |
| 282 |
|
| 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 |
| 286 |
|
| 287 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.pro 0 |
| 288 |
|
| 289 |
to your .pro file. To enable the other libraries, add the line |
| 290 |
|
| 291 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.pro 1 |
| 292 |
|
| 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. |
| 297 |
|
| 298 |
To compile code that uses UI files, you will also need this line in |
| 299 |
the .pro file: |
| 300 |
|
| 301 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.pro 2 |
| 302 |
|
| 303 |
\section1 Include Syntax |
| 304 |
|
| 305 |
The syntax for including Qt class definitions has become |
| 306 |
|
| 307 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 3 |
| 308 |
|
| 309 |
For example: |
| 310 |
|
| 311 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 4 |
| 312 |
|
| 313 |
This is guaranteed to work for any public Qt class. The old syntax, |
| 314 |
|
| 315 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 5 |
| 316 |
|
| 317 |
still works, but we encourage you to switch to the new syntax. |
| 318 |
|
| 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). |
| 325 |
|
| 326 |
To include the definitions for all the classes in a library, simply |
| 327 |
specify the name of that library. For example: |
| 328 |
|
| 329 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 6 |
| 330 |
|
| 331 |
\section1 Namespaces |
| 332 |
|
| 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. |
| 336 |
|
| 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 |
| 340 |
|
| 341 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 7 |
| 342 |
|
| 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). |
| 346 |
|
| 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. |
| 353 |
|
| 354 |
The \l{qt3to4 - The Qt 3 to 4 Porting Tool}{qt3to4} porting tool |
| 355 |
automates this conversion. |
| 356 |
|
| 357 |
\section1 QObject/QWidget Constructors |
| 358 |
|
| 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. |
| 362 |
|
| 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: |
| 367 |
|
| 368 |
\list |
| 369 |
\o Code that used it looked confusing, for example: |
| 370 |
|
| 371 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 8 |
| 372 |
|
| 373 |
\c label1 is a QLabel that displays the text "Hello"; \c |
| 374 |
label2 is a QLabel with no text, with the object name |
| 375 |
"Hello". |
| 376 |
|
| 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: |
| 380 |
|
| 381 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 9 |
| 382 |
|
| 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 |
| 387 |
promise. |
| 388 |
\endlist |
| 389 |
|
| 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. |
| 399 |
|
| 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 |
| 404 |
reparents them. |
| 405 |
|
| 406 |
\section1 Dynamic Casts |
| 407 |
|
| 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. |
| 413 |
|
| 414 |
Here's the Qt 3 idiom to cast a type to a subtype: |
| 415 |
|
| 416 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 10 |
| 417 |
|
| 418 |
The Qt 4 idiom is both cleaner and safer, because typos will always |
| 419 |
result in compiler errors: |
| 420 |
|
| 421 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 11 |
| 422 |
|
| 423 |
\section1 QPointer<T> |
| 424 |
|
| 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. |
| 429 |
|
| 430 |
Example: |
| 431 |
|
| 432 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.cpp 12 |
| 433 |
|
| 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. |
| 438 |
|
| 439 |
\section1 Paint Events |
| 440 |
|
| 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). |
| 444 |
|
| 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. |
| 450 |
|
| 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. |
| 454 |
|
| 455 |
\section1 Qt 3 Support Layer |
| 456 |
|
| 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. |
| 460 |
|
| 461 |
\list |
| 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). |
| 465 |
|
| 466 |
\o Other classes provide compatibility functions. Most of these are |
| 467 |
implemented inline, so that they don't bloat the Qt libraries. |
| 468 |
\endlist |
| 469 |
|
| 470 |
To enable the Qt 3 support classes and functions, add the line |
| 471 |
|
| 472 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.pro 13 |
| 473 |
|
| 474 |
to your \c .pro file. |
| 475 |
|
| 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 |
| 479 |
|
| 480 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.pro 14 |
| 481 |
|
| 482 |
to your \c .pro file. |
| 483 |
|
| 484 |
If you want to use compatibility functions but don't want to link |
| 485 |
against the Qt3Support library, add the line |
| 486 |
|
| 487 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.pro 15 |
| 488 |
|
| 489 |
or |
| 490 |
|
| 491 |
\snippet doc/src/snippets/code/doc_src_qt4-intro.pro 16 |
| 492 |
|
| 493 |
to your \c .pro file, depending on whether you want compatibility |
| 494 |
function calls to generate compiler warnings or not. |
| 495 |
*/ |
| 496 |
|
| 497 |
/*! |
| 498 |
\page qt4-8-intro.html |
| 499 |
\title What's New in Qt 4.8 |
| 500 |
|
| 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. |
| 504 |
|
| 505 |
A list of other Qt 4 features can be found on the \bold{\l{What's |
| 506 |
New in Qt 4}} page. |
| 507 |
|
| 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. |
| 511 |
|
| 512 |
\list |
| 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}. |
| 518 |
\endlist |
| 519 |
|
| 520 |
|
| 521 |
\section1 Qt Platform Abstraction -- \e Lighthouse |
| 522 |
|
| 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 |
| 525 |
window systems. |
| 526 |
|
| 527 |
\section1 Qt WebKit 2.2 |
| 528 |
|
| 529 |
The new Qt WebKit release introduces bug fixes, performance improvements, |
| 530 |
and greater compiler compatibility. |
| 531 |
|
| 532 |
\section1 Threaded OpenGL |
| 533 |
|
| 534 |
Many Qt OpenGL functions are now thread-safe. Threads that cater to |
| 535 |
different situations are now available. |
| 536 |
|
| 537 |
\list |
| 538 |
\o Buffer swapping thread |
| 539 |
\o Texture uploading thread |
| 540 |
\o \l QPainter thread |
| 541 |
\endlist |
| 542 |
|
| 543 |
\section1 Deprecated Items in Qt 4.8 |
| 544 |
|
| 545 |
As part of Open Governance, modules in Qt 4.8 will receive maintainers and |
| 546 |
receive different support levels. |
| 547 |
|
| 548 |
Currently, a module has an activity classification, the \e{Module Maturity Level}. |
| 549 |
As well, a list of modules and their maturity level is in the \l{Qt Developer Network}. |
| 550 |
|
| 551 |
\list |
| 552 |
\o \l{Qt Modules' Maturity Level - Description} - description of the |
| 553 |
different \e{maturity levels} |
| 554 |
\o \l{Qt Modules' Maturity Levels - Modules List} - list of the Qt |
| 555 |
modules and their maturity level |
| 556 |
\endlist |
| 557 |
\section1 Additions to the Qt API |
| 558 |
|
| 559 |
Qt 4.8 introduces changes to the Qt API. |
| 560 |
\list |
| 561 |
\o C++11 support: |
| 562 |
Qt supports some of the features of the C++11 standard. QList, QVector and |
| 563 |
QStringList can be initialized with initializer lists. Most of the tool |
| 564 |
classes have a move operator. It is possible to use lambda functions in some |
| 565 |
of the QtConcurrent functions. |
| 566 |
|
| 567 |
\o Localization API |
| 568 |
|
| 569 |
Changes to the Localization APIs include improvements to \l QLocale and more |
| 570 |
support for different language code formats. |
| 571 |
|
| 572 |
\list |
| 573 |
\o \l {QLocale::quoteString()} - for localized quotes |
| 574 |
\o \l {QLocale::createSeparatedList()} - for localized list separation (e.g. "1, 2 and 3") |
| 575 |
\o \l {QLocale::bcp47Name()} - for locale names in the canonical form |
| 576 |
according to \l {RFC 5646 - BCP47} |
| 577 |
\o \l {QLocale::matchingLocales()} - to get a list of locales that match a |
| 578 |
criteria - e.g. a list of locales that use French language. |
| 579 |
\o \l {QLocale::firstDayOfWeek()} |
| 580 |
\o \l {QLocale::weekdays()} |
| 581 |
\o \l{QLocale::currencySymbol()} |
| 582 |
\o \l{QLocale::toCurrencyString()} - number formatting for currencies |
| 583 |
\o \l{QLocale::uiLanguages()} |
| 584 |
\o \l{QLocale::nativeLanguageName()} |
| 585 |
\o \l{QLocale::nativeCountryName()} |
| 586 |
\endlist |
| 587 |
\o IP Multicast API |
| 588 |
\o Multithreaded HTTP |
| 589 |
\o QThreadLocalStorage can now store simple objects in addition to pointers |
| 590 |
\endlist |
| 591 |
|
| 592 |
\section1 New Classes, Functions, Macros, etc. |
| 593 |
\sincelist 4.8 |
| 594 |
*/ |
| 595 |
|
| 596 |
/*! |
| 597 |
\page qt4-7-intro.html |
| 598 |
\title What's New in Qt 4.7 |
| 599 |
|
| 600 |
Qt 4.7 provides many improvements and enhancements over the |
| 601 |
previous releases in the Qt 4 series. This document covers the |
| 602 |
most important features in this release, separated by category. |
| 603 |
|
| 604 |
A list of other Qt 4 features can be found on the \bold{\l{What's |
| 605 |
New in Qt 4}} page. |
| 606 |
|
| 607 |
\section1 Declarative UI Development with Qt Quick |
| 608 |
|
| 609 |
\image quick_screens.png |
| 610 |
|
| 611 |
Qt 4.7 introduces \l{Qt Quick}, the Qt UI Creation Kit. that enables |
| 612 |
the creation of dynamic user interfaces, easier and more effective |
| 613 |
than possible with existing UI technologies. This UI Creation Kit |
| 614 |
consists of three technologies: |
| 615 |
|
| 616 |
\list |
| 617 |
\i QML is a declarative language oriented on JavaScript that utilizes |
| 618 |
Qt's Meta-Object capabilities to enable designers and developers to |
| 619 |
collaborate tightly and create animated and fluid user experiences, |
| 620 |
using existing knowledge in script language and design. |
| 621 |
|
| 622 |
\i Qt Declarative is a C++ library that provides the underlying engine, |
| 623 |
which translates the declarative description of the UI in QML into |
| 624 |
items on a QGraphicsScene. The library also provides APIs to bind |
| 625 |
custom C++ types and elements to QML, and to connect the QML UI with |
| 626 |
the underlying application logic written in C++. |
| 627 |
|
| 628 |
\i Qt Creator has been improved to support interactive editing of |
| 629 |
QML UIs through drag-and-drop. The text editor supports the QML |
| 630 |
syntax and provides authoring assistance such as auto-completion, |
| 631 |
error lookup, help lookup and easy preview of QML UI's. The Qt |
| 632 |
Quick features in Qt Creator will be released with Qt Creator 2.1 |
| 633 |
\endlist |
| 634 |
|
| 635 |
\section1 Network Bearer Management |
| 636 |
|
| 637 |
Bearer Management controls the connectivity state of the system. |
| 638 |
The new Bearer Management API in the QtNetwork module allows the |
| 639 |
application to identify whether the system is online and how many |
| 640 |
interfaces there are, as well as start and stop interfaces, or |
| 641 |
roam transparently between access points. |
| 642 |
|
| 643 |
QNetworkAccessManager uses this API for HTTP level roaming. |
| 644 |
|
| 645 |
\section1 Feature Improvements in QtWebKit |
| 646 |
|
| 647 |
The QGraphicsWebView class has a new tiled backing store, which |
| 648 |
improves scrolling and zooming performance. You can even create |
| 649 |
animated zoom-in or zoom-out effects (see |
| 650 |
QWebSettings::TiledBackingStoreEnabled). |
| 651 |
|
| 652 |
On mobile platforms, it is often useful to avoid displaying |
| 653 |
separate scrollbars for iframes and framesets. If you switch on |
| 654 |
frame flattening, QtWebKit will resize frames to fit their content |
| 655 |
to avoid separate scrollbars (see |
| 656 |
QWebSettings::FrameFlatteningEnabled). |
| 657 |
|
| 658 |
Qt 4.7 adds support for accelerated compositing, which enhances |
| 659 |
the performance of CSS animations and transitions. Read more in |
| 660 |
\l{http://labs.trolltech.com/blogs/2010/05/17/qtwebkit-now-accelerates-css-animations-3d-transforms/}{this blog}. |
| 661 |
|
| 662 |
For hybrid QtWebKit and C++ projects, Qt 4.7 has added support for |
| 663 |
transporting \l{QPixmap}s between Qt C++ and WebKit. We have also |
| 664 |
improved the documentation for hybrid development. Read more here: |
| 665 |
\l{The QtWebKit Bridge}. |
| 666 |
|
| 667 |
\section1 QtWebKit Performance Benchmarks |
| 668 |
|
| 669 |
We have introduced a set of performance benchmarks for QtWebKit, |
| 670 |
and made numerous improvements in rendering performance, page |
| 671 |
loading performance, scrolling performance and CSS performance. |
| 672 |
Here are some examples from the benchmarks run on a 64-bit Linux |
| 673 |
workstation with the raster graphics system. |
| 674 |
|
| 675 |
In a benchmark that measures the scrolling performance on popular |
| 676 |
websites, we found out that Qt 4.7.0 on this platform is 350% |
| 677 |
faster than Qt 4.6.0, thanks to several rendering related |
| 678 |
improvements. |
| 679 |
|
| 680 |
Our page loading benchmark shows an improvement of 16% in Qt 4.7.0 |
| 681 |
from Qt 4.6.0. This is due to improvements in text layout speed, |
| 682 |
image decoding, resource loading and event handling. |
| 683 |
|
| 684 |
Several CSS animation benchmarks indicate a speed improvement of |
| 685 |
31% from Qt 4.6.0 to Qt 4.7.0. These benchmarks are effectively |
| 686 |
showing the improvement we get from accelerated compositing (see |
| 687 |
above). |
| 688 |
|
| 689 |
\section1 Other Performance Related Improvements |
| 690 |
|
| 691 |
In addition to the QtWebKit module, performance has been a focus |
| 692 |
area in Qt 4.7 throughout the Qt framework. Here are a couple of |
| 693 |
examples about performance related feature improvements. |
| 694 |
|
| 695 |
On Mac OS X, Qt now uses a different widget implementation (called |
| 696 |
"alien widgets"), which improves the responsiveness of |
| 697 |
applications that have complex user interfaces with several |
| 698 |
widgets. |
| 699 |
|
| 700 |
Qt 4.7 introduces the QStaticText class, which can be used to |
| 701 |
improve text rendering performance. More info is available from |
| 702 |
\l{http://labs.trolltech.com/blogs/2010/03/01/insanity-is-shaping-the-same-text-again-and-expecting-a-different-result/}{this blog}. |
| 703 |
|
| 704 |
The QPainter class has a new API for rendering pixmap fragments |
| 705 |
(QPainter::drawPixmapFragments), which can improve the rendering |
| 706 |
performance of applications that need to render |
| 707 |
\l{QPainter::drawPixmapFragments()}{pixmap fragments}. |
| 708 |
|
| 709 |
Qt 4.7 has an updated version of the JavaScriptCore engine for the |
| 710 |
QtScript module, which improves JavaScript execution performance. |
| 711 |
|
| 712 |
\section1 New Classes, Functions, Macros, etc. |
| 713 |
|
| 714 |
Links to new classes, elements, functions, macros, and other items |
| 715 |
introduced in Qt 4.7. |
| 716 |
|
| 717 |
\sincelist 4.7 |
| 718 |
*/ |
| 719 |
|
| 720 |
/*! |
| 721 |
\page qt4-6-intro.html |
| 722 |
\title What's New in Qt 4.6 |
| 723 |
|
| 724 |
Qt 4.6 provides many improvements and enhancements over the |
| 725 |
previous releases in the Qt 4 series. This document covers the |
| 726 |
most important features in this release, separated by category. |
| 727 |
|
| 728 |
\omit |
| 729 |
A comprehensive list of changes between Qt 4.5 and Qt 4.6 is |
| 730 |
included in the \c changes-4.6.0 file |
| 731 |
\l{http://qt.nokia.com/developer/changes/changes-4.6.0}{available |
| 732 |
online}. A \l{Known Issues in %VERSION%}{list of known issues} |
| 733 |
for this release is also available. |
| 734 |
|
| 735 |
Changes between this release and the previous release are provided |
| 736 |
in the \c{changes-%VERSION%} file (also |
| 737 |
\l{http://qt.nokia.com/developer/changes/changes-%VERSION%}{available online}). |
| 738 |
\endomit |
| 739 |
|
| 740 |
A list of other Qt 4 features can be found on the \bold{\l{What's |
| 741 |
New in Qt 4}} page. |
| 742 |
|
| 743 |
\section1 Support for Symbian |
| 744 |
|
| 745 |
Qt 4.6 is the first release to include support for the Symbian |
| 746 |
platform, with integration into the S60 framework. The port to |
| 747 |
Symbian and S60 provides all functionality required to develop |
| 748 |
rich end-user applications for devices running S60 3.1 and |
| 749 |
later. |
| 750 |
|
| 751 |
See the \l{The Symbian platform - Introduction to Qt} for more information. |
| 752 |
|
| 753 |
\section1 Animation Framework |
| 754 |
|
| 755 |
The animation framework helps build highly animated, |
| 756 |
high-performance GUIs without the hassle of managing complex |
| 757 |
structures, timers, and easing curves, not to mention the large |
| 758 |
state graphs that all animated GUIs tend to be full of. |
| 759 |
|
| 760 |
The framework makes it easy to animate \l{QObject}s, including |
| 761 |
QWidgets, by allowing Qt properties to be animated. It also allows |
| 762 |
creating custom animations and interpolation functions. Graphics |
| 763 |
views are not left out; one can animate \l{QGraphicsWidget}s and |
| 764 |
new \l{QGraphicsObject}s which inherit from QGraphicsItem |
| 765 |
(and thereby enable properties). |
| 766 |
|
| 767 |
Animations are controlled using easing curves and can be grouped |
| 768 |
together. This enables animations of arbitrary complexity. |
| 769 |
|
| 770 |
The API is easy to grasp with functions such as start(), stop(), |
| 771 |
pause(), and currentTime(). Here is an image from one of the |
| 772 |
examples that come with the framework: |
| 773 |
|
| 774 |
\image whatsnewanimatedtiles.png |
| 775 |
|
| 776 |
The animation framework also plugs into the new Qt Statemachine by |
| 777 |
allowing an animation to be played when transitions are triggered. |
| 778 |
The state machine framework is introduced in 4.6 and is described |
| 779 |
below. |
| 780 |
|
| 781 |
See \l{The Animation Framework} documentation for more information. |
| 782 |
|
| 783 |
\section1 State Machine Framework |
| 784 |
|
| 785 |
The state machine framework provides a robust state chart |
| 786 |
implementation based on Harel statecharts and SCXML. Qt's API lets |
| 787 |
you construct such state graphs and execute them. The key benefits |
| 788 |
of a state machine are: |
| 789 |
|
| 790 |
\list |
| 791 |
\o Simplify complex application semantics. |
| 792 |
\o Use of states to reduce code bloat. |
| 793 |
\o Use states to improve maintainability. |
| 794 |
\o Makes event-driven programming robust and more |
| 795 |
reusable. |
| 796 |
\endlist |
| 797 |
|
| 798 |
It is especially the last item here that makes using a state |
| 799 |
machine worthwhile. A key characteristic of event-driven systems |
| 800 |
(such as Qt applications) is that behavior often depends not only |
| 801 |
on the last or current event, but also the events that preceded |
| 802 |
it. With statecharts, this information is easy to express. |
| 803 |
|
| 804 |
The framework fits neatly into Qt by allowing transitions to |
| 805 |
trigger on signals and \l{QEvent}s. By inserting animations into |
| 806 |
the state machine, it is also easier to use the framework for |
| 807 |
animating GUIs, for instance. |
| 808 |
|
| 809 |
See \l{The State Machine Framework} documentation for more information. |
| 810 |
|
| 811 |
\section1 Touch and Gestures |
| 812 |
|
| 813 |
Support for touch input enables users to interact with many |
| 814 |
parts of a user interface at the same time, and provides the basis |
| 815 |
for gestures. Additional infrastructure for gesture recognition |
| 816 |
allows a sequence of touch inputs to be combined to create gestures |
| 817 |
that can be used to activate features and trigger actions in an |
| 818 |
application. |
| 819 |
|
| 820 |
\image gestures.png |
| 821 |
|
| 822 |
This new functionality brings a number of benefits: |
| 823 |
|
| 824 |
\list |
| 825 |
\o Allows users to interact with applications in more natural ways. |
| 826 |
\o Simplifies finger-based interaction with UI components. |
| 827 |
\o Combines support for common basic gestures and touch gestures |
| 828 |
in a single general framework. |
| 829 |
\o Enables extensibility by design. |
| 830 |
\endlist |
| 831 |
|
| 832 |
See the QTouchEvent class documentation for more information on touch |
| 833 |
input and QGestureEvent for gestures. |
| 834 |
|
| 835 |
\section1 DOM Access API |
| 836 |
|
| 837 |
Web pages and XML both have very complex document object models. |
| 838 |
The W3C selector API provides a very simple way to access and |
| 839 |
manipulate such structures. This API makes it intuitive to access |
| 840 |
DOM, helps reuse CSS selector knowledge, and gives little |
| 841 |
maintenance or footprint overhead. |
| 842 |
|
| 843 |
\snippet webkitsnippets/webelement/main.cpp FindAll |
| 844 |
|
| 845 |
See the QWebElement class documentation for more information. |
| 846 |
|
| 847 |
\section1 Performance Optimizations |
| 848 |
|
| 849 |
As always, Qt continuously strive to optimize its performance. |
| 850 |
For this release, we have: |
| 851 |
|
| 852 |
\list |
| 853 |
\o Rewritten the QGraphicsView rendering algorithm. |
| 854 |
\o Made QPixmapCache support efficient Key data structure. |
| 855 |
\o Reduced overhead in QNetworkAccessManager. |
| 856 |
\o Added the QContiguousCache class, which provides efficient caching of |
| 857 |
contiguous data. |
| 858 |
\o Added support for hardware-accelerated rendering through |
| 859 |
\l{OpenVG Rendering in Qt}{OpenVG} |
| 860 |
\o Removed Win9x support. |
| 861 |
\endlist |
| 862 |
|
| 863 |
\section1 Graphics Effects |
| 864 |
|
| 865 |
Effects can be used to alter the appearance of UI elements such as |
| 866 |
\l{QGraphicsItem}s and \l{QWidget}s. A couple of standard effects such |
| 867 |
as blurring, colorizing and drop shadow are provided, and it is |
| 868 |
possible to implement custom effects. |
| 869 |
|
| 870 |
\table |
| 871 |
\row |
| 872 |
\o{2,1} \img graphicseffect-plain.png |
| 873 |
\row |
| 874 |
\o \img graphicseffect-blur.png |
| 875 |
\o \img graphicseffect-colorize.png |
| 876 |
\row |
| 877 |
\o \img graphicseffect-opacity.png |
| 878 |
\o \img graphicseffect-drop-shadow.png |
| 879 |
\endtable |
| 880 |
|
| 881 |
See the QGraphicsEffect class documentation for more information. |
| 882 |
|
| 883 |
\section1 XML Schema Validation |
| 884 |
|
| 885 |
The QtXmlPatterns module can now be used to validate schemas, either |
| 886 |
through C++ APIs in the Qt application, or using the xmlpatternsvalidator |
| 887 |
command line utility. The implementation of XML Schema Validation supports |
| 888 |
the specification version 1.0 in large parts. |
| 889 |
|
| 890 |
\img xml-schema.png |
| 891 |
|
| 892 |
See the \l{XML Processing} and QXmlSchema class documentation for more |
| 893 |
information. |
| 894 |
|
| 895 |
\section1 Qt3D Enablers |
| 896 |
|
| 897 |
As more of Qt, and more of the applications built on Qt go 3D, |
| 898 |
API's should be provided to simplify this. Mainly, the new API |
| 899 |
aims to make it more easy to create 3D applications with OpenGL. |
| 900 |
It will also unify the Qt OpenGL codebase, and enable |
| 901 |
cross-platform 3D codebase. |
| 902 |
|
| 903 |
The main features of the Qt3D enablers are currently: Math |
| 904 |
primitives for matrix multiplication, vectors, quaternions |
| 905 |
(client-side), and an API for vertex and fragment shaders, GLSL/ES. |
| 906 |
Future research will, among other things include stencils, |
| 907 |
scissors, vertex buffers and arrays, texture manipulation, and |
| 908 |
geometry shaders. |
| 909 |
|
| 910 |
\section1 Multimedia Services |
| 911 |
|
| 912 |
Qt 4.6 comes with new classes for handling audio. These classes |
| 913 |
provide low-level access to the system's audio system. By |
| 914 |
specifying the audio format (QAudioFormat) and supplying audio |
| 915 |
data through a QIODevice, you get direct access to the |
| 916 |
functionality of the sound device. The API also comes with |
| 917 |
functions to query audio devices for which audio formats they |
| 918 |
support. |
| 919 |
|
| 920 |
See the \l{QtMultimedia Module} documentation for more information. |
| 921 |
|
| 922 |
\section1 New Classes, Functions, Macros, etc. |
| 923 |
|
| 924 |
Links to new classes, functions, macros, and other items |
| 925 |
introduced in Qt 4.6. |
| 926 |
|
| 927 |
\sincelist 4.6 |
| 928 |
|
| 929 |
*/ |
| 930 |
|
| 931 |
/* |
| 932 |
\page qt4-5-intro.html |
| 933 |
\title What's New in Qt 4.5 |
| 934 |
|
| 935 |
Qt 4.5 provides many improvements and enhancements over the previous releases |
| 936 |
in the Qt 4 series. This document covers the most important features in this |
| 937 |
release, separated by category. |
| 938 |
|
| 939 |
A comprehensive list of changes between Qt 4.4 and Qt 4.5 is included |
| 940 |
in the \c changes-4.5.0 file |
| 941 |
\l{http://qt.nokia.com/developer/changes/changes-4.5.0}{available online}. |
| 942 |
A \l{Known Issues in %VERSION%}{list of known issues} for this release is also |
| 943 |
available. |
| 944 |
|
| 945 |
Changes between this release and the previous release are provided |
| 946 |
in the \c{changes-%VERSION%} file (also |
| 947 |
\l{http://qt.nokia.com/developer/changes/changes-%VERSION%}{available online}). |
| 948 |
|
| 949 |
A list of other Qt 4 features can be found on the |
| 950 |
\bold{\l{What's New in Qt 4}} page. |
| 951 |
|
| 952 |
\section1 Qt WebKit Integration |
| 953 |
|
| 954 |
\image webkit-netscape-plugin.png |
| 955 |
|
| 956 |
The WebKit browser engine included with Qt has been upgraded to the latest |
| 957 |
upstream (trunk) version of WebKit, bringing the latest features and |
| 958 |
improvements to Qt applications. These include: |
| 959 |
|
| 960 |
\list |
| 961 |
\o Support for full page zooming, with appropriate rescaling of images and fonts. |
| 962 |
\o The CSS-based transformation and animation features provided by a WebKit |
| 963 |
extension. |
| 964 |
\o Performance improvements due to faster JavaScript engine and optimized |
| 965 |
page loading. |
| 966 |
\endlist |
| 967 |
|
| 968 |
Standards compatibility improvements include provision for the Netscape plugin |
| 969 |
API, allowing most Netscape plugins to be used in-process, support for HTML 5 |
| 970 |
audio and video elements using Qt's Phonon integration, and |
| 971 |
\l{Web Application Support}{facilities for client-side storage of Web content}. |
| 972 |
|
| 973 |
\section1 Performance Improvements |
| 974 |
|
| 975 |
The introduction of the QtBenchLib performance benchmarking library enables |
| 976 |
performance benchmarking and regression testing. Core parts of Qt itself have |
| 977 |
undergone focused re-engineering for improved graphics performance, including |
| 978 |
paint engine and text rendering improvements, Graphics View and style sheet |
| 979 |
performance improvements. |
| 980 |
|
| 981 |
The X11 paint engine now uses XSHM (the X shared memory extension), resulting |
| 982 |
in reduced overhead for painting operations. |
| 983 |
|
| 984 |
A new OpenGL ES 2.0-based paint engine complements the existing OpenGL paint |
| 985 |
engine, but with a focus on embedded devices. |
| 986 |
|
| 987 |
Qt now features a pluggable graphics system, making it possible for users |
| 988 |
and developers to select raster, OpenGL or native graphics systems to take |
| 989 |
into account the specific needs of their applications and get the best |
| 990 |
performance out of them. |
| 991 |
|
| 992 |
\section1 Mac OS X Cocoa Support |
| 993 |
|
| 994 |
\image mac-cocoa.png |
| 995 |
|
| 996 |
Qt for Mac OS X has been substantially rewritten to use Apple's Cocoa API, |
| 997 |
enabling Qt applications to be deployed on 64-bit Macintosh hardware. |
| 998 |
In addition, the new QMacCocoaViewContainer and QMacNativeWidget classes |
| 999 |
provide integration with Cocoa's own features and controls. |
| 1000 |
|
| 1001 |
For many applications, a simple recompilation is all that is required |
| 1002 |
to produce an executable for 64-bit systems. Applications that use |
| 1003 |
specific features may require a few changes first. |
| 1004 |
|
| 1005 |
\section1 Windows CE Feature Parity |
| 1006 |
|
| 1007 |
Qt for Windows CE has been updated to bring features of Qt 4.4 and Qt 4.5 |
| 1008 |
to the Windows CE platform, including: |
| 1009 |
|
| 1010 |
\list |
| 1011 |
\o Phonon Multimedia Framework, using a Direct-Show based backend for audio |
| 1012 |
and video playback and a Simple WaveOut backend for devices without DirectShow. |
| 1013 |
\o The inclusion of Qt WebKit integration features previously unavailable for |
| 1014 |
Qt 4.4 on Windows CE. |
| 1015 |
\endlist |
| 1016 |
|
| 1017 |
Support on all Windows CE platforms; recommended for WinCE 6 and higher. |
| 1018 |
|
| 1019 |
The inclusion of these features enables developers to easily integrate Web and |
| 1020 |
multimedia content into Qt applications on Windows CE Standard Edition while |
| 1021 |
retaining full cross-platform compatibility with other Qt platforms. |
| 1022 |
|
| 1023 |
\section1 XML Transformations with XSLT |
| 1024 |
|
| 1025 |
The QtXmlPatterns module has been extended to cover XSLT, a transformation language |
| 1026 |
for XML documents. A common application of this is the transformation of XML data |
| 1027 |
into human-readable formats for reporting purposes. |
| 1028 |
|
| 1029 |
XSLT makes it simple to reformat XML content without changing data structures, |
| 1030 |
removes the need for an intermediate DOM layer for presentation, and enables |
| 1031 |
rapid solutions to be created; for example, creating reports as HTML or PDF. |
| 1032 |
|
| 1033 |
\section1 Qt Script Debugger |
| 1034 |
|
| 1035 |
\image qtscript-debugger-small.png |
| 1036 |
|
| 1037 |
Developers using Qt Script in their applications can take advantage of |
| 1038 |
the new \l{Qt Script Debugger Manual}{Qt Script Debugger} to provide |
| 1039 |
error reporting for scripts, and to let users track down bugs in their |
| 1040 |
own scripts. |
| 1041 |
|
| 1042 |
Many standard features of GUI debugging tools are present, allowing the |
| 1043 |
developer to step through running script code, inspect variables, |
| 1044 |
automatically catch exceptions, and set conditional breakpoints. |
| 1045 |
|
| 1046 |
\section1 OpenDocument File Format Support |
| 1047 |
|
| 1048 |
Qt 4.5 includes support for writing rich text documents as OpenDocument files via |
| 1049 |
the newly-introduced QTextDocumentWriter class. This provides an generic mechanism |
| 1050 |
for file export that can be used to introduce support for additional formats in |
| 1051 |
future releases. |
| 1052 |
|
| 1053 |
\section1 Improved Network Proxy Support |
| 1054 |
|
| 1055 |
Qt's networking classes have been updated with |
| 1056 |
\l{QtNetwork Module#Support for Network Proxies}{improved proxy support}. |
| 1057 |
This includes improved integration with system proxy settings and the added |
| 1058 |
ability to handle non-trivial proxy cases. |
| 1059 |
|
| 1060 |
\section1 Qt Designer Improvements |
| 1061 |
|
| 1062 |
\image designer-screenshot-small.png |
| 1063 |
|
| 1064 |
Qt Designer 4.5 boasts some improvements on usability, for example: |
| 1065 |
|
| 1066 |
\list |
| 1067 |
\o \bold{Icon Mode} for the widget box which substantially reduces |
| 1068 |
scrolling. |
| 1069 |
\o \bold{Morphing Widgets} which lets you morph similar widget types, |
| 1070 |
e.g., a QWidget to a QFrame, types via the context menu's |
| 1071 |
\e{Morph into} entry. |
| 1072 |
\o \bold{Filters} for the \gui{Property Editor} that lets you find |
| 1073 |
properties or widgets quickly. |
| 1074 |
\o \bold{Find option} for the \gui{Object Inspector} that performs an |
| 1075 |
incremental search on the form's widgets. Also, the objects' layout |
| 1076 |
state is displayed here with using an icon on the left. Broken |
| 1077 |
layouts are represented with the same icon used for the |
| 1078 |
\e{Break Layout} action. |
| 1079 |
\endlist |
| 1080 |
|
| 1081 |
In addition, Qt Designer now features an \gui{Embedded Design} tab that can |
| 1082 |
be found in the \gui Preferences dialog. Within this tab, you can define |
| 1083 |
embedded device profiles. These profiles contains screen settings, e.g., |
| 1084 |
display resolution, default font and default style. Qt Designer will use |
| 1085 |
these settings when you edit forms. |
| 1086 |
|
| 1087 |
More information about these improvements can be found in the |
| 1088 |
\l{What's New in Qt Designer 4.5} overview. |
| 1089 |
|
| 1090 |
\section1 Qt Linguist Improvements |
| 1091 |
|
| 1092 |
Qt Linguist can now load and edit multiple translation files simultaneously. |
| 1093 |
|
| 1094 |
Support for XML Localization Interchange File Format (XLIFF) files, previously added |
| 1095 |
to the \c lupdate tool in Qt 4.3, has been improved and extended to the rest of the |
| 1096 |
Qt Linguist toolchain. This enables files stored in Qt's TS translation format to |
| 1097 |
be exported for use with other tools. |
| 1098 |
|
| 1099 |
The GNU Gettext PO format, which is commonly used in Open Source projects, |
| 1100 |
is now supported by Qt Linguist. |
| 1101 |
|
| 1102 |
Support for a new way to annotate messages, using comments in the source code, |
| 1103 |
has been added to the toolchain. See the QObject::tr() documentation for a detailed |
| 1104 |
description and examples. |
| 1105 |
|
| 1106 |
The new \c lconvert filter tool facilitates conversion between file formats and |
| 1107 |
can be used to perform other transformations on collections of translatable strings. |
| 1108 |
|
| 1109 |
\section1 Graphics Enhancements |
| 1110 |
|
| 1111 |
In addition to the performance improvements in this release, a number of graphics |
| 1112 |
enhancements extend support for existing features to more platforms and expand Qt's |
| 1113 |
core set of features with successful add-ons. |
| 1114 |
|
| 1115 |
Widget style sheets can now be used on Mac OS X, making this approach to theming |
| 1116 |
and styling viable for truly cross-platform applications. |
| 1117 |
|
| 1118 |
Support for ARGB top-level widgets, previously available as a separate solution, |
| 1119 |
is now provided as an integral part of Qt. This makes it possible to create windows |
| 1120 |
with translucent regions on systems with the appropriate support from the user's |
| 1121 |
window system. See the \l{QWidget#Creating Translucent Windows}{Creating Translucent |
| 1122 |
Windows} section of the QWidget documentation for details of this feature. |
| 1123 |
|
| 1124 |
|
| 1125 |
\image gtk-style-screenshot.png |
| 1126 |
|
| 1127 |
Improved GTK+ integration provided by the QGtkStyle class improves the look and feel |
| 1128 |
of Qt applications in GNOME and other GTK-based environments. The screenshot above |
| 1129 |
illustrates this clearly. |
| 1130 |
*/ |