diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-08-24 01:58:38 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-08-24 01:58:38 (GMT) |
commit | 8c78c571fc2c5ab706d88d652cbd20b2fd8c1a7c (patch) | |
tree | 622631b67c3edbc59a2dd46bc6dfc413262180d5 | |
parent | d3e617b7cdad271623986ab4bfce1784477f7594 (diff) | |
download | Qt-8c78c571fc2c5ab706d88d652cbd20b2fd8c1a7c.zip Qt-8c78c571fc2c5ab706d88d652cbd20b2fd8c1a7c.tar.gz Qt-8c78c571fc2c5ab706d88d652cbd20b2fd8c1a7c.tar.bz2 |
Rename positioners.
QFxBasePositioner still exists though.
41 files changed, 130 insertions, 126 deletions
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 24c3e69..b95cc7ab 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -7,7 +7,7 @@ Rectangle { SystemPalette { id: Palette; colorGroup: Qt.Active } Script { source: "calculator.js" } - VerticalPositioner { + Column { x: 2; spacing: 10; Rectangle { @@ -56,7 +56,7 @@ Rectangle { CalcButton { operation: "C"; id: C; width: 76 } CalcButton { operation: "AC"; id: AC; x: 78; width: 76 } - GridPositioner { + Grid { id: NumKeypad; y: 32; spacing: 2; columns: 3 CalcButton { operation: "7" } @@ -70,7 +70,7 @@ Rectangle { CalcButton { operation: "3" } } - HorizontalPositioner { + Row { y: 128; spacing: 2 CalcButton { operation: "0"; width: 50 } @@ -78,7 +78,7 @@ Rectangle { CalcButton { operation: "="; id: Equals; x: 77; width: 102 } } - VerticalPositioner { + Column { id: SimpleOperations x: 156; y: 0; spacing: 2 @@ -89,7 +89,7 @@ Rectangle { } } - GridPositioner { + Grid { id: AdvancedButtons x: 350; spacing: 2; columns: 2; opacity: 0 diff --git a/demos/declarative/contacts/Contact.qml b/demos/declarative/contacts/Contact.qml index d02157c..91510c7 100644 --- a/demos/declarative/contacts/Contact.qml +++ b/demos/declarative/contacts/Contact.qml @@ -80,7 +80,7 @@ Item { function remove() { removeContactQuery.exec(); } - VerticalPositioner { + Column { id: layout width: contents.width height:contents.height diff --git a/demos/declarative/flickr/content/LikeOMeter.qml b/demos/declarative/flickr/content/LikeOMeter.qml index 0ba79b1..754dbb1 100644 --- a/demos/declarative/flickr/content/LikeOMeter.qml +++ b/demos/declarative/flickr/content/LikeOMeter.qml @@ -5,7 +5,7 @@ Item { property int rating: 2 - HorizontalPositioner { + Row { Star { rating: 0 onClicked: { Container.rating = rating } diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index ec3a2a0..ef87a05 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -6,7 +6,8 @@ import "fieldtext" Item { id: WebBrowser - property string urlString : "http://qt.nokia.com/" + //property string urlString : "http://qt.nokia.com/" + property string urlString : "http://www.nymphmania.com/maptest/gshow_map.php?lat=61.4979&lon=23.7635" state: "Normal" diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 6a285ba..ffa5494 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -132,9 +132,9 @@ The following table lists the QML elements provided by the Qt Declarative module \o \list -\o \l VerticalPositioner -\o \l HorizontalPositioner -\o \l GridPositioner +\o \l Column +\o \l Row +\o \l Grid \endlist \o diff --git a/examples/declarative/border-image/example.qml b/examples/declarative/border-image/example.qml index 8f974e1..87d3f37 100644 --- a/examples/declarative/border-image/example.qml +++ b/examples/declarative/border-image/example.qml @@ -5,7 +5,7 @@ Rectangle { color: "white" width: 520; height: 280 - HorizontalPositioner { + Row { anchors.centerIn: parent spacing: 50 //! [0] diff --git a/examples/declarative/easing/easing.qml b/examples/declarative/easing/easing.qml index f15b3fb..60c2040 100644 --- a/examples/declarative/easing/easing.qml +++ b/examples/declarative/easing/easing.qml @@ -51,7 +51,7 @@ Rectangle { ListElement { type: "easeOutInBounce" } } - VerticalPositioner { + Column { id: Layout anchors.left: Window.left anchors.right: Window.right diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/fonts/fonts.qml index 2aa4851..f7ed494 100644 --- a/examples/declarative/fonts/fonts.qml +++ b/examples/declarative/fonts/fonts.qml @@ -16,7 +16,7 @@ Rectangle { FontLoader { id: WebFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" } FontLoader { id: WebFont2; source: "http://wrong.address.org" } - VerticalPositioner { + Column { anchors.fill: parent anchors.leftMargin: 10; anchors.rightMargin: 10 Text { diff --git a/examples/declarative/layouts/positioners.qml b/examples/declarative/layouts/positioners.qml index add46a4..fe28105 100644 --- a/examples/declarative/layouts/positioners.qml +++ b/examples/declarative/layouts/positioners.qml @@ -1,6 +1,6 @@ import Qt 4.6 Rectangle { width: 420; height: 420; id:page; color:"white" - VerticalPositioner { id: layout1; y:0; //width: 100; height:250; + Column { id: layout1; y:0; //width: 100; height:250; move: Transition{ NumberAnimation {properties: "y"; easing: "easeOutBounce" }} add: Transition{ NumberAnimation { properties: "y"; from: 500; duration:500; easing: "easeOutQuad"}} remove: Transition { NumberAnimation { properties:"y"; to: 500; duration:500; easing: "easeInQuad"}} @@ -14,7 +14,7 @@ Rectangle { width: 420; height: 420; id:page; color:"white" } Rectangle { color: "orange"; width: 100; height: 50; border.color: "black"; radius: 15 } } - HorizontalPositioner { id: layout2; y:300; + Row { id: layout2; y:300; move: Transition{ NumberAnimation {properties: "x"; easing: "easeOutBounce" }} add: Transition{ NumberAnimation { properties: "x"; from: 500; duration:500; easing: "easeOutQuad"} NumberAnimation { properties: "opacity"; from: 0; duration: 500;}} @@ -32,7 +32,7 @@ Rectangle { width: 420; height: 420; id:page; color:"white" Button { text: "Add"; icon: "add.png"; x: 145; y:140; onClicked: {blueH2.opacity=1; blueH1.opacity=1; blueV1.opacity=1; blueV2.opacity=1; blueG1.opacity=1; blueG2.opacity=1; blueG3.opacity=1;} } - GridPositioner { x:260; y:0; columns:3 + Grid { x:260; y:0; columns:3 remove: Transition { NumberAnimation{ properties: "opacity"; from: 1; to: 0; duration: 500} NumberAnimation{properties: "x,y"; easing: "easeOutBounce"} } move: Transition { NumberAnimation{ properties: "x,y"; easing: "easeOutBounce" }} diff --git a/examples/declarative/listview/highlight.qml b/examples/declarative/listview/highlight.qml index 3506ad7..2bf3a9f 100644 --- a/examples/declarative/listview/highlight.qml +++ b/examples/declarative/listview/highlight.qml @@ -14,7 +14,7 @@ Rectangle { Item { id: Wrapper width: 200; height: 50 - VerticalPositioner { + Column { Text { text: 'Name: ' + name } Text { text: 'Type: ' + type } Text { text: 'Age: ' + age } diff --git a/examples/declarative/listview/itemlist.qml b/examples/declarative/listview/itemlist.qml index bf1184f..c25ee59 100644 --- a/examples/declarative/listview/itemlist.qml +++ b/examples/declarative/listview/itemlist.qml @@ -40,7 +40,7 @@ Rectangle { height: 30 width: 240 - HorizontalPositioner { + Row { anchors.centerIn: parent spacing: 20 Repeater { diff --git a/examples/declarative/listview/listview.qml b/examples/declarative/listview/listview.qml index 1e2de65..0f197b4 100644 --- a/examples/declarative/listview/listview.qml +++ b/examples/declarative/listview/listview.qml @@ -14,7 +14,7 @@ Rectangle { Item { id: Wrapper width: 200; height: 50 - VerticalPositioner { + Column { Text { text: 'Name: ' + name } Text { text: 'Type: ' + type } Text { text: 'Age: ' + age } diff --git a/examples/declarative/listview/recipes.qml b/examples/declarative/listview/recipes.qml index b4ad4d5..eac8bb5 100644 --- a/examples/declarative/listview/recipes.qml +++ b/examples/declarative/listview/recipes.qml @@ -37,7 +37,7 @@ Rectangle { // Layout the page. Picture, title and ingredients at the top, method at the // bottom. Note that elements that should not be visible in the list // mode have their opacity set to wrapper.detailsOpacity. - HorizontalPositioner { + Row { id: topLayout x: 10; y: 10; height: recipePic.height; width: parent.width spacing: 10 @@ -45,7 +45,7 @@ Rectangle { id: recipePic source: picture; width: 48; height: 48 } - VerticalPositioner { + Column { height: recipePic.height; width: background.width-recipePic.width-20 spacing: 5 Text { id: name; text: title; font.bold: true; font.pointSize: 16 } diff --git a/examples/declarative/listview/sections.qml b/examples/declarative/listview/sections.qml index 1b51a43..ddb4931 100644 --- a/examples/declarative/listview/sections.qml +++ b/examples/declarative/listview/sections.qml @@ -36,7 +36,7 @@ Rectangle { x: 5 height: Layout.height + 4 anchors.top: Separator.bottom - VerticalPositioner { + Column { id: Layout y: 2 Text { text: 'Name: ' + name } diff --git a/examples/declarative/modules/installed-version.qml b/examples/declarative/modules/installed-version.qml index 0d3fa09..d90375dd 100644 --- a/examples/declarative/modules/installed-version.qml +++ b/examples/declarative/modules/installed-version.qml @@ -2,7 +2,7 @@ import Qt 4.6 import com.nokia.Foo 1.6 import com.nokia.Foo 1.7 as NewFoo -VerticalPositioner { +Column { Bar { } Baz { } NewFoo.Bar { } diff --git a/examples/declarative/modules/local-qualified.qml b/examples/declarative/modules/local-qualified.qml index f321738..d3532af 100644 --- a/examples/declarative/modules/local-qualified.qml +++ b/examples/declarative/modules/local-qualified.qml @@ -3,7 +3,7 @@ import Qt 4.6 import "local" as X import "local/SubLib" as Y -VerticalPositioner { +Column { X.Foo { } Y.Bar { } } diff --git a/examples/declarative/smooth/rect-painting.qml b/examples/declarative/smooth/rect-painting.qml index 0f3eb6e..4b6e223 100644 --- a/examples/declarative/smooth/rect-painting.qml +++ b/examples/declarative/smooth/rect-painting.qml @@ -12,7 +12,7 @@ Rectangle { color: "#eeeeee" } - GridPositioner { + Grid { anchors.centerIn: parent columns: 8; rows:4; spacing: 30 diff --git a/examples/declarative/snow/snow.qml b/examples/declarative/snow/snow.qml index 985f913..b6781c3 100644 --- a/examples/declarative/snow/snow.qml +++ b/examples/declarative/snow/snow.qml @@ -22,7 +22,7 @@ Rectangle { Item { anchors.centerIn: parent - HorizontalPositioner { + Row { id: MyLayout property real targetX: -(selectedX + imageWidth / 2) diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1_Drawing_and_animation.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1_Drawing_and_animation.qml index ecc5635..050f05f 100644 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1_Drawing_and_animation.qml +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1_Drawing_and_animation.qml @@ -5,7 +5,7 @@ Rectangle { width: layout.width height: layout.height color: "white" - VerticalPositioner { + Column { id: layout width: childrenRect.width GroupBox { diff --git a/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml b/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml index 885a3a1..a913dda 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml @@ -5,7 +5,7 @@ Rectangle { width: layout.width height: layout.height color: "white" - GridPositioner { + Grid { id: layout columns: 2 rows: 4 diff --git a/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml b/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml index 8c54cd6..3516cee 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml @@ -14,7 +14,7 @@ Item { onEmailChanged: { emailField.value = email } onPhoneChanged: { phoneField.value = phone } - VerticalPositioner { + Column { id: layout anchors.fill: parent spacing: 5 diff --git a/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml b/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml index 37fd8d3..83988ab 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml @@ -17,7 +17,7 @@ Item { onEmailChanged: { emailField.value = email } onPhoneChanged: { phoneField.value = phone } - VerticalPositioner { + Column { id: layout anchors.fill: parent spacing: 5 diff --git a/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml b/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml index 4cc16a4..a7764ed 100644 --- a/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml +++ b/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml @@ -11,7 +11,7 @@ Rectangle { } // relies on the current focus behavior whereby setting focus=true on a // component removes focus from any previous element - GridPositioner { + Grid { id: layout width: childrenRect.width height: childrenRect.height diff --git a/examples/declarative/tutorials/contacts/3_Collections/lib/Contact.qml b/examples/declarative/tutorials/contacts/3_Collections/lib/Contact.qml index 6f40e24..d00bf05 100644 --- a/examples/declarative/tutorials/contacts/3_Collections/lib/Contact.qml +++ b/examples/declarative/tutorials/contacts/3_Collections/lib/Contact.qml @@ -13,7 +13,7 @@ Item { onEmailChanged: { emailField.value = email } onPhoneChanged: { phoneField.value = phone } - VerticalPositioner { + Column { id: layout anchors.fill: parent spacing: 5 diff --git a/examples/declarative/tutorials/helloworld/t2/tutorial2.qml b/examples/declarative/tutorials/helloworld/t2/tutorial2.qml index 32e9369..458e302 100644 --- a/examples/declarative/tutorials/helloworld/t2/tutorial2.qml +++ b/examples/declarative/tutorials/helloworld/t2/tutorial2.qml @@ -13,7 +13,7 @@ Rectangle { y: 30 anchors.horizontalCenter: Page.horizontalCenter } - GridPositioner { + Grid { id: ColorPicker x: 0 anchors.bottom: Page.bottom diff --git a/examples/declarative/tutorials/helloworld/t3/tutorial3.qml b/examples/declarative/tutorials/helloworld/t3/tutorial3.qml index daf32d5..81e1f6a 100644 --- a/examples/declarative/tutorials/helloworld/t3/tutorial3.qml +++ b/examples/declarative/tutorials/helloworld/t3/tutorial3.qml @@ -40,7 +40,7 @@ Rectangle { ] } MouseRegion { id: MouseRegion; anchors.fill: HelloText } - GridPositioner { + Grid { id: ColorPicker x: 0 anchors.bottom: Page.bottom diff --git a/examples/declarative/velocity/velocity.qml b/examples/declarative/velocity/velocity.qml index 088532e..c2425da 100644 --- a/examples/declarative/velocity/velocity.qml +++ b/examples/declarative/velocity/velocity.qml @@ -98,7 +98,7 @@ Rectangle { id: Flick anchors.fill: parent viewportWidth: Lay.width - HorizontalPositioner { + Row { id: Lay Repeater { dataSource: List diff --git a/examples/declarative/webview/autosize.qml b/examples/declarative/webview/autosize.qml index 0099f37..13004a8 100644 --- a/examples/declarative/webview/autosize.qml +++ b/examples/declarative/webview/autosize.qml @@ -7,7 +7,7 @@ Rectangle { color: "white" width: 200 height: Layout.height - VerticalPositioner { + Column { id: Layout spacing: 2 WebView { diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index da290b7..f886466 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -11,9 +11,12 @@ API Changes Renamed Elements: LineEdit -> TextInput -VerticalLayout -> VerticalPositioner -HorizontalLayout -> HorizontalPositioner -GridLayout -> GridPositioner +VerticalLayout -> Column +HorizontalLayout -> Row +VerticalPositioner -> Column +HorizontalPositioner -> Row +GridLayout -> Grid +GridPositioner -> Grid Rect -> Rectangle FocusRealm -> FocusScope FontFamily -> FontLoader @@ -46,9 +49,9 @@ MouseRegion: add "pressedButtons" property Timer: add start() and stop() slots Deletions: -VerticalPositioner: lost "margins" property -HorizontalPositioner: lost "margins" property -GridPositioner: lost "margins" property +Column/VerticalPositioner: lost "margins" property +Row/HorizontalPositioner: lost "margins" property +Grid/Positioner/Layout: lost "margins" property Other Changes: Drag: axis becomes an enum with values "XAxis", "YAxis", "XandYAxis" diff --git a/src/declarative/fx/qfxpositioners.cpp b/src/declarative/fx/qfxpositioners.cpp index 7f731cf..bad4944 100644 --- a/src/declarative/fx/qfxpositioners.cpp +++ b/src/declarative/fx/qfxpositioners.cpp @@ -318,22 +318,22 @@ void QFxBasePositioner::applyRemove(const QList<QPair<QString, QVariant> >& chan applyTransition(changes,target, d->removeActions); } -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,VerticalPositioner,QFxVerticalPositioner) +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Column,QFxColumn) /*! - \qmlclass VerticalPositioner - \brief The VerticalPositioner item lines up its children vertically. + \qmlclass Column + \brief The Column item lines up its children vertically. \inherits Item - The VerticalPositioner item positions its child items so that they are vertically + The Column item positions its child items so that they are vertically aligned and not overlapping. Spacing between items can be added. - The below example positions differently shaped rectangles using a VerticalPositioner. + The below example positions differently shaped rectangles using a Column. \table \row \o \image verticalpositioner_example.png \o \qml -VerticalPositioner { +Column { spacing: 2 Rectangle { color: "red"; width: 50; height: 50 } Rectangle { color: "green"; width: 20; height: 50 } @@ -342,7 +342,7 @@ VerticalPositioner { \endqml \endtable - VerticalPositioner also provides for transitions to be set when items are added, moved, + Column also provides for transitions to be set when items are added, moved, or removed in the positioner. Adding and removing apply both to items which are deleted or have their position in the document changed so as to no longer be children of the positioner, as well as to items which have their opacity set to or from zero so as to appear or disappear. @@ -352,7 +352,7 @@ VerticalPositioner { \o \image verticalpositioner_transition.gif \o \qml -VerticalPositioner { +Column { spacing: 2 remove: ... add: ... @@ -365,7 +365,7 @@ VerticalPositioner { */ /*! - \qmlproperty Transition VerticalPositioner::remove + \qmlproperty Transition Column::remove This property holds the transition to apply when removing an item from the positioner. The transition is only applied to the removed items. Removed can mean that either the object has been deleted or reparented, and thus is now longer a child of the positioner, or that the object has had its opacity set to zero, and thus is no longer visible. @@ -377,7 +377,7 @@ VerticalPositioner { \o \image positioner-remove.gif \o \qml -VerticalPositioner { +Column { remove: Transition { NumberAnimation { properties: "opacity" @@ -392,7 +392,7 @@ VerticalPositioner { */ /*! - \qmlproperty Transition VerticalPositioner::add + \qmlproperty Transition Column::add This property holds the transition to be applied when adding an item to the positioner. The transition will only be applied to the added item(s). Added can mean that either the object has been created or reparented, and thus is now a child or the positioner, or that the object has had its opacity increased from zero, and thus is now visible. @@ -402,7 +402,7 @@ VerticalPositioner { \o \image positioner-add.gif \o \qml -VerticalPositioner { +Column { add: Transition { NumberAnimation { properties: "opacity" @@ -417,7 +417,7 @@ VerticalPositioner { */ /*! - \qmlproperty Transition VerticalPositioner::move + \qmlproperty Transition Column::move This property holds the transition to apply when moving an item within the positioner. This can happen when other items are added or removed from the positioner, or when items resize themselves. @@ -427,7 +427,7 @@ VerticalPositioner { \o \image positioner-move.gif \o \qml -VerticalPositioner { +Column { move: Transition { NumberAnimation { properties: "y" @@ -439,12 +439,12 @@ VerticalPositioner { \endtable */ /*! - \qmlproperty int VerticalPositioner::spacing + \qmlproperty int Column::spacing spacing is the amount in pixels left empty between each adjacent item, and defaults to 0. - The below example places a GridPositioner containing a red, a blue and a + The below example places a Grid containing a red, a blue and a green rectangle on a gray background. The area the grid positioner occupies is colored white. The top positioner has the default of no spacing, and the bottom positioner has its spacing set to 2. @@ -455,16 +455,16 @@ VerticalPositioner { */ /*! \internal - \class QFxVerticalPositioner - \brief The QFxVerticalPositioner class lines up items vertically. + \class QFxColumn + \brief The QFxColumn class lines up items vertically. \ingroup group_positioners */ -QFxVerticalPositioner::QFxVerticalPositioner(QFxItem *parent) +QFxColumn::QFxColumn(QFxItem *parent) : QFxBasePositioner(Vertical, parent) { } -void QFxVerticalPositioner::doPositioning() +void QFxColumn::doPositioning() { int voffset = 0; @@ -500,13 +500,13 @@ void QFxVerticalPositioner::doPositioning() } } -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,HorizontalPositioner,QFxHorizontalPositioner) +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Row,QFxRow) /*! - \qmlclass HorizontalPositioner - \brief The HorizontalPositioner item lines up its children horizontally. + \qmlclass Row + \brief The Row item lines up its children horizontally. \inherits Item - The HorizontalPositioner item positions its child items so that they are + The Row item positions its child items so that they are horizontally aligned and not overlapping. Spacing can be added between the items, and a margin around all items can also be added. It also provides for transitions to be set when items are added, moved, or removed in the @@ -515,9 +515,9 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,HorizontalPositioner,QFxHorizont positioner, as well as to items which have their opacity set to or from zero so as to appear or disappear. - The below example lays out differently shaped rectangles using a HorizontalPositioner. + The below example lays out differently shaped rectangles using a Row. \qml -HorizontalPositioner { +Row { spacing: 2 Rectangle { color: "red"; width: 50; height: 50 } Rectangle { color: "green"; width: 20; height: 50 } @@ -528,7 +528,7 @@ HorizontalPositioner { */ /*! - \qmlproperty Transition HorizontalPositioner::remove + \qmlproperty Transition Row::remove This property holds the transition to apply when removing an item from the positioner. The transition will only be applied to the removed item(s). @@ -537,7 +537,7 @@ HorizontalPositioner { Note that if the item counts as removed because its opacity is zero it will not be visible during the transition unless you set the opacity in the transition, like in the below example. \qml -HorizontalPositioner { +Row { remove: Transition { NumberAnimation { properties: "opacity" @@ -551,14 +551,14 @@ HorizontalPositioner { */ /*! - \qmlproperty Transition HorizontalPositioner::add + \qmlproperty Transition Row::add This property holds the transition to apply when adding an item to the positioner. The transition will only be applied to the added item(s). Added can mean that either the object has been created or reparented, and thus is now a child or the positioner, or that the object has had its opacity increased from zero, and thus is now visible. \qml -HorizontalPositioner { +Row { add: Transition { NumberAnimation { properties: "opacity" @@ -572,13 +572,13 @@ HorizontalPositioner { */ /*! - \qmlproperty Transition HorizontalPositioner::move + \qmlproperty Transition Row::move This property holds the transition to apply when moving an item within the positioner. This can happen when other items are added or removed from the positioner, or when items resize themselves. \qml -HorizontalPositioner { +Row { id: positioner move: Transition { NumberAnimation { @@ -591,12 +591,12 @@ HorizontalPositioner { */ /*! - \qmlproperty int HorizontalPositioner::spacing + \qmlproperty int Row::spacing spacing is the amount in pixels left empty between each adjacent item, and defaults to 0. - The below example places a GridPositioner containing a red, a blue and a + The below example places a Grid containing a red, a blue and a green rectangle on a gray background. The area the grid positioner occupies is colored white. The top positioner has the default of no spacing, and the bottom positioner has its spacing set to 2. @@ -607,16 +607,16 @@ HorizontalPositioner { */ /*! \internal - \class QFxHorizontalPositioner - \brief The QFxHorizontalPositioner class lines up items horizontally. + \class QFxRow + \brief The QFxRow class lines up items horizontally. \ingroup group_positioners */ -QFxHorizontalPositioner::QFxHorizontalPositioner(QFxItem *parent) +QFxRow::QFxRow(QFxItem *parent) : QFxBasePositioner(Horizontal, parent) { } -void QFxHorizontalPositioner::doPositioning() +void QFxRow::doPositioning() { int hoffset = 0; @@ -651,14 +651,14 @@ void QFxHorizontalPositioner::doPositioning() } } -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,GridPositioner,QFxGridPositioner) +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Grid,QFxGrid) /*! - \qmlclass GridPositioner QFxGridPositioner - \brief The GridPositioner item positions its children in a grid. + \qmlclass Grid QFxGrid + \brief The Grid item positions its children in a grid. \inherits Item - The GridPositioner item positions its child items so that they are + The Grid item positions its child items so that they are aligned in a grid and are not overlapping. Spacing can be added between the items. It also provides for transitions to be set when items are added, moved, or removed in the positioner. Adding and removing apply @@ -667,7 +667,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,GridPositioner,QFxGridPositioner well as to items which have their opacity set to or from zero so as to appear or disappear. - The GridPositioner defaults to using four columns, and as many rows as + The Grid defaults to using four columns, and as many rows as are necessary to fit all the child items. The number of rows and/or the number of columns can be constrained by setting the rows or columns properties. The grid positioner calculates a grid with @@ -681,7 +681,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,GridPositioner,QFxGridPositioner \o \image gridLayout_example.png \o \qml -GridPositioner { +Grid { columns: 3 spacing: 2 Rectangle { color: "red"; width: 50; height: 50 } @@ -694,7 +694,7 @@ GridPositioner { \endtable */ /*! - \qmlproperty Transition GridPositioner::remove + \qmlproperty Transition Grid::remove This property holds the transition to apply when removing an item from the positioner. The transition is only applied to the removed item(s). @@ -708,7 +708,7 @@ GridPositioner { the opacity in the transition, like in the below example. \qml -GridPositioner { +Grid { remove: Transition { NumberAnimation { properties: "opacity" @@ -722,7 +722,7 @@ GridPositioner { */ /*! - \qmlproperty Transition GridPositioner::add + \qmlproperty Transition Grid::add This property holds the transition to apply when adding an item to the positioner. The transition is only applied to the added item(s). @@ -732,7 +732,7 @@ GridPositioner { visible. \qml -GridPositioner { +Grid { add: Transition { NumberAnimation { properties: "opacity" @@ -746,14 +746,14 @@ GridPositioner { */ /*! - \qmlproperty Transition GridPositioner::move + \qmlproperty Transition Grid::move This property holds the transition to apply when moving an item within the positioner. This can happen when other items are added or removed from the positioner, or when items resize themselves. \qml -GridPositioner { +Grid { move: Transition { NumberAnimation { properties: "x,y" @@ -765,12 +765,12 @@ GridPositioner { */ /*! - \qmlproperty int GridPositioner::spacing + \qmlproperty int Grid::spacing spacing is the amount in pixels left empty between each adjacent item, and defaults to 0. - The below example places a GridPositioner containing a red, a blue and a + The below example places a Grid containing a red, a blue and a green rectangle on a gray background. The area the grid positioner occupies is colored white. The top positioner has the default of no spacing, and the bottom positioner has its spacing set to 2. @@ -781,12 +781,12 @@ GridPositioner { */ /*! \internal - \class QFxGridPositioner - \brief The QFxGridPositioner class lays out items in a grid. + \class QFxGrid + \brief The QFxGrid class lays out items in a grid. \ingroup group_layouts */ -QFxGridPositioner::QFxGridPositioner(QFxItem *parent) : +QFxGrid::QFxGrid(QFxItem *parent) : QFxBasePositioner(Both, parent) { _columns=-1; @@ -794,24 +794,24 @@ QFxGridPositioner::QFxGridPositioner(QFxItem *parent) : } /*! - \qmlproperty int GridPositioner::columns + \qmlproperty int Grid::columns This property holds the number of columns in the grid. - When the columns property is set the GridPositioner will always have + When the columns property is set the Grid will always have that many columns. Note that if you do not have enough items to fill this many columns some columns will be of zero width. */ /*! - \qmlproperty int GridPositioner::rows + \qmlproperty int Grid::rows This property holds the number of rows in the grid. - When the rows property is set the GridPositioner will always have that + When the rows property is set the Grid will always have that many rows. Note that if you do not have enough items to fill this many rows some rows will be of zero width. */ -void QFxGridPositioner::doPositioning() +void QFxGrid::doPositioning() { int c=_columns,r=_rows;//Actual number of rows/columns int numVisible = items()->size() + newItems()->size(); diff --git a/src/declarative/fx/qfxpositioners.h b/src/declarative/fx/qfxpositioners.h index 9560925..9c18452 100644 --- a/src/declarative/fx/qfxpositioners.h +++ b/src/declarative/fx/qfxpositioners.h @@ -111,35 +111,35 @@ private: Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QFxBasePositioner) }; -class Q_DECLARATIVE_EXPORT QFxVerticalPositioner : public QFxBasePositioner +class Q_DECLARATIVE_EXPORT QFxColumn : public QFxBasePositioner { Q_OBJECT public: - QFxVerticalPositioner(QFxItem *parent=0); + QFxColumn(QFxItem *parent=0); protected Q_SLOTS: virtual void doPositioning(); private: - Q_DISABLE_COPY(QFxVerticalPositioner) + Q_DISABLE_COPY(QFxColumn) }; -class Q_DECLARATIVE_EXPORT QFxHorizontalPositioner: public QFxBasePositioner +class Q_DECLARATIVE_EXPORT QFxRow: public QFxBasePositioner { Q_OBJECT public: - QFxHorizontalPositioner(QFxItem *parent=0); + QFxRow(QFxItem *parent=0); protected Q_SLOTS: virtual void doPositioning(); private: - Q_DISABLE_COPY(QFxHorizontalPositioner) + Q_DISABLE_COPY(QFxRow) }; -class Q_DECLARATIVE_EXPORT QFxGridPositioner : public QFxBasePositioner +class Q_DECLARATIVE_EXPORT QFxGrid : public QFxBasePositioner { Q_OBJECT Q_PROPERTY(int rows READ rows WRITE setRows) Q_PROPERTY(int columns READ columns WRITE setcolumns) public: - QFxGridPositioner(QFxItem *parent=0); + QFxGrid(QFxItem *parent=0); int rows() const {return _rows;} void setRows(const int rows){_rows = rows;} @@ -152,14 +152,14 @@ protected Q_SLOTS: private: int _rows; int _columns; - Q_DISABLE_COPY(QFxGridPositioner) + Q_DISABLE_COPY(QFxGrid) }; QT_END_NAMESPACE -QML_DECLARE_TYPE(QFxVerticalPositioner) -QML_DECLARE_TYPE(QFxHorizontalPositioner) -QML_DECLARE_TYPE(QFxGridPositioner) +QML_DECLARE_TYPE(QFxColumn) +QML_DECLARE_TYPE(QFxRow) +QML_DECLARE_TYPE(QFxGrid) QT_END_HEADER diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index 69768b3..c60aaf2 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -229,7 +229,7 @@ QColor QFxText::color() const Supported text styles are \c Normal, \c Outline, \c Raised and \c Sunken. \qml - HorizontalPositioner { + Row { Text { font.pointSize: 24; text: "Normal" } Text { font.pointSize: 24; text: "Raised"; style: "Raised"; styleColor: "#AAAAAA" } Text { font.pointSize: 24; text: "Outline"; style: "Outline"; styleColor: "red" } @@ -363,7 +363,7 @@ void QFxText::setWrap(bool w) \row \o \qml -VerticalPositioner { +Column { TextEdit { font.pointSize: 24 text: "<b>Hello</b> <i>World!</i>" diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index eaceeeb..c2c418e 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -172,7 +172,7 @@ void QFxTextEdit::setText(const QString &text) \row \o \qml -VerticalPositioner { +Column { TextEdit { font.pointSize: 24 text: "<b>Hello</b> <i>World!</i>" diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index 51b0dae..98c552f 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -153,7 +153,7 @@ struct ListModelData width: 200; height: 50 Text { id: Name; text: name } Text { text: '$'+cost; anchors.right: parent.right } - HorizontalPositioner { + Row { anchors.top: Name.bottom spacing: 5 Text { text: "Attributes:" } diff --git a/tests/auto/declarative/layouts/data/grid-spacing.qml b/tests/auto/declarative/layouts/data/grid-spacing.qml index f8b5620..f9ae204 100644 --- a/tests/auto/declarative/layouts/data/grid-spacing.qml +++ b/tests/auto/declarative/layouts/data/grid-spacing.qml @@ -3,7 +3,7 @@ import Qt 4.6 Item { width: 640 height: 480 - GridPositioner { + Grid { columns: 3 spacing: 4 Rect { diff --git a/tests/auto/declarative/layouts/data/grid.qml b/tests/auto/declarative/layouts/data/grid.qml index 2fbc37c..3861f63 100644 --- a/tests/auto/declarative/layouts/data/grid.qml +++ b/tests/auto/declarative/layouts/data/grid.qml @@ -3,7 +3,7 @@ import Qt 4.6 Item { width: 640 height: 480 - GridPositioner { + Grid { columns: 3 Rect { id: one diff --git a/tests/auto/declarative/layouts/data/horizontal-spacing.qml b/tests/auto/declarative/layouts/data/horizontal-spacing.qml index 25dad8a..8594ee6 100644 --- a/tests/auto/declarative/layouts/data/horizontal-spacing.qml +++ b/tests/auto/declarative/layouts/data/horizontal-spacing.qml @@ -3,7 +3,7 @@ import Qt 4.6 Item { width: 640 height: 480 - HorizontalPositioner { + Row { spacing: 10 Rect { id: one diff --git a/tests/auto/declarative/layouts/data/horizontal.qml b/tests/auto/declarative/layouts/data/horizontal.qml index 4bce504..673e77e 100644 --- a/tests/auto/declarative/layouts/data/horizontal.qml +++ b/tests/auto/declarative/layouts/data/horizontal.qml @@ -3,7 +3,7 @@ import Qt 4.6 Item { width: 640 height: 480 - HorizontalPositioner { + Row { Rect { id: one color: "red" diff --git a/tests/auto/declarative/layouts/data/vertical-spacing.qml b/tests/auto/declarative/layouts/data/vertical-spacing.qml index aa704be..49bd8c6 100644 --- a/tests/auto/declarative/layouts/data/vertical-spacing.qml +++ b/tests/auto/declarative/layouts/data/vertical-spacing.qml @@ -3,7 +3,7 @@ import Qt 4.6 Item { width: 640 height: 480 - VerticalPositioner { + Column { spacing: 10 Rect { id: one diff --git a/tests/auto/declarative/layouts/data/vertical.qml b/tests/auto/declarative/layouts/data/vertical.qml index 0a52126..c8d3a11 100644 --- a/tests/auto/declarative/layouts/data/vertical.qml +++ b/tests/auto/declarative/layouts/data/vertical.qml @@ -3,7 +3,7 @@ import Qt 4.6 Item { width: 640 height: 480 - VerticalPositioner { + Column { Rect { id: one color: "red" diff --git a/tools/qmldebugger/engines.qml b/tools/qmldebugger/engines.qml index 9a96c4b..1652ebd 100644 --- a/tools/qmldebugger/engines.qml +++ b/tools/qmldebugger/engines.qml @@ -6,7 +6,7 @@ Item { signal engineClicked(int id) signal refreshEngines() - HorizontalPositioner { + Row { anchors.fill: parent Repeater { dataSource: engines |