summaryrefslogtreecommitdiffstats
path: root/doc/src/whatsnew/whatsnew50.qdoc
blob: c05301a47af4eb501a0d7dd6a1a349248511ed35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file.  Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \page whatsnew50.html
    \title What's New in Qt 5.0
    \brief Lists the new features in Qt 5.0

    \section1 Qt Core Changes
    \section2 QStandardPaths
    QStandardPaths is a more powerful version of QDesktopServices that was
    present in Qt 4. Modeled after \l {http://api.kde.org/4.x-api/kdelibs-
    apidocs/kdecore/html/classKStandardDirs.html}{KStandardDirs} from KDE 4, it
    contains additional features such as searching for all occurrences of a
    given file in the storage locations.

    \section2 Compile-time Checks for Signal-slot Connections
    QObject now supports an additional syntax for connecting signals to slots,
    which forces the compiler to check whether the signal and the receiver
    exist and their arguments are compatible.

    This syntax allows connecting a signal to any kind of C++ receiver,
    including C++11 lambdas, member functions, or static functions. The
    receivers no longer need to be declared as slots.

    \section2 Perl-Compatible Regular Expressions
    QRegularExpression is introduced to provide better support for regular
    expressions compatible with Perl. This class is more powerful and
    faster than QRegExp, and supports more features such as lazy and possessive
    quantifiers, lookbehinds, named capturing groups, and iteration of matches.

    \section1 Qt Gui Changes
    \section2 New Classes for Windowing and Rendering
    A new set of enabler classes have been added, most importantly QWindow,
    QScreen, QSurfaceFormat, and QOpenGLContext. These are now used as backends
    for the QtWidgets module and by QtQuick 2.

    \section2 OpenGL Classes
    Most of the useful QtOpenGL classes have been polished and moved into
    QtGui. A few important ones are, QOpenGLFramebufferObject,
    QOpenGLShaderProgram, QOpenGLFunctions, and so on. For the complete list,
    refer to \l{Qt GUI C++ API}.

    This change introduces QOpenGLContext as a replacement for QGLContext. This
    replacement class is more generic and decoupled from QWindow, making it to
    support more use cases such as using the same context for multiple surfaces.

    \section2 QOpenGLPaintDevice
    Instead of having QWindow and QOpenGLFramebufferObject be subclasses of
    QPaintDevice, you can now use QOpenGLPaintDevice. This new alternative can
    be created on the stack, makes it easier and flexible to render into the
    currently bound context using QPainter.

    \section1 Qt Network Changes
    \section2 QDnsLookup
    It is now possible to lookup DNS records using the new QDnsLookup API.
    This does not replace QHostInfo, which is still the API to be used for
    resolving a host name to an IP address. QDnsLookup is mainly used for other
    types of DNS record, such as SRV, TXT and MX.

    \note This new class replaces the Q3Dns API, which is removed in Qt 5.

    \section2 Better Support for IPv6 and Dual-mode Networks
    Most applications using host names and network layer transparent protocols,
    will now gain IPv6 support transparently. This means, QTcpServer and
    QUdpSocket bound to QHostAddress::Any can now receive both IPv4 and IPv6
    connections, although, QHostAddress::AnyIPv4 and QHostAddress::AnyIPv6 can
    be used to bind to only one protocol.

    Outgoing http connections using QNetworkAccessManager will now attempt both
    IPv4 and IPv6 connections in parallel, and use the one that succeeds first.

    \section2 Binding TCP Sockets
    QTcpSocket can be bound to an IP address before connecting, which is useful
    for limiting connection to a specific interface in a multi-homed
    environment.

    \section2 SSL Certificates
    SSL certificate extensions can now be accessed to enable further
    development of SSL support in Qt.

    Developers can also verify an SSL certificate chain programatically now.

    \section2 Workarounds for Buggy SSL Servers
    The QSsl::SslOption enum now allows a QSslSocket-based code to access
    legacy systems by enabling bug workarounds.

    \note This change is also back-ported to Qt 4.8.

    \section2 Support for Opaque Private Keys
    This allows applications to read private keys from devices such as PKCS#11
    dongles, as illustrated by the \l{qsslkey example}

    \section1 Qt Qml Changes
    This is a new module in Qt 5 that provides the QML engine and the backend
    infrastructure.

    \section2 QML Engine
    \list
     \li V8 JavaScript engine
     \li Various parser and compiler optimizations have been implemented along
         with the new bindings optimizer.
     \li Loading/compilation can now be performed in a separate thread. This
         can be enabled by loading a loader object asynchronously through its
         source property, or by passing the Component.Asynchronous parameter to
         \l{Qt::createComponent}{Qt.createComponent()}.
     \li New QQmlEngine::trimComponentCache() function safely discards unused
         data in the engine’s component cache to free memory.
    \endlist

    \section2 Type System
    \list
     \li New \l{QML Basic Type: var}{var} property type can hold JavaScript
         references.
     \li QML properties of type \l{QML Basic Type: var}{var} and \l{QML Basic
         Type: variant}{variant} can now hold pixmaps. See \l{Scarce Resources
         in JavaScript} for more information.
     \li Value type improvements:
      \list
       \li QColor is now a value type. The red, green, blue and alpha channels
           of a “color” property can now be accessed using “r”, “g”, “b” and
           “a” properties.
       \li Improved support for QVector4D, now constructible in QML using
           \l{Qt::vector4d}{Qt.vector4d()}.
      \endlist
     \li Support for certain sequence types (QList<int>, QList<qreal>,
         QList<bool>, QList<QUrl>, QList<QString> and QStringList) has been
         improved. QObjects can define Q_PROPERTYs of these types which can be
         accessed from JavaScript.
    \endlist

    \section2 Other
    \list
     \li JavaScript (.js) files can now import QML modules and other JavaScript
         files using the “import” statement.
     \li QQmlExpression can now be constructed directly (and more efficiently)
         from a QQmlScriptString.
     \li The component returned by \l{Qt::createComponent}{Qt.createComponent()}
         is no longer the owned by the engine. Be sure to hold a reference,or provide a parent.
    \endlist


    \section1 Qt Quick Changes
    This is a new module in Qt 5 which provides the visual canvas and
    scenegraph backend as well as the QtQuick QML module for QML-based
    application development.

    The module replaces the QDeclarative* equivalents in \e {QtQuick 1} with the
    following:
    \list
     \li QQuickView
     \li QQuickCanvas
     \li QQuickItem
     \li QQuickPaintedItem
    \endlist
    See \l{Qt Quick C++ Classes} for the complete list.

    The QtQuick 2.0 QML module is a major update, and the following sections
    outline the features that come with it:

    \section2 New Graphics Architecture

    \list

    \li Qt Quick 2.0 uses a dedicated OpenGL (ES) 2.0 based \l{Qt
    Quick Scene Graph} scene graph for all its rendering.

    \endlist

    \section2 Visual and Graphic Types
    \list
     \li New Canvas type for drawing, provides a HTML5 canvas-like API along
         with the following additional features:
     \list
      \li Two render targets: \c{Canvas::Image}{Canvas.Image} and
          \c{Canvas::FrameBufferObject}{Canvas.FramebufferObject}.
      \li Background thread rendering.
      \li Tiled canvas rendering.
      \li Support for most of the HTML5 context2d APIs.
     \endlist
    \li Image type now has:
     \list
      \li New horizontal and vertical alignment properties, \l{Image::
          Horizontal}{horizontalAlignment} and \l{Image::Horizontal}
          {verticalAlignment}.
      \li \l{Image::fillMode}{Image.Pad} enum value for \c {fillMode}
          property does not transform the image unlike the other \c {fillMode}
          enum values.
      \li \l{Image::sourceSize}{sourceSize.width} and \l{Image::sourceSize}
          {sourceSize.height} now fits the image to size maintaining the aspect
          ratio.
     \endlist
    \endlist

    \section2 Animations
    \list
     \li New \l{SpriteSequence} type renders animated sprites and can
         transition between animations.
     \li New \l{Sprite} type that represents each animation in a
         \l {SpriteSequence}.
     \li New \l{AnimatedSprite} type for drawing single sprite animations.
    \endlist

    \section2 Text
    \list
     \li \l{Text}:
      \list
       \li \l{Text::textFormat}{AutoText} format now switches to \c StyledText
           instead of \c{RichText}.
       \li \l{Text::onLineLaidOut}{onLineLaidOut} handler is called for every
           line during the layout process to give the option of positioning
           and/or resizing text as they are laid out.
       \li \l{Text::doLayout}{doLayout()} method can now trigger the text
           layout from JavaScript.
       \li \l{Text::elide}{ElideRight} to support text that spans multiple
           lines.
       \li \l{Text::fontSizeMode}{fontSizeMode} property now supports wrapping
           the text to the item size.
       \li \l{Text::minimumPixelSize}{minimumPixelSize} and \l{Text::
           minimumPointSize}{minimumPointSize} properties can be used to
           specify a lower bound when auto-fitting.
      \endlist
     \li \c {TextEdit::textFormat}{TextEdit.textFormat} property now defaults
         to \c PlainText instead  of \c AutoText.
     \li \l{TextInput} now has \c wrapMode and verticalAlignment properties.
     \li \c{TextInput.positionAt()} now takes \c y value.
    \endlist

    \section2 User Input
    \list
     \li New \l{MultiPointTouchArea} type can process multi-point touches and
         provide information about the touch points including position,
         pressure and velocity.
     \li MouseArea type now:
     \list
      \li Propagates wheel events.
      \li Propagates \c clicked, \c doubleClicked and \c pressAndHold events
          differently to \c pressed. These events are propagated to the handler
          of the topmost \l{MouseArea} in the stack-order.
      \li Can ignore the propagated events using the
          \c{propagateComposedEvents}. Such ignored events are propagated to
          the next MouseArea handler in the stack-order.
     \endlist
    \endlist

    \section2 Specialized Containers
    \list
     \li \l{Flickable} type now has:
      \list
       \li a new \c rebound property that enables you to specify the transition
           type for the bounce back animation.
       \li New \c topMargin, \c bottomMargin, \c leftMargin, and \c rightMargin
           properties allow extra margin space to be specified. This is useful
           to implement the pull-to-refresh functionality for a list.
       \li New \c xOrigin and \c yOrigin properties provide the top left
           position of the content item.
       \li New \c dragging, \c draggingHorizontally, and \c draggingVertically
           properties that provide information when the flickable area is
           dragged.
      \endlist
    \endlist

    \section2 Positioners
    The following features are related to Row, Column, Grid, and Flow types:
    \list
     \li The “add” and “move” transitions can now access the \l{ViewTransition}
         attached property, and also animate arbitrary item properties (instead
         of being restricted to animating an item’s position).
     \li New \c {Positioner.index}, \c {Positioner.isFirstItem} and
         \c{Positioner.isLastItem} attached properties for items within a
         positioner.
     \li The \l{Grid} type has new \c rowSpacing and \c columnSpacing
         properties.
     \li All spacing properties on positioners now use real numbers instead of
         integers.
    \endlist

    \section2 Models and Views
    \list
     \li \l{ListView} and \l{GridView}:
      \list
       \li Transitions can be specified to animate the adding, removing and
           moving of items in a view. For details, see \l{ViewTransition},
           \l{ListView::add}{ListView.add}, \l {ListView::addDisplaced}
           {ListView.addDisplaced}, \l{GridView::add}{GridView.add}, and
           \l{GridView.addDisplaced}.
       \li New \c verticalLayoutDirection property enables items to be laid out
           from bottom-to-top using the \c BottomToTop enum value.
       \li The \c cacheBuffer property now has a non-zero default and delegates
           in the \c cacheBuffer are created asynchronously.
       \li New \c headerItem and \c footerItem properties provide access to the
           instantiated header and footer items.
       \li \c RightToLeft layout now also reverses the
           \c preferredHighlightBegin and \c preferredHighlightEnd.
      \endlist
     \li \l{ListView}'s new \c {section.labelPositioning} property can fix the
         current section label to the start of the view, and the next section
         label to the end of the view, so that labels do not scroll while
         section items are still in view.
     \li \l{PathView} has two new properties, \c curretnItem and
           \c maximumFlickVelocity.
    \endlist

    \section2 Particles System Support
    The new QtQuick.Particles 2.0 module provides support for the composition
    of a variety of 2D particle systems. See \c{Using the Qt Quick Particle
    System} for more details.

    \section2 Utility Types
    \list
     \li New \l{PathArc}, \l{PathCurve} and \l{PathSvg} types:
     \list
      \li \c PathArc and \c PathCurve support the construction of arcs and
          catmull-rom curves, respectively. PathSvg supports the construction
          of a path from an SVG string.
     \endlist
     \li Loader:
     \list
      \li New \c{asynchronous} property allows components to be instantiated
          with a lower chance of blocking. With the \c {asynchonous} property
          set to \c {true}, the component is compiled in a background thread.
      \li New \c{active} property delays instantiation of a Loader object’s
          item.
      \li New \c {setSource(JSObject)} method to specify initial property
          values for the loaded item, similar to \c{Component::createObject}
          {Component.createObject()}.
      \li \c sourceChanged signal is now only emitted when the source changes
          and the \c sourceComponentChanged signal is now emitted when the
          \c sourceComponent is changed. Ealier, these signals were emitted by
          the Loader only when one of the two properties had changed.
      \li Loader type can now be used as a value source, and it can restore any
          previously set binding if its "when" clause becomes \c false.
     \endlist
    \endlist

    \section1 Qt Multimedia Changes

    Qt Multimedia is an essential module replacing the QtMultimedia library and
    Qt MultimediaKit mobility API in Qt 4.8. It features full support for Audio
    and Video playback, and recording. Support for web cameras is integrated.

    Qt Multimedia uses the system’s native multimedia engine as a backend,
    and does not come with its own audio or video codecs. Thus the supported
    list of codecs is equivalent to the ones supported by the underlying OS.

    It uses DirectShow and WMF on Windows, AVFoundation on Mac and gstreamer on
    Linux.

   \section1 New Classes and Functions
   The section provides a comprehensive list of all new classes and functions
   introduced in Qt 5.

   \sincelist 5.0
*/