source: trunk/src/declarative/QmlChanges.txt@ 966

Last change on this file since 966 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 13.7 KB
RevLine 
[844]1=============================================================================
2The changes below are pre Qt 4.7.0 RC1
3
4TextInput
5 - copy(), cut() and paste() functions added
6Font.letterSpacing
7 - was percentage based. Now specified in pixels.
8Item
9 - wantsFocus renamed to activeFocus
10 - forceFocus() renamed to forceActiveFocus()
11 - focus now returns the scoped focus (i.e. focus read/write now manipulate
12 the same value)
13TextInput and TextEdit:
14 - focusOnPress renamed to activeFocusOnPress
15
16=============================================================================
17The changes below are pre Qt 4.7.0 beta 2
18
19QDeclarativeView
20 - initialSize() function added
21TextInput and TextEdit:
22 - openSoftwareInputPanel() and closeSoftwareInputPanel() functions added
23Flickable:
24 - overShoot is replaced by boundsBehavior enumeration
25 - flickingHorizontally and flickingVertically properties added
26 - movingHorizontally and movingVertically properties added
27 - flickDirection is renamed flickableDirection
28Component:
29 - isReady, isLoading, isError and isNull properties removed, use
30 status property instead
31 - errorsString() renamed to errorString()
32ListView:
33 - ListView.prevSection property changed to ListView.previousSection
34TextInput:
35 - xToPosition -> positionAt (to match TextEdit.positionAt)
36Image:
37 - pixmap property removed, use QDeclarativeImageProvider to serve pixmaps
38 instead
39
40QList<QObject*> models no longer provide properties in model object. The
41properties are now updated when the object changes. An object's property
42"foo" may now be accessed as "foo", modelData.foo" or model.modelData.foo"
43component.createObject has gained a mandatory "parent" argument
44TextEdit and TextInput now have a "selectByMouse" property that defaults to false.
45
46C++ API
47-------
48QDeclarativeExpression::value() has been renamed to
49QDeclarativeExpression::evaluate()
50
51The QDeclarativeExpression constructor has changed from
52 QDeclarativeExpression(context, expression, scope)
53to
54 QDeclarativeExpression(context, scope, expression, parent = 0)
55
56QDeclarativeImageProvider::request() has been renamed to
57QDeclarativeImageProvider::image() and the class can now provide
58both qimages and qpixmaps, and qimages can be served synchronously
59
60QML Viewer
61------------
62The standalone qml executable has been renamed back to Qml Viewer. Runtime warnings
63can be now accessed via the menu (Debugging->Show Warnings).
64
65=============================================================================
66The changes below are pre Qt 4.7.0 beta 1
67
68TextEdit: wrap property is replaced by wrapMode enumeration.
69Text: wrap property is replaced by wrapMode enumeration.
70Removed Q-prefix from validators (IntValidator, DoubleValidator, and RegExpValidator)
71PathView: offset property now uses range 0-1.0 rather than 0-100
72ListView, GridView::positionViewAtIndex() gained a 'mode' parameter
73Removed Qt.playSound (replaced by SoundEffect element)
74Removed Qt.closestAngle (use RotationAnimation instead)
75Removed NumberFormatter
76Removed DateTimeFormatter (use Qt.formatDateTime() instead)
77Using WebView now requires "import QtWebKit 1.0"
78Using Particles now requires "import Qt.labs.particles 1.0"
79AnchorAnimation must now be used to animate anchor changes (and not NumberAnimation)
80Removed ParentAction (use ParentAnimation instead)
81ScriptAction: renamed stateChangeScriptName -> scriptName
82Animation: replace repeat with loops (loops: Animation.Infinite gives the old repeat behavior)
83AnchorChanges: use natural form to specify anchors (anchors.left instead of left)
84AnchorChanges: removed reset property. (reset: "left" should now be anchors.left: undefined)
85PathView: snapPosition replaced by preferredHighlightBegin, preferredHighlightEnd
86createQmlObject: Moved to the Qt object, now use Qt.createQmlObject()
87createComponent: Moved to the Qt object, now use Qt.createComponent()
88
89C++ API
90-------
91QDeclarativeContext::addDefaultObject() has been replaced with
92QDeclarativeContext::setContextObject()
93
94Behavior and Animation syntax
95-----------------------------
96Previously animations and behaviors could be "assigned" to properties like this:
97 Item { x: Behavior {}; y: NumberAnimation {} }
98To make it more obvious that these are not regular value assignments a new "on"
99syntax has been introduced:
100 Item { Behavior on x {}; NumberAnimation on y {} }
101Only the syntax has changed, the behavior is identical.
102
103EaseFollow renamed to SmoothedFollow
104---------------------------------------
105This element shares the internal implementation with SmoothedAnimation,
106both providing the same easing function, but with SmoothedFollow it's
107easier to set a start value to animate intially and then start to follow,
108while SmoothedAnimation is still convenient for using inside Behaviors
109and Transitions.
110
111
112Add SmoothedAnimation element
113---------------------------------------
114SmoothedAnimation inherits from NumberAnimaton and as a
115consequence SmoothedAnimation can be used inside Behaviors,
116as PropertySourceValues or in state transitions, like any other animation.
117
118The old EaseFollow properties changed to comply with the other declarative
119animations ('source' changed to 'to'), so now 'to' changes are not
120automatically 'followed' anymore.
121
122If you want to follow an hypothetical rect1, you should do now:
123
124 Rectangle {
125 color: "green"
126 width: 60; height: 60;
127 x: rect1.x - 5; y: rect1.y - 5;
128 Behavior on x { SmoothedAnimation { velocity: 200 } }
129 Behavior on y { SmoothedAnimation { velocity: 200 } }
130 }
131
132instead of the old automatic source changed tracking:
133
134 Rectangle {
135 color: "green"
136 width: 60; height: 60;
137 EaseFollow on x { source: rect1.x - 5; velocity: 200 }
138 EaseFollow on y { source: rect1.y - 5; velocity: 200 }
139 }
140
141This is a syntax and behavior change.
142
143
144Script element removed
145----------------------
146Inline Script{} blocks have been deprecated, and will soon be removed entirely.
147If you used Script to write inline javascript code, it can simply be removed.
148For example
149
150Item {
151 Script {
152 function doSomething() {}
153 }
154}
155
156becomes
157
158Item {
159 function doSomething() {}
160}
161
162If you used Script to include external JavaScript files, you can replace the
163Script element with an “import” line. For example
164
165MouseArea {
166 Script {
167 source: “foo.js”
168 }
169 onClicked: foo()
170}
171
172becomes
173
174import “foo.js” as Foo
175MouseArea {
176 onClicked: Foo.foo()
177}
178
179The “as” qualifier is mandatory for script imports (as opposed to type
180imports where it is optional).
181
182
183=============================================================================
184The changes below are pre Qt 4.7.0 alpha
185
186Flickable: renamed viewportWidth -> contentWidth
187Flickable: renamed viewportHeight -> contentHeight
188Flickable: renamed viewportX -> contentX
189Flickable: renamed viewportY -> contentY
190Removed Flickable.reportedVelocitySmoothing
191Renamed MouseRegion -> MouseArea
192Connection: syntax and rename:
193 Connection { sender: a; signal: foo(); script: xxx }
194 Connection { sender: a; signal: bar(); script: yyy }
195 becomes:
196 Connections { target: a; onFoo: xxx; onBar: yyy }
197
198ListView::sectionExpression has been replaced by section.property, section.criteria
199
200ListModel
201---------
202- types are strictly checked (previously, everything was a string)
203 - foo: "bar" continues to work as before
204 - foo: bar is now invalid, use foo: "bar"
205 - foo: true is now a bool (not string "true")
206 - foo: false is now a bool (not string "false" == true!)
207
208PropertyAnimation
209------------------
210matchProperties and matchTargets have been renamed back to properties and targets.
211The semantics are explained in the PropertyAnimation::properties documentation
212and the animation overview documentation.
213
214Easing curves and their parameters are now specified via dot properties:
215* easing.type : enum
216* easing.amplitude : real
217* easing.overshoot : real
218* easing.period : real
219For example:
220PropertyAnimation { properties: "y"; easing.type: "InOutElastic"; easing.amplitude: 2.0; easing.period: 1.5 }
221
222C++ API
223-------
224QML_DEFINE_... definition macros, previously global macros, are replaced by
225qmlRegisterType registration functions, which must be called explicitly.
226C++ API users should also consider using the QmlExtensionPlugin (previously
227named QmlModulePlugin) as a cleaner mechanism for publishing libraries of QML
228types, or the upcoming application plugin features of the qmlviewer /
229qmlruntime / qml.
230
231QmlView
232-------
233The API of QmlView has been narrowed and its role as a convenience class
234reinforced.
235- remove addItem()
236- remove clearItems() - use 'delete root()'
237- remove reset()
238- resizeContent -> enum ResizeMode { SizeViewToRootObject, SizeRootObjectToView }
239- remove setQml(), qml()
240- rename setUrl(), ur() to setSource(), source()
241- root() -> rootObject(), returns QGraphicsObject rather than QmlGraphicsItem
242- remove quit() signal -> use quit() signal of engine()
243- initialSize() signal removed
244- Added status() to determine status of the internal QmlComponent
245- removed execute() - setSource() will also execute the QML.
246
247
248=============================================================================
249The changes below are pre-4.6.0 release.
250
251QML API Review
252==============
253
254The QML API is being reviewed. This file documents the changes.
255Note that the changes are incremental, so a rename A->B for example may be followed
256by another subsequent rename B->C, if later reviews override earlier reviews.
257
258API Changes
259===========
260
261Renamed Elements:
262LineEdit -> TextInput
263VerticalLayout -> Column
264HorizontalLayout -> Row
265VerticalPositioner -> Column
266HorizontalPositioner -> Row
267GridLayout -> Grid
268GridPositioner -> Grid
269Rect -> Rectangle
270FocusRealm -> FocusScope
271FontFamily -> FontLoader
272Palette -> SystemPalette
273Bind -> Binding
274SetProperties -> PropertyChanges
275RunScript -> StateChangeScript
276SetAnchors -> AnchorChanges
277SetPropertyAction -> PropertyAction
278RunScriptAction -> ScriptAction
279ParentChangeAction -> ParentAction
280VisualModel -> VisualDataModel
281Follow -> SpringFollow
282
283Renamed properties:
284Item: contents -> childrenRect
285MouseRegion: xmin -> minimumX
286MouseRegion: xmax -> maximumX
287MouseRegion: ymin -> minimumY
288MouseRegion: ymin -> maximumY
289Text elements: hAlign -> horizontalAlignment
290Text elements: vAlign -> verticalAlignment
291Text elements: highlightColor -> selectionColor
292Text elements: highlightedTextColor -> selectedTextColor
293Text elements: preserveSelection -> persistentSelection
294State: operations -> changes
295Transition: operations -> animations
296Transition: fromState -> from
297Transition: toState -> to
298Follow: followValue -> value
299Flickable: xPosition -> viewportX
300Flickable: yPosition -> viewportY
301Flickable: xVelocity -> horizontalVelocity
302Flickable: yVelocity -> verticalVelocity
303Flickable: velocityDecay -> reportedVelocitySmoothing
304Flickable: locked -> interactive (note reversal of meaning)
305Flickable: pageXPosition -> visibleArea.xPosition
306Flickable: pageYPosition -> visibleArea.yPosition
307Flickable: pageWidth -> visibleArea.widthRatio
308Flickable: pageHeight -> visibleArea.heightRatio
309WebView: idealWidth -> preferredWidth
310WebView: idealHeight -> preferredHeight
311WebView: status -> statusText
312WebView: mouseX -> clickX (parameter to onDoubleClick)
313WebView: mouseY -> clickY (parameter to onDoubleClick)
314WebView: cacheSize -> pixelCacheSize
315Repeater: component -> delegate
316Repeater: dataSource -> model
317ListView: current -> currentItem
318GridView: current -> currentItem
319ListView: wrap -> keyNavigationWraps
320ListView: autoHighlight -> highlightFollowsCurrentItem
321GridView: wrap -> keyNavigationWraps
322GridView: autoHighlight -> highlightFollowsCurrentItem
323Animation: targets -> matchTargets
324Animation: properties -> matchProperties
325
326Additions:
327MouseRegion: add "acceptedButtons" property
328MouseRegion: add "hoverEnabled" property
329MouseRegion: add "pressedButtons" property
330Timer: add start() and stop() slots
331WebView: add newWindowComponent and newWindowParent properties
332Loader: add status() and progress() properties
333Loader: add sourceComponent property
334Loader: add resizeMode property
335ListView: preferredHighlightBegin, preferredHighlightEnd
336ListView: strictlyEnforceHighlightRange
337Particles: Added emissionRate, emissionVariance and burst()
338
339Deletions:
340Column/VerticalPositioner: lost "margins" property
341Row/HorizontalPositioner: lost "margins" property
342Grid/Positioner/Layout: lost "margins" property
343WebView: lost "interactive" property (always true now)
344Flickable: removed "dragMode" property
345ComponentInstance: removed. Replaced by Loader.sourceComponent
346ListView: removed currentItemMode. Replaced by highligh range.
347ListView: removed snapPos.
348Particles: removed streamIn. Replaced by emissionRate
349
350Other Changes:
351ids must be lowercase: Text { id: foo }, not Text { id: Foo }
352Drag: axis becomes an enum with values "XAxis", "YAxis", "XandYAxis"
353Image: scaleGrid property removed. New item called BorderImage instead.
354KeyActions: changed to a Keys attached property on any item.
355KeyProxy: changed to a Keys.forwardTo property on any item.
356Script: now an intrinsic type in the language
357 - cannot be assigned to properties
358 - good: Item { Script { ... } }
359 - bad: Item { resources: Script { ... } }
360Script: delay-loaded of the QML file until their source has been loaded (this only effects QML files loaded across the network.)
361Scope: declared properties shadow a property of the same name (was previously the reverse)
362ScriptAction and StateChangeScript: the script property now takes script rather than a string containing script (script: doSomething() rather than script: "doSomething()")
363QmlGraphicsItem::transformOrigin default changed from TopLeft to Center
364Animations used as PropertySourceValues are set to 'running: true' as default
Note: See TracBrowser for help on using the repository browser.