summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-10-05 00:07:53 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-10-05 00:07:53 (GMT)
commit0da076c99b159edb3239b5b963780bda3f240d79 (patch)
tree4d62fb0cde2e48bd866f50005cfda48bb77885d7 /examples
parent956f3baa661ec846d64793c2241718bfb311c452 (diff)
parent8e3bc733da076e321bd9a03d74aa79eb32d8d1e8 (diff)
downloadQt-0da076c99b159edb3239b5b963780bda3f240d79.zip
Qt-0da076c99b159edb3239b5b963780bda3f240d79.tar.gz
Qt-0da076c99b159edb3239b5b963780bda3f240d79.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/extending/binding/happybirthday.cpp2
-rw-r--r--examples/declarative/extending/binding/happybirthday.h6
-rw-r--r--examples/declarative/extending/extended/lineedit.cpp8
-rw-r--r--examples/declarative/extending/extended/lineedit.h8
-rw-r--r--examples/declarative/extending/valuesource/happybirthday.cpp2
-rw-r--r--examples/declarative/extending/valuesource/happybirthday.h5
-rw-r--r--examples/declarative/flowview/FlickrView.qml (renamed from examples/declarative/flowview/flickr.qml)0
-rw-r--r--examples/declarative/flowview/RoundedRect.qml (renamed from examples/declarative/flowview/rect.qml)0
-rw-r--r--examples/declarative/flowview/flowview.qml44
9 files changed, 41 insertions, 34 deletions
diff --git a/examples/declarative/extending/binding/happybirthday.cpp b/examples/declarative/extending/binding/happybirthday.cpp
index d1f485e..dd1247f 100644
--- a/examples/declarative/extending/binding/happybirthday.cpp
+++ b/examples/declarative/extending/binding/happybirthday.cpp
@@ -2,7 +2,7 @@
#include <QTimer>
HappyBirthday::HappyBirthday(QObject *parent)
-: QmlPropertyValueSource(parent), m_line(-1)
+: QObject(parent), m_line(-1)
{
setName(QString());
QTimer *timer = new QTimer(this);
diff --git a/examples/declarative/extending/binding/happybirthday.h b/examples/declarative/extending/binding/happybirthday.h
index 3039db2..fff2df0 100644
--- a/examples/declarative/extending/binding/happybirthday.h
+++ b/examples/declarative/extending/binding/happybirthday.h
@@ -2,8 +2,12 @@
#define HAPPYBIRTHDAY_H
#include <QmlPropertyValueSource>
+#include <QmlMetaProperty>
+#include <qml.h>
-class HappyBirthday : public QmlPropertyValueSource
+#include <QStringList>
+
+class HappyBirthday : public QObject, public QmlPropertyValueSource
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
diff --git a/examples/declarative/extending/extended/lineedit.cpp b/examples/declarative/extending/extended/lineedit.cpp
index f11d22e..0597540 100644
--- a/examples/declarative/extending/extended/lineedit.cpp
+++ b/examples/declarative/extending/extended/lineedit.cpp
@@ -13,7 +13,7 @@ int LineEditExtension::leftMargin() const
return l;
}
-int LineEditExtension::setLeftMargin(int m)
+void LineEditExtension::setLeftMargin(int m)
{
int l, r, t, b;
m_lineedit->getTextMargins(&l, &t, &r, &b);
@@ -27,7 +27,7 @@ int LineEditExtension::rightMargin() const
return r;
}
-int LineEditExtension::setRightMargin(int m)
+void LineEditExtension::setRightMargin(int m)
{
int l, r, t, b;
m_lineedit->getTextMargins(&l, &t, &r, &b);
@@ -41,7 +41,7 @@ int LineEditExtension::topMargin() const
return t;
}
-int LineEditExtension::setTopMargin(int m)
+void LineEditExtension::setTopMargin(int m)
{
int l, r, t, b;
m_lineedit->getTextMargins(&l, &t, &r, &b);
@@ -55,7 +55,7 @@ int LineEditExtension::bottomMargin() const
return b;
}
-int LineEditExtension::setBottomMargin(int m)
+void LineEditExtension::setBottomMargin(int m)
{
int l, r, t, b;
m_lineedit->getTextMargins(&l, &t, &r, &b);
diff --git a/examples/declarative/extending/extended/lineedit.h b/examples/declarative/extending/extended/lineedit.h
index 860e042..79fe977 100644
--- a/examples/declarative/extending/extended/lineedit.h
+++ b/examples/declarative/extending/extended/lineedit.h
@@ -14,16 +14,16 @@ public:
LineEditExtension(QObject *);
int leftMargin() const;
- int setLeftMargin(int);
+ void setLeftMargin(int);
int rightMargin() const;
- int setRightMargin(int);
+ void setRightMargin(int);
int topMargin() const;
- int setTopMargin(int);
+ void setTopMargin(int);
int bottomMargin() const;
- int setBottomMargin(int);
+ void setBottomMargin(int);
signals:
void marginsChanged();
diff --git a/examples/declarative/extending/valuesource/happybirthday.cpp b/examples/declarative/extending/valuesource/happybirthday.cpp
index 905dc51..4862aa9 100644
--- a/examples/declarative/extending/valuesource/happybirthday.cpp
+++ b/examples/declarative/extending/valuesource/happybirthday.cpp
@@ -2,7 +2,7 @@
#include <QTimer>
HappyBirthday::HappyBirthday(QObject *parent)
-: QmlPropertyValueSource(parent), m_line(-1)
+: QObject(parent), m_line(-1)
{
setName(QString());
QTimer *timer = new QTimer(this);
diff --git a/examples/declarative/extending/valuesource/happybirthday.h b/examples/declarative/extending/valuesource/happybirthday.h
index e0d4912..18ac1f4 100644
--- a/examples/declarative/extending/valuesource/happybirthday.h
+++ b/examples/declarative/extending/valuesource/happybirthday.h
@@ -2,9 +2,12 @@
#define HAPPYBIRTHDAY_H
#include <QmlPropertyValueSource>
+#include <qml.h>
+
+#include <QStringList>
// ![0]
-class HappyBirthday : public QmlPropertyValueSource
+class HappyBirthday : public QObject, public QmlPropertyValueSource
{
Q_OBJECT
// ![0]
diff --git a/examples/declarative/flowview/flickr.qml b/examples/declarative/flowview/FlickrView.qml
index 1cdb132..1cdb132 100644
--- a/examples/declarative/flowview/flickr.qml
+++ b/examples/declarative/flowview/FlickrView.qml
diff --git a/examples/declarative/flowview/rect.qml b/examples/declarative/flowview/RoundedRect.qml
index 7d2b58b..7d2b58b 100644
--- a/examples/declarative/flowview/rect.qml
+++ b/examples/declarative/flowview/RoundedRect.qml
diff --git a/examples/declarative/flowview/flowview.qml b/examples/declarative/flowview/flowview.qml
index 1ab8e92..85c20d9 100644
--- a/examples/declarative/flowview/flowview.qml
+++ b/examples/declarative/flowview/flowview.qml
@@ -35,12 +35,12 @@ Rectangle {
VisualDataModel {
id: Model
model: ListModel {
- ListElement { background: "red"; weblet: "rect.qml" }
- ListElement { background: "yellow"; weblet: "rect.qml" }
- ListElement { background: "blue"; weblet: "rect.qml" }
- ListElement { background: "green"; weblet: "flickr.qml" }
- ListElement { background: "orange"; weblet: "rect.qml" }
- ListElement { background: "lightblue"; weblet: "rect.qml" }
+ ListElement { background: "red"; weblet: "RoundedRect.qml" }
+ ListElement { background: "yellow"; weblet: "RoundedRect.qml" }
+ ListElement { background: "blue"; weblet: "RoundedRect.qml" }
+ ListElement { background: "green"; weblet: "FlickrView.qml" }
+ ListElement { background: "orange"; weblet: "RoundedRect.qml" }
+ ListElement { background: "lightblue"; weblet: "RoundedRect.qml" }
}
delegate: Package {
Item { id: List; Package.name: "list"; width:120; height: 400; }
@@ -63,22 +63,22 @@ Rectangle {
}
]
transitions: [
- Transition {
- from: "*"; to: "InGrid"
- SequentialAnimation {
- ParentAction{}
- PauseAnimation { duration: 50 * List.FlowView.column }
- NumberAnimation { properties: "x,y,rotation"; easing: "easeInOutQuad" }
- }
- },
- Transition {
- from: "*"; to: "InList"
- SequentialAnimation {
- ParentAction{}
- PauseAnimation { duration: 50 * (GridItem.FlowView.row * 2 + GridItem.FlowView.column) }
- NumberAnimation { properties: "x,y,rotation"; easing: "easeInOutQuad" }
- }
- }
+ Transition {
+ from: "*"; to: "InGrid"
+ SequentialAnimation {
+ ParentAction{}
+ PauseAnimation { duration: 50 * List.FlowView.column }
+ NumberAnimation { properties: "x,y,rotation"; easing: "easeInOutQuad" }
+ }
+ },
+ Transition {
+ from: "*"; to: "InList"
+ SequentialAnimation {
+ ParentAction{}
+ PauseAnimation { duration: 50 * (GridItem.FlowView.row * 2 + GridItem.FlowView.column) }
+ NumberAnimation { properties: "x,y,rotation"; easing: "easeInOutQuad" }
+ }
+ }
]
}