summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/attached
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-26 12:18:02 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-26 12:18:02 (GMT)
commit27e403d9c6185c606980bb7881e39a2c88138a13 (patch)
tree5abe2f83832f9c2a7b3ef1804f4a79d89fa8b831 /examples/declarative/extending/attached
parentae13ad51dda7246e73d282165201f637d04a667e (diff)
parent67bb989e11cf47431e419966bff7257c028ea958 (diff)
downloadQt-27e403d9c6185c606980bb7881e39a2c88138a13.zip
Qt-27e403d9c6185c606980bb7881e39a2c88138a13.tar.gz
Qt-27e403d9c6185c606980bb7881e39a2c88138a13.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml: (139 commits) Fixed qdeclarativeconnection test. missed rename Revert "Some animation cleanup/refactoring." Rename files to follow class name. Change Connection syntax as per QT-2822. Doc update painted geometry on pixmapChanged rather than sourceChanged Make Flickable overshoot behavior nicer. Polish QDeclarativeProperty API Test, demo, and work-around bug QTBUG-8535 Fix ParentAnimation crash. Tiny doc tweak. Work around requires() bug in qmake Make sure that QEasingCurve::type when streamed is a quint8, as documented Add QEasingCurve to datastream format docs Move QEasingCurve datastream autotest to qdatastream for more comprehensive tests Some animation cleanup/refactoring. Fix Flickable.overShoot doc - it is a bool not a real Rebuild since -declarative auto detection changed. Renamed Flickable viewportXXX properties contentXXX ...
Diffstat (limited to 'examples/declarative/extending/attached')
-rw-r--r--examples/declarative/extending/attached/birthdayparty.cpp7
-rw-r--r--examples/declarative/extending/attached/birthdayparty.h6
-rw-r--r--examples/declarative/extending/attached/main.cpp15
-rw-r--r--examples/declarative/extending/attached/person.cpp4
-rw-r--r--examples/declarative/extending/attached/person.h2
5 files changed, 17 insertions, 17 deletions
diff --git a/examples/declarative/extending/attached/birthdayparty.cpp b/examples/declarative/extending/attached/birthdayparty.cpp
index ffdda57..d4f2675 100644
--- a/examples/declarative/extending/attached/birthdayparty.cpp
+++ b/examples/declarative/extending/attached/birthdayparty.cpp
@@ -55,8 +55,6 @@ void BirthdayPartyAttached::setRsvp(const QDate &d)
m_rsvp = d;
}
-QML_DEFINE_NOCREATE_TYPE(BirthdayPartyAttached);
-
BirthdayParty::BirthdayParty(QObject *parent)
: QObject(parent), m_celebrant(0)
{
@@ -72,9 +70,9 @@ void BirthdayParty::setCelebrant(Person *c)
m_celebrant = c;
}
-QmlListProperty<Person> BirthdayParty::guests()
+QDeclarativeListProperty<Person> BirthdayParty::guests()
{
- return QmlListProperty<Person>(this, m_guests);
+ return QDeclarativeListProperty<Person>(this, m_guests);
}
int BirthdayParty::guestCount() const
@@ -92,4 +90,3 @@ BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)
return new BirthdayPartyAttached(object);
}
-QML_DEFINE_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
diff --git a/examples/declarative/extending/attached/birthdayparty.h b/examples/declarative/extending/attached/birthdayparty.h
index 9ba0f8b..d8ca2e1 100644
--- a/examples/declarative/extending/attached/birthdayparty.h
+++ b/examples/declarative/extending/attached/birthdayparty.h
@@ -43,7 +43,7 @@
#include <QObject>
#include <QDate>
-#include <qml.h>
+#include <qdeclarative.h>
#include "person.h"
class BirthdayPartyAttached : public QObject
@@ -65,7 +65,7 @@ class BirthdayParty : public QObject
{
Q_OBJECT
Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant)
-Q_PROPERTY(QmlListProperty<Person> guests READ guests)
+Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
Q_CLASSINFO("DefaultProperty", "guests")
public:
BirthdayParty(QObject *parent = 0);
@@ -73,7 +73,7 @@ public:
Person *celebrant() const;
void setCelebrant(Person *);
- QmlListProperty<Person> guests();
+ QDeclarativeListProperty<Person> guests();
int guestCount() const;
Person *guest(int) const;
diff --git a/examples/declarative/extending/attached/main.cpp b/examples/declarative/extending/attached/main.cpp
index 27a9287..684d8d3 100644
--- a/examples/declarative/extending/attached/main.cpp
+++ b/examples/declarative/extending/attached/main.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
#include <QCoreApplication>
-#include <QmlEngine>
-#include <QmlComponent>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
#include <QDebug>
#include "birthdayparty.h"
#include "person.h"
@@ -49,8 +49,15 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QmlEngine engine;
- QmlComponent component(&engine, ":example.qml");
+ QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached);
+ QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
+ QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
+ QML_REGISTER_NOCREATE_TYPE(Person);
+ QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
+ QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, ":example.qml");
BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
if (party && party->celebrant()) {
diff --git a/examples/declarative/extending/attached/person.cpp b/examples/declarative/extending/attached/person.cpp
index 909505a..0a9e508 100644
--- a/examples/declarative/extending/attached/person.cpp
+++ b/examples/declarative/extending/attached/person.cpp
@@ -84,7 +84,6 @@ void ShoeDescription::setPrice(qreal p)
{
m_price = p;
}
-QML_DEFINE_NOCREATE_TYPE(ShoeDescription);
Person::Person(QObject *parent)
: QObject(parent)
@@ -106,18 +105,15 @@ ShoeDescription *Person::shoe()
return &m_shoe;
}
-QML_DEFINE_NOCREATE_TYPE(Person);
Boy::Boy(QObject * parent)
: Person(parent)
{
}
-QML_DEFINE_TYPE(People, 1,0, Boy, Boy);
Girl::Girl(QObject * parent)
: Person(parent)
{
}
-QML_DEFINE_TYPE(People, 1,0, Girl, Girl);
diff --git a/examples/declarative/extending/attached/person.h b/examples/declarative/extending/attached/person.h
index dd03091..0f86d8b 100644
--- a/examples/declarative/extending/attached/person.h
+++ b/examples/declarative/extending/attached/person.h
@@ -43,7 +43,7 @@
#include <QObject>
#include <QColor>
-#include <qml.h>
+#include <qdeclarative.h>
class ShoeDescription : public QObject {
Q_OBJECT