Sophie

Sophie

distrib > Mageia > 6 > i586 > by-pkgid > f93881942bd3805980c2fe63aa853d78 > files > 290

qtdoc5-5.9.4-1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- whatsnew50.qdoc -->
  <title>What's New in Qt 5.0 | Qt 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt 5.9</a></td><td >What's New in Qt 5.0</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#qt-core-changes">Qt Core Changes</a></li>
<li class="level2"><a href="#qstandardpaths">QStandardPaths</a></li>
<li class="level2"><a href="#compile-time-checks-for-signal-slot-connections">Compile-time Checks for Signal-slot Connections</a></li>
<li class="level2"><a href="#perl-compatible-regular-expressions">Perl-Compatible Regular Expressions</a></li>
<li class="level1"><a href="#qt-gui-changes">Qt GUI Changes</a></li>
<li class="level2"><a href="#new-classes-for-windowing-and-rendering">New Classes for Windowing and Rendering</a></li>
<li class="level2"><a href="#opengl-classes">OpenGL Classes</a></li>
<li class="level2"><a href="#qopenglpaintdevice">QOpenGLPaintDevice</a></li>
<li class="level1"><a href="#qt-network-changes">Qt Network Changes</a></li>
<li class="level2"><a href="#qdnslookup">QDnsLookup</a></li>
<li class="level2"><a href="#better-support-for-ipv6-and-dual-mode-networks">Better Support for IPv6 and Dual-mode Networks</a></li>
<li class="level2"><a href="#binding-tcp-sockets">Binding TCP Sockets</a></li>
<li class="level2"><a href="#ssl-certificates">SSL Certificates</a></li>
<li class="level2"><a href="#workarounds-for-buggy-ssl-servers">Workarounds for Buggy SSL Servers</a></li>
<li class="level2"><a href="#support-for-opaque-private-keys">Support for Opaque Private Keys</a></li>
<li class="level1"><a href="#qt-qml-changes">Qt QML Changes</a></li>
<li class="level2"><a href="#qml-engine">QML Engine</a></li>
<li class="level2"><a href="#type-system">Type System</a></li>
<li class="level2"><a href="#other">Other</a></li>
<li class="level1"><a href="#qt-quick-changes">Qt Quick Changes</a></li>
<li class="level2"><a href="#new-graphics-architecture">New Graphics Architecture</a></li>
<li class="level2"><a href="#visual-and-graphic-types">Visual and Graphic Types</a></li>
<li class="level2"><a href="#animations">Animations</a></li>
<li class="level2"><a href="#text">Text</a></li>
<li class="level2"><a href="#user-input">User Input</a></li>
<li class="level2"><a href="#specialized-containers">Specialized Containers</a></li>
<li class="level2"><a href="#positioners">Positioners</a></li>
<li class="level2"><a href="#models-and-views">Models and Views</a></li>
<li class="level2"><a href="#particles-system-support">Particles System Support</a></li>
<li class="level2"><a href="#utility-types">Utility Types</a></li>
<li class="level1"><a href="#qt-multimedia-changes">Qt Multimedia Changes</a></li>
<li class="level1"><a href="#new-classes-and-functions">New Classes and Functions</a></li>
<li class="level1"><a href="#additions-to-other-qt-5-releases">Additions to Other Qt 5 Releases</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">What's New in Qt 5.0</h1>
<span class="subtitle"></span>
<!-- $$$whatsnew50.html-description -->
<div class="descr"> <a name="details"></a>
<a name="qt-core-changes"></a>
<h2 id="qt-core-changes">Qt Core Changes</h2>
<a name="qstandardpaths"></a>
<h3 >QStandardPaths</h3>
<p><a href="whatsnew50.html#qstandardpaths">QStandardPaths</a> is a more powerful version of QDesktopServices that was present in Qt 4. Modeled after <a href="http://api.kde.org/4.x-api/kdelibs- apidocs/kdecore/html/classKStandardDirs.html">KStandardDirs</a> from KDE 4, it contains additional features such as searching for all occurrences of a given file in the storage locations.</p>
<a name="compile-time-checks-for-signal-slot-connections"></a>
<h3 >Compile-time Checks for Signal-slot Connections</h3>
<p>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.</p>
<p>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, but such declarations are still recommended for readability.</p>
<p>See <a href="signalsandslots-syntaxes.html">Differences between String-Based and Functor-Based Connections</a> for more details.</p>
<a name="perl-compatible-regular-expressions"></a>
<h3 >Perl-Compatible Regular Expressions</h3>
<p>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.</p>
<a name="qt-gui-changes"></a>
<h2 id="qt-gui-changes">Qt GUI Changes</h2>
<a name="new-classes-for-windowing-and-rendering"></a>
<h3 >New Classes for Windowing and Rendering</h3>
<p>A new set of enabler classes have been added, most importantly QWindow, QScreen, QSurfaceFormat, and QOpenGLContext. These are now used as backends for the Qt Widgets module and by Qt Quick 2.</p>
<a name="opengl-classes"></a>
<h3 >OpenGL Classes</h3>
<p>Most of the useful Qt OpenGL classes have been polished and moved into Qt GUI. A few important ones are, QOpenGLFramebufferObject, QOpenGLShaderProgram, QOpenGLFunctions, and so on. For the complete list, refer to Qt GUI C++ Classes.</p>
<p>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.</p>
<a name="qopenglpaintdevice"></a>
<h3 >QOpenGLPaintDevice</h3>
<p>Instead of having QWindow and QOpenGLFramebufferObject be subclasses of QPaintDevice, you can now use <a href="whatsnew50.html#qopenglpaintdevice">QOpenGLPaintDevice</a>. This new alternative can be created on the stack, makes it easier and flexible to render into the currently bound context using QPainter.</p>
<a name="qt-network-changes"></a>
<h2 id="qt-network-changes">Qt Network Changes</h2>
<a name="qdnslookup"></a>
<h3 >QDnsLookup</h3>
<p>It is now possible to lookup DNS records using the new <a href="whatsnew50.html#qdnslookup">QDnsLookup</a> API. This does not replace QHostInfo, which is still the API to be used for resolving a host name to an IP address. <a href="whatsnew50.html#qdnslookup">QDnsLookup</a> is mainly used for other types of DNS record, such as SRV, TXT and MX.</p>
<p><b>Note: </b>This new class replaces the Q3Dns API, which is removed in Qt 5.</p><a name="better-support-for-ipv6-and-dual-mode-networks"></a>
<h3 >Better Support for IPv6 and Dual-mode Networks</h3>
<p>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.</p>
<p>Outgoing http connections using QNetworkAccessManager will now attempt both IPv4 and IPv6 connections in parallel, and use the one that succeeds first.</p>
<a name="binding-tcp-sockets"></a>
<h3 >Binding TCP Sockets</h3>
<p>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.</p>
<a name="ssl-certificates"></a>
<h3 >SSL Certificates</h3>
<p>SSL certificate extensions can now be accessed to enable further development of SSL support in Qt.</p>
<p>Developers can also verify an SSL certificate chain programatically now.</p>
<a name="workarounds-for-buggy-ssl-servers"></a>
<h3 >Workarounds for Buggy SSL Servers</h3>
<p>The QSsl::SslOption enum now allows a QSslSocket-based code to access legacy systems by enabling bug workarounds.</p>
<p><b>Note: </b>This change is also back-ported to Qt 4.8&#x2e;</p><a name="support-for-opaque-private-keys"></a>
<h3 >Support for Opaque Private Keys</h3>
<p>This allows applications to read private keys from devices such as PKCS#11 dongles, as illustrated by the <a href="https://github.com/iksaif/qsslkey-p11">qsslkey example</a></p>
<a name="qt-qml-changes"></a>
<h2 id="qt-qml-changes">Qt QML Changes</h2>
<p>This is a new module in Qt 5 that provides the QML engine and the backend infrastructure.</p>
<a name="qml-engine"></a>
<h3 >QML Engine</h3>
<ul>
<li>V8 JavaScript engine</li>
<li>Various parser and compiler optimizations have been implemented along with the new bindings optimizer.</li>
<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 Qt.createComponent().</li>
<li>New QQmlEngine::trimComponentCache() function safely discards unused data in the engine’s component cache to free memory.</li>
</ul>
<a name="type-system"></a>
<h3 >Type System</h3>
<ul>
<li>New var property type can hold JavaScript references.</li>
<li>QML properties of type var and variant can now hold pixmaps.</li>
<li>Value type improvements:<ul>
<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>
<li>Improved support for QVector4D, now constructible in QML using Qt.vector4d().</li>
</ul>
</li>
<li>Support for certain sequence types (QList&lt;int&gt;, QList&lt;qreal&gt;, QList&lt;bool&gt;, QList&lt;QUrl&gt;, QList&lt;QString&gt; and QStringList) has been improved. QObjects can define Q_PROPERTYs of these types which can be accessed from JavaScript.</li>
</ul>
<a name="other"></a>
<h3 >Other</h3>
<ul>
<li>JavaScript (.js) files can now import QML modules and other JavaScript files using the “import” statement.</li>
<li>QQmlExpression can now be constructed directly (and more efficiently) from a QQmlScriptString.</li>
<li>The component returned by Qt.createComponent() is no longer the owned by the engine. Be sure to hold a reference,or provide a parent.</li>
</ul>
<a name="qt-quick-changes"></a>
<h2 id="qt-quick-changes">Qt Quick Changes</h2>
<p>This is a new module in Qt 5 which provides the visual canvas and scenegraph backend as well as the <code>QtQuick</code> QML module for QML-based application development.</p>
<p>The module replaces the QDeclarative* equivalents in <i>QtQuick 1</i> with the following:</p>
<ul>
<li>QQuickView</li>
<li>QQuickWindow</li>
<li>QQuickItem</li>
<li>QQuickPaintedItem</li>
</ul>
<p>See Qt Quick C++ Classes for the complete list.</p>
<p>The QtQuick 2.0 QML module is a major update, and the following sections outline the features that come with it:</p>
<a name="new-graphics-architecture"></a>
<h3 >New Graphics Architecture</h3>
<ul>
<li>Qt Quick 2.0 uses a dedicated OpenGL (ES) 2.0 based <a href="topics-graphics.html#qt-quick-scene-graph">Qt Quick Scene Graph</a> scene graph for all its rendering.</li>
</ul>
<a name="visual-and-graphic-types"></a>
<h3 >Visual and Graphic Types</h3>
<ul>
<li>New Canvas type for drawing, provides a HTML5 canvas-like API along with the following additional features:<ul>
<li>Two render targets: Canvas.Image and Canvas.FramebufferObject.</li>
<li>Background thread rendering.</li>
<li>Tiled canvas rendering.</li>
<li>Support for most of the HTML5 context2d APIs.</li>
</ul>
</li>
<li>Image type now has:<ul>
<li>New horizontal and vertical alignment properties, horizontalAlignment and verticalAlignment.</li>
<li>Image.Pad enum value for <code>fillMode</code> property does not transform the image unlike the other <code>fillMode</code> enum values.</li>
<li>sourceSize.width and sourceSize.height now fits the image to size maintaining the aspect ratio.</li>
</ul>
</li>
</ul>
<a name="animations"></a>
<h3 >Animations</h3>
<ul>
<li>New SpriteSequence type renders animated sprites and can transition between animations.</li>
<li>New Sprite type that represents each animation in a SpriteSequence.</li>
<li>New AnimatedSprite type for drawing single sprite animations.</li>
</ul>
<a name="text"></a>
<h3 >Text</h3>
<ul>
<li><a href="whatsnew50.html#text">Text</a>:<ul>
<li>AutoText format now switches to <code>StyledText</code> instead of <code>RichText</code>.</li>
<li>lineLaidOut signal is emitted for every line during the layout process to give the option of positioning and/or resizing text as they are laid out.</li>
<li>doLayout() method can now trigger the text layout from JavaScript.</li>
<li>ElideRight to support text that spans multiple lines.</li>
<li>fontSizeMode property now supports wrapping the text to the item size.</li>
<li>minimumPixelSize and minimumPointSize properties can be used to specify a lower bound when auto-fitting.</li>
</ul>
</li>
<li>TextEdit.textFormat property now defaults to <code>PlainText</code> instead of <code>AutoText</code>.</li>
<li>TextInput now has <code>wrapMode</code> and verticalAlignment properties.</li>
<li><code>TextInput.positionAt()</code> now takes <code>y</code> value.</li>
</ul>
<a name="user-input"></a>
<h3 >User Input</h3>
<ul>
<li>New MultiPointTouchArea type can process multi-point touches and provide information about the touch points including position, pressure and velocity.</li>
<li>MouseArea type now:<ul>
<li>Propagates wheel events.</li>
<li>Propagates <code>clicked</code>, <code>doubleClicked</code> and <code>pressAndHold</code> events differently to <code>pressed</code>. These events are propagated to the handler of the topmost MouseArea in the stack-order.</li>
<li>Can ignore the propagated events using the <code>propagateComposedEvents</code>. Such ignored events are propagated to the next MouseArea handler in the stack-order.</li>
</ul>
</li>
</ul>
<a name="specialized-containers"></a>
<h3 >Specialized Containers</h3>
<ul>
<li>Flickable type now has:<ul>
<li>a new <code>rebound</code> property that enables you to specify the transition type for the bounce back animation.</li>
<li>New <code>topMargin</code>, <code>bottomMargin</code>, <code>leftMargin</code>, and <code>rightMargin</code> properties allow extra margin space to be specified. This is useful to implement the pull-to-refresh functionality for a list.</li>
<li>New <code>xOrigin</code> and <code>yOrigin</code> properties provide the top left position of the content item.</li>
<li>New <code>dragging</code>, <code>draggingHorizontally</code>, and <code>draggingVertically</code> properties that provide information when the flickable area is dragged.</li>
</ul>
</li>
</ul>
<a name="positioners"></a>
<h3 >Positioners</h3>
<p>The following features are related to Row, Column, Grid, and Flow types:</p>
<ul>
<li>The “add” and “move” transitions can now access the ViewTransition attached property, and also animate arbitrary item properties (instead of being restricted to animating an item’s position).</li>
<li>New <code>Positioner.index</code>, <code>Positioner.isFirstItem</code> and <code>Positioner.isLastItem</code> attached properties for items within a positioner.</li>
<li>The Grid type has new <code>rowSpacing</code> and <code>columnSpacing</code> properties.</li>
<li>All spacing properties on positioners now use real numbers instead of integers.</li>
</ul>
<a name="models-and-views"></a>
<h3 >Models and Views</h3>
<ul>
<li>ListView and GridView:<ul>
<li>Transitions can be specified to animate the adding, removing and moving of items in a view. For details, see ViewTransition, ListView.add, ListView.addDisplaced, GridView.add, and GridView.addDisplaced.</li>
<li>New <code>verticalLayoutDirection</code> property enables items to be laid out from bottom-to-top using the <code>BottomToTop</code> enum value.</li>
<li>The <code>cacheBuffer</code> property now has a non-zero default and delegates in the <code>cacheBuffer</code> are created asynchronously.</li>
<li>New <code>headerItem</code> and <code>footerItem</code> properties provide access to the instantiated header and footer items.</li>
<li><code>RightToLeft</code> layout now also reverses the <code>preferredHighlightBegin</code> and <code>preferredHighlightEnd</code>.</li>
</ul>
</li>
<li>ListView's new <code>section.labelPositioning</code> 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>
<li>PathView has two new properties, <code>curretnItem</code> and <code>maximumFlickVelocity</code>.</li>
</ul>
<a name="particles-system-support"></a>
<h3 >Particles System Support</h3>
<p>The new QtQuick.Particles 2.0 module provides support for the composition of a variety of 2D particle systems. See <code>Using the Qt Quick Particle System</code> for more details.</p>
<a name="utility-types"></a>
<h3 >Utility Types</h3>
<ul>
<li>New PathArc, PathCurve and PathSvg types:<ul>
<li><code>PathArc</code> and <code>PathCurve</code> support the construction of arcs and catmull-rom curves, respectively. PathSvg supports the construction of a path from an SVG string.</li>
</ul>
</li>
<li>Loader:<ul>
<li>New <code>asynchronous</code> property allows components to be instantiated with a lower chance of blocking. With the <code>asynchronous</code> property set to <code>true</code>, the component is compiled in a background thread.</li>
<li>New <code>active</code> property delays instantiation of a Loader object’s item.</li>
<li>New <code>setSource(JSObject)</code> method to specify initial property values for the loaded item, similar to Component.createObject().</li>
<li><code>sourceChanged</code> signal is now only emitted when the source changes and the <code>sourceComponentChanged</code> signal is now emitted when the <code>sourceComponent</code> is changed. Ealier, these signals were emitted by the Loader only when one of the two properties had changed.</li>
<li>Loader type can now be used as a value source, and it can restore any previously set binding if its &quot;when&quot; clause becomes <code>false</code>.</li>
</ul>
</li>
</ul>
<a name="qt-multimedia-changes"></a>
<h2 id="qt-multimedia-changes">Qt Multimedia Changes</h2>
<p>Qt Multimedia is an essential module replacing the QtMultimedia library and Qt MultimediaKit mobility API in Qt 4.8&#x2e; It features full support for Audio and Video playback, and recording. Support for web cameras is integrated.</p>
<p>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.</p>
<p>It uses DirectShow and WMF on Windows, AVFoundation on Mac and gstreamer on Linux.</p>
<a name="new-classes-and-functions"></a>
<h2 id="new-classes-and-functions">New Classes and Functions</h2>
<p>The section provides a comprehensive list of all new classes and functions introduced in Qt 5.</p>
<a name="additions-to-other-qt-5-releases"></a>
<h2 id="additions-to-other-qt-5-releases">Additions to Other Qt 5 Releases</h2>
<ul>
<li><a href="whatsnew56.html">What's New in Qt 5.6</a></li>
<li><a href="whatsnew55.html">What's New in Qt 5.5</a></li>
<li><a href="whatsnew54.html">What's New in Qt 5.4</a></li>
<li><a href="whatsnew53.html">What's New in Qt 5.3</a></li>
<li><a href="whatsnew52.html">What's New in Qt 5.2</a></li>
<li><a href="whatsnew51.html">What's New in Qt 5.1</a></li>
</ul>
</div>
<!-- @@@whatsnew50.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>