summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-09-07 03:06:10 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-09-07 03:06:10 (GMT)
commitbb6fb2bb9e329024f617369dc3ae9dde2963287b (patch)
tree28d44cfa7214147a3fa7a90deef35280d52ab67d
parent997cec43fd789917fa038b3a963d2ad19d3bd682 (diff)
downloadQt-bb6fb2bb9e329024f617369dc3ae9dde2963287b.zip
Qt-bb6fb2bb9e329024f617369dc3ae9dde2963287b.tar.gz
Qt-bb6fb2bb9e329024f617369dc3ae9dde2963287b.tar.bz2
Use data as the default property of the views.
-rw-r--r--examples/declarative/listview/listview.qml21
-rw-r--r--src/declarative/fx/qfxgridview.h2
-rw-r--r--src/declarative/fx/qfxlistview.h2
-rw-r--r--src/declarative/fx/qfxpathview.h2
4 files changed, 12 insertions, 15 deletions
diff --git a/examples/declarative/listview/listview.qml b/examples/declarative/listview/listview.qml
index 0f197b4..1cca5ad 100644
--- a/examples/declarative/listview/listview.qml
+++ b/examples/declarative/listview/listview.qml
@@ -66,17 +66,14 @@ Rectangle {
model: MyPetsModel; delegate: PetDelegate
currentItemPositioning: "SnapAuto"; snapPosition: 125
currentIndex: List1.currentIndex
- children: [
- // Position a static highlight rather than a normal highlight so that
- // when the view is flicked, the highlight does not move.
- // By positioning the highlight at the same position as the snapPosition
- // the item under the highlight will always be the current item.
- // Note that we specify the 'children' property. This is because
- // the default property of a ListView is 'delegate'.
- Rectangle {
- y: 125; width: 200; height: 50
- color: "#FFFF88"; z: -1
- }
- ]
+
+ // Position a static highlight rather than a normal highlight so that
+ // when the view is flicked, the highlight does not move.
+ // By positioning the highlight at the same position as the snapPosition
+ // the item under the highlight will always be the current item.
+ Rectangle {
+ y: 125; width: 200; height: 50
+ color: "#FFFF88"; z: -1
+ }
}
}
diff --git a/src/declarative/fx/qfxgridview.h b/src/declarative/fx/qfxgridview.h
index 4f2146d..4ebd311 100644
--- a/src/declarative/fx/qfxgridview.h
+++ b/src/declarative/fx/qfxgridview.h
@@ -58,7 +58,6 @@ class Q_DECLARATIVE_EXPORT QFxGridView : public QFxFlickable
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QFxGridView)
Q_PROPERTY(QVariant model READ model WRITE setModel)
- Q_CLASSINFO("DefaultProperty", "delegate")
Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
Q_PROPERTY(QFxItem *current READ currentItem NOTIFY currentIndexChanged)
@@ -70,6 +69,7 @@ class Q_DECLARATIVE_EXPORT QFxGridView : public QFxFlickable
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer)
Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellSizeChanged)
Q_PROPERTY(int cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellSizeChanged)
+ Q_CLASSINFO("DefaultProperty", "data")
public:
QFxGridView(QFxItem *parent=0);
diff --git a/src/declarative/fx/qfxlistview.h b/src/declarative/fx/qfxlistview.h
index dbab57b..42ce1a2 100644
--- a/src/declarative/fx/qfxlistview.h
+++ b/src/declarative/fx/qfxlistview.h
@@ -60,7 +60,6 @@ class Q_DECLARATIVE_EXPORT QFxListView : public QFxFlickable
Q_ENUMS(CurrentItemPositioning)
Q_PROPERTY(QVariant model READ model WRITE setModel)
- Q_CLASSINFO("DefaultProperty", "delegate")
Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
Q_PROPERTY(QFxItem *current READ currentItem NOTIFY currentIndexChanged)
@@ -75,6 +74,7 @@ class Q_DECLARATIVE_EXPORT QFxListView : public QFxFlickable
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer)
Q_PROPERTY(QString sectionExpression READ sectionExpression WRITE setSectionExpression NOTIFY sectionExpressionChanged)
Q_PROPERTY(QString currentSection READ currentSection NOTIFY currentSectionChanged)
+ Q_CLASSINFO("DefaultProperty", "data")
public:
QFxListView(QFxItem *parent=0);
diff --git a/src/declarative/fx/qfxpathview.h b/src/declarative/fx/qfxpathview.h
index a0ef262..3ee352a 100644
--- a/src/declarative/fx/qfxpathview.h
+++ b/src/declarative/fx/qfxpathview.h
@@ -66,7 +66,7 @@ class Q_DECLARATIVE_EXPORT QFxPathView : public QFxItem
Q_PROPERTY(int count READ count)
Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate)
Q_PROPERTY(int pathItemCount READ pathItemCount WRITE setPathItemCount)
- Q_CLASSINFO("DefaultProperty", "delegate")
+
public:
QFxPathView(QFxItem *parent=0);
virtual ~QFxPathView();