From 0cefbff3b471e0045788cb3a5af17c57852e46e7 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Fri, 3 Aug 2012 16:13:08 +1000 Subject: Update porting guide for positioner handling of item opacity Also moved some items from the release notes that are more appropriate for the porting guide. Change-Id: I0abe4dd5e74ac5505e1210bb330cc55af9e657da Reviewed-by: Alan Alpert --- src/quick/doc/src/appdevguide/porting.qdoc | 43 +++++++++++++++++++++++++----- src/quick/doc/src/whatsnew.qdoc | 22 +++++---------- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/src/quick/doc/src/appdevguide/porting.qdoc b/src/quick/doc/src/appdevguide/porting.qdoc index f4937fa658..3d1b209193 100644 --- a/src/quick/doc/src/appdevguide/porting.qdoc +++ b/src/quick/doc/src/appdevguide/porting.qdoc @@ -73,20 +73,49 @@ for examples. Graphics View framework backend used in QtQuick 1. \endlist -\section 2 Behavioral Changes +\section2 Behavioral Changes -There are many behavioral changes caused in the transition and you should thoroughly test your applications after +QtQuick 2.0 includes a number of behavioral changes and you should thoroughly test your applications after porting. These changes will not necessarily lead to run-time errors, but may break certain assumptions in your code. -Here is a list of some more prominent changes: +Below are the prominent changes to be aware of when porting your applications. + +Item opacity and visibility: \list \li The input handling details of \l{Item::}{opacity} and \l{Item::}{visible} have changed. An opacity of zero no -longer affects input handling, where previously it stopped mouse input. A visibility of false no longer affects -keyboard input, but still stops mouse input. The new \l{Item::}{enabled} property stops mouse and keyboard input, but does not affect how or whether -the item is rendered. A workaround for applying the old behavior in most cases is to bind enabled to (visible && -opacity > 0.0). + longer affects input handling, where previously it stopped mouse input. A visibility of false no longer affects + keyboard input, but still stops mouse input. The new \l{Item::}{enabled} property stops mouse and keyboard input, but does not affect how or whether + the item is rendered. A workaround for applying the old behavior in most cases is to bind enabled to + \tt {(visible && opacity > 0.0)}. +\li Previously, if an item was in a positioner (i.e. a \l Row, \l Column, \l Grid and \l Flow) + and the item's \c opacity changed to 0, or its \c visible value became \c false, the positioner + would remove the item from its layout and collapse the space for that item. In QtQuick 2.0, this + now only happens when an item's \c visible is \c false; the item opacity no longer affects whether + the item is laid out. (This is consistent with the existing behavior of ListView and GridView). +\endlist + +Text: + +\list +\li The TextEdit::textFormat property now defaults to \c PlainText instead of \c AutoText. +\li When Text::textFormat is set to \c Text.AutoText format, the text object will automatically + switch to \c Text.StyledText instead of \c Text.RichText. \endlist +Other: + +\list +\li Modifying the Image::sourceSize now fits the image to the size, maintaining aspect + ratio. +\li For ListView and GridView, the \c cacheBuffer property now has a non-zero default and + delegates in the cache buffer are created asynchronously. Also, using a \c RightToLeft layout + now also reverses the \c preferredHighlightBegin and \c preferredHighlightEnd. +\li For \l Loader, the \c sourceChanged and \c sourceComponentChanged signals are now only emitted + when their respective properties change value. (Previously \l Loader emitted both of these signals + when either of the relevant properties had changed.) +\endlist + + \section2 Changes to experimental Qt.labs modules \list diff --git a/src/quick/doc/src/whatsnew.qdoc b/src/quick/doc/src/whatsnew.qdoc index e355eb33f5..d1a8ed45e0 100644 --- a/src/quick/doc/src/whatsnew.qdoc +++ b/src/quick/doc/src/whatsnew.qdoc @@ -81,7 +81,8 @@ Custom rendering can be performed on the scenegraph using the following new clas The QtQuick 2.0 QML module is a major update. -Below are the additions and changes in QtQuick 2.0. +Below are the additions in QtQuick 2.0. For a list of behavioral changes which may affect +applications ported from QtQuick 1.x, see the \l {Porting QML Applications to Qt 5}. \section2 Visual types, Graphical Effects and Sprites @@ -109,8 +110,6 @@ Below are the additions and changes in QtQuick 2.0. the image alignment. \li New \c Image.Pad enumeration value for \l{Image::}{fillMode} that does not transform the image, unlike other \l{Image::}{fillMode} enumeration values. - \li Modifying the \l{Image::}{sourceSize} now fits the image to the size, maintaining aspect - ratio. \endlist \li New ShaderEffect and ShaderEffectSource types enable GLSL shader programs to be integrated directly into QML code and applied to QML items and images. (This obsoletes the experimental @@ -182,8 +181,6 @@ relative to its start. \endlist \li \l Text only: \list - \li When \l{Text::}{textFormat} is set to \c Text.AutoText format, the text object will - automatically switch to \c Text.StyledText instead of \c Text.RichText. \li \c Text.RightElide is now supported where text spans multiple lines. \li New \l{Text::}{linkColor} property controls the color of linked text. \li New \l{Text::}{onLineLaidOut} handler is called for every line during the layout process to @@ -195,7 +192,6 @@ relative to its start. \endlist \li TextEdit only: \list - \li \l{TextEdit::}{textFormat} property now defaults to \c PlainText instead of \c AutoText. \li New \l{TextEdit::}{baseUrl} property specified the base URL used to resolve relative URLs within the text. \endlist @@ -220,14 +216,11 @@ the window loses focus. \li MouseArea: \list \li Wheel events are now supported; events are provided through the new WheelEvent type. - \li The \l{MouseArea::}{onClicked}, \l{MouseArea::}{onDoubleClicked} and - \l{MouseArea::}{onPressAndHold} signals are now propagated differently to - \l{MouseArea::}{onPressed}. These will now be propagated to the highest-stacking-order enabled - MouseArea that has implemented the relevant handlers. You can still ignore these events in the - handler to let them pass through; this behavior is triggered with the new property - \l{MouseArea::}{propagateComposedEvents}. \li New \l{MouseArea::}{propagateComposedEvents} property sets whether composed events are - propagated to other mouse areas. + propagated to other mouse areas. If this property is true and the l{MouseArea::onClicked}{clicked}, + \l{MouseArea::onDoubleClicked}{doubleClicked} or \l{MouseArea::onPressAndHold}{pressAndHold} + handlers reject a mouse event, the event will be propagated to overlapping MouseArea items + in the same area that are lower in the stacking order. \li New \l{MouseArea::}{cursorShape} property controls the cursor shape. \endlist \endlist @@ -345,9 +338,6 @@ the window loses focus. \l{Loader::}{item}. \li New \l{Loader::}{setSource()} method loads an object with specific initial property values, similar to \l Component::createObject(). - \li The \c sourceChanged signal is now only emitted when the \l{Loader::}{source} changes and - the \c sourceComponentChanged signal is now only emitted when the \l{Loader::}{sourceComponent} - changes. (Previously \l Loader emitted both signals when only one of these properties had changed.) \endlist \li \l Binding: \list -- cgit v1.2.3