summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-04-19 06:30:56 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-04-19 06:50:52 (GMT)
commit9943a3ef522f293c26af0c65b0bc0a1df02a417d (patch)
tree74611818369e69141e13cdf385d75ad7cc90d85e
parent2a9a22c7464b706c1e1998e10910b8f99528c6c4 (diff)
downloadQt-9943a3ef522f293c26af0c65b0bc0a1df02a417d.zip
Qt-9943a3ef522f293c26af0c65b0bc0a1df02a417d.tar.gz
Qt-9943a3ef522f293c26af0c65b0bc0a1df02a417d.tar.bz2
QML_DECLARE_TYPE is no longer necessary - fix docs and examples
-rw-r--r--demos/declarative/minehunt/minehunt.cpp2
-rw-r--r--doc/src/declarative/extending-examples.qdoc5
-rw-r--r--doc/src/declarative/extending.qdoc1
-rw-r--r--doc/src/declarative/integrating.qdoc3
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h3
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h3
-rw-r--r--examples/declarative/extending/adding/person.h1
-rw-r--r--examples/declarative/extending/attached/birthdayparty.h2
-rw-r--r--examples/declarative/extending/attached/person.h4
-rw-r--r--examples/declarative/extending/binding/birthdayparty.h2
-rw-r--r--examples/declarative/extending/binding/happybirthday.h2
-rw-r--r--examples/declarative/extending/binding/person.h4
-rw-r--r--examples/declarative/extending/coercion/birthdayparty.h1
-rw-r--r--examples/declarative/extending/coercion/person.h6
-rw-r--r--examples/declarative/extending/default/birthdayparty.h1
-rw-r--r--examples/declarative/extending/default/person.h3
-rw-r--r--examples/declarative/extending/extended/lineedit.cpp2
-rw-r--r--examples/declarative/extending/grouped/birthdayparty.h2
-rw-r--r--examples/declarative/extending/grouped/person.h4
-rw-r--r--examples/declarative/extending/properties/birthdayparty.h1
-rw-r--r--examples/declarative/extending/properties/person.h1
-rw-r--r--examples/declarative/extending/signal/birthdayparty.h3
-rw-r--r--examples/declarative/extending/signal/person.h4
-rw-r--r--examples/declarative/extending/valuesource/birthdayparty.h3
-rw-r--r--examples/declarative/extending/valuesource/happybirthday.h1
-rw-r--r--examples/declarative/extending/valuesource/person.h4
-rw-r--r--examples/declarative/proxywidgets/proxywidgets.cpp2
27 files changed, 7 insertions, 63 deletions
diff --git a/demos/declarative/minehunt/minehunt.cpp b/demos/declarative/minehunt/minehunt.cpp
index d4b0039..93cd1c1 100644
--- a/demos/declarative/minehunt/minehunt.cpp
+++ b/demos/declarative/minehunt/minehunt.cpp
@@ -305,8 +305,6 @@ bool MinehuntGame::flag(int row, int col)
return true;
}
-QML_DECLARE_TYPE(TileData);
-
class MinehuntExtensionPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/declarative/extending-examples.qdoc
index cc66838..307162e 100644
--- a/doc/src/declarative/extending-examples.qdoc
+++ b/doc/src/declarative/extending-examples.qdoc
@@ -57,11 +57,6 @@ element, the C++ class can be named differently, or appear in a namespace.
\snippet examples/declarative/extending/adding/person.h 0
-Following the class declaration, we include the QML_DECLARE_TYPE() macro. This
-is necessary to declare the type to QML. It also includes the logic necessary
-to expose the class to Qt's meta system - that is, it includes the
-Q_DECLARE_METATYPE() functionality.
-
\section1 Define the Person class
\snippet examples/declarative/extending/adding/person.cpp 0
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index 4d477c6..a1d8a10 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -305,7 +305,6 @@ public:
};
QML_DECLARE_TYPEINFO(MyType, QML_HAS_ATTACHED_PROPERTIES)
-QML_DECLARE_TYPE(MyType)
\endcode
Return an attachment object, of type \a AttachedPropertiesType, for the
attachee \a object instance. It is customary, though not strictly required, for
diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc
index d4034fa..65413ec 100644
--- a/doc/src/declarative/integrating.qdoc
+++ b/doc/src/declarative/integrating.qdoc
@@ -115,8 +115,7 @@ any custom C++ types and create a plugin that registers the custom types
so that they can be used from your QML file.
Here is an example. Suppose you have two classes, \c RedSquare and \c BlueCircle,
-that both inherit from QGraphicsWidget. First, you need to register these two types
-using the \c QML_DECLARE_TYPE macro from \c <QtDeclarative/qdeclarative.h>, like this:
+that both inherit from QGraphicsWidget:
\c [graphicswidgets/redsquare.h]
\snippet doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h 0
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h b/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h
index 028718f..73d66b7 100644
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h
+++ b/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h
@@ -39,7 +39,6 @@
**
****************************************************************************/
//![0]
-#include <QtDeclarative/qdeclarative.h>
#include <QGraphicsWidget>
#include <QPainter>
@@ -53,6 +52,4 @@ public:
painter->drawEllipse(0, 0, size().width(), size().height());
}
};
-
-QML_DECLARE_TYPE(BlueCircle)
//![0]
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h b/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h
index 76e7d11..3050662 100644
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h
+++ b/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h
@@ -39,7 +39,6 @@
**
****************************************************************************/
//![0]
-#include <QtDeclarative/qdeclarative.h>
#include <QGraphicsWidget>
#include <QPainter>
@@ -52,6 +51,4 @@ public:
painter->fillRect(0, 0, size().width(), size().height(), QColor(Qt::red));
}
};
-
-QML_DECLARE_TYPE(RedSquare)
//![0]
diff --git a/examples/declarative/extending/adding/person.h b/examples/declarative/extending/adding/person.h
index fbaf2df..7a9e0f0 100644
--- a/examples/declarative/extending/adding/person.h
+++ b/examples/declarative/extending/adding/person.h
@@ -61,7 +61,6 @@ private:
QString m_name;
int m_shoeSize;
};
-QML_DECLARE_TYPE(Person);
// ![0]
#endif // PERSON_H
diff --git a/examples/declarative/extending/attached/birthdayparty.h b/examples/declarative/extending/attached/birthdayparty.h
index d8ca2e1..7c45d21 100644
--- a/examples/declarative/extending/attached/birthdayparty.h
+++ b/examples/declarative/extending/attached/birthdayparty.h
@@ -59,7 +59,6 @@ public:
private:
QDate m_rsvp;
};
-QML_DECLARE_TYPE(BirthdayPartyAttached)
class BirthdayParty : public QObject
{
@@ -84,6 +83,5 @@ private:
};
QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
-QML_DECLARE_TYPE(BirthdayParty)
#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/extending/attached/person.h b/examples/declarative/extending/attached/person.h
index 08caebf..7a4b9c3 100644
--- a/examples/declarative/extending/attached/person.h
+++ b/examples/declarative/extending/attached/person.h
@@ -71,7 +71,6 @@ private:
QString m_brand;
qreal m_price;
};
-QML_DECLARE_TYPE(ShoeDescription);
class Person : public QObject {
Q_OBJECT
@@ -88,20 +87,17 @@ private:
QString m_name;
ShoeDescription m_shoe;
};
-QML_DECLARE_TYPE(Person);
class Boy : public Person {
Q_OBJECT
public:
Boy(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Boy);
class Girl : public Person {
Q_OBJECT
public:
Girl(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Girl);
#endif // PERSON_H
diff --git a/examples/declarative/extending/binding/birthdayparty.h b/examples/declarative/extending/binding/birthdayparty.h
index 8486442..e2757bc 100644
--- a/examples/declarative/extending/binding/birthdayparty.h
+++ b/examples/declarative/extending/binding/birthdayparty.h
@@ -63,7 +63,6 @@ signals:
private:
QDate m_rsvp;
};
-QML_DECLARE_TYPE(BirthdayPartyAttached)
class BirthdayParty : public QObject
{
@@ -100,6 +99,5 @@ private:
};
QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
-QML_DECLARE_TYPE(BirthdayParty)
#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/extending/binding/happybirthday.h b/examples/declarative/extending/binding/happybirthday.h
index eb2da5e..0e5a90a 100644
--- a/examples/declarative/extending/binding/happybirthday.h
+++ b/examples/declarative/extending/binding/happybirthday.h
@@ -51,6 +51,7 @@ class HappyBirthday : public QObject, public QDeclarativePropertyValueSource
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+Q_INTERFACES(QDeclarativePropertyValueSource)
public:
HappyBirthday(QObject *parent = 0);
@@ -70,7 +71,6 @@ private:
QDeclarativeProperty m_target;
QString m_name;
};
-QML_DECLARE_TYPE(HappyBirthday);
#endif // HAPPYBIRTHDAY_H
diff --git a/examples/declarative/extending/binding/person.h b/examples/declarative/extending/binding/person.h
index 2d4ec12..0edfcdd 100644
--- a/examples/declarative/extending/binding/person.h
+++ b/examples/declarative/extending/binding/person.h
@@ -74,7 +74,6 @@ private:
QString m_brand;
qreal m_price;
};
-QML_DECLARE_TYPE(ShoeDescription);
class Person : public QObject {
Q_OBJECT
@@ -96,20 +95,17 @@ private:
QString m_name;
ShoeDescription m_shoe;
};
-QML_DECLARE_TYPE(Person);
class Boy : public Person {
Q_OBJECT
public:
Boy(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Boy);
class Girl : public Person {
Q_OBJECT
public:
Girl(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Girl);
#endif // PERSON_H
diff --git a/examples/declarative/extending/coercion/birthdayparty.h b/examples/declarative/extending/coercion/birthdayparty.h
index fffd407..a5d14f9 100644
--- a/examples/declarative/extending/coercion/birthdayparty.h
+++ b/examples/declarative/extending/coercion/birthdayparty.h
@@ -66,6 +66,5 @@ private:
Person *m_celebrant;
QList<Person *> m_guests;
};
-QML_DECLARE_TYPE(BirthdayParty);
#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/extending/coercion/person.h b/examples/declarative/extending/coercion/person.h
index 298ffb1..861f135 100644
--- a/examples/declarative/extending/coercion/person.h
+++ b/examples/declarative/extending/coercion/person.h
@@ -60,7 +60,7 @@ private:
QString m_name;
int m_shoeSize;
};
-QML_DECLARE_TYPE(Person);
+
// ![0]
class Boy : public Person {
@@ -68,14 +68,14 @@ Q_OBJECT
public:
Boy(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Boy);
+
class Girl : public Person {
Q_OBJECT
public:
Girl(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Girl);
+
// ![0]
#endif // PERSON_H
diff --git a/examples/declarative/extending/default/birthdayparty.h b/examples/declarative/extending/default/birthdayparty.h
index 49c20bd..c0cb0a4 100644
--- a/examples/declarative/extending/default/birthdayparty.h
+++ b/examples/declarative/extending/default/birthdayparty.h
@@ -67,6 +67,5 @@ private:
QList<Person *> m_guests;
};
// ![0]
-QML_DECLARE_TYPE(BirthdayParty);
#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/extending/default/person.h b/examples/declarative/extending/default/person.h
index b3eceaa..832bf11 100644
--- a/examples/declarative/extending/default/person.h
+++ b/examples/declarative/extending/default/person.h
@@ -60,20 +60,17 @@ private:
QString m_name;
int m_shoeSize;
};
-QML_DECLARE_TYPE(Person);
class Boy : public Person {
Q_OBJECT
public:
Boy(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Boy);
class Girl : public Person {
Q_OBJECT
public:
Girl(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Girl);
#endif // PERSON_H
diff --git a/examples/declarative/extending/extended/lineedit.cpp b/examples/declarative/extending/extended/lineedit.cpp
index 417fbd9..0e521ec 100644
--- a/examples/declarative/extending/extended/lineedit.cpp
+++ b/examples/declarative/extending/extended/lineedit.cpp
@@ -102,4 +102,4 @@ void LineEditExtension::setBottomMargin(int m)
m_lineedit->setTextMargins(l, t, r, m);
}
-QML_DECLARE_TYPE(QLineEdit);
+
diff --git a/examples/declarative/extending/grouped/birthdayparty.h b/examples/declarative/extending/grouped/birthdayparty.h
index 42439c4..4ac5602 100644
--- a/examples/declarative/extending/grouped/birthdayparty.h
+++ b/examples/declarative/extending/grouped/birthdayparty.h
@@ -65,6 +65,6 @@ private:
Person *m_celebrant;
QList<Person *> m_guests;
};
-QML_DECLARE_TYPE(BirthdayParty);
+
#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/extending/grouped/person.h b/examples/declarative/extending/grouped/person.h
index 5ea2348..216c015 100644
--- a/examples/declarative/extending/grouped/person.h
+++ b/examples/declarative/extending/grouped/person.h
@@ -71,7 +71,6 @@ private:
QString m_brand;
qreal m_price;
};
-QML_DECLARE_TYPE(ShoeDescription);
class Person : public QObject {
Q_OBJECT
@@ -90,20 +89,17 @@ private:
QString m_name;
ShoeDescription m_shoe;
};
-QML_DECLARE_TYPE(Person);
class Boy : public Person {
Q_OBJECT
public:
Boy(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Boy);
class Girl : public Person {
Q_OBJECT
public:
Girl(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Girl);
#endif // PERSON_H
diff --git a/examples/declarative/extending/properties/birthdayparty.h b/examples/declarative/extending/properties/birthdayparty.h
index c4cb536..dd01562 100644
--- a/examples/declarative/extending/properties/birthdayparty.h
+++ b/examples/declarative/extending/properties/birthdayparty.h
@@ -71,7 +71,6 @@ private:
Person *m_celebrant;
QList<Person *> m_guests;
};
-QML_DECLARE_TYPE(BirthdayParty);
// ![3]
#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/extending/properties/person.h b/examples/declarative/extending/properties/person.h
index 860a607..7504d18 100644
--- a/examples/declarative/extending/properties/person.h
+++ b/examples/declarative/extending/properties/person.h
@@ -60,6 +60,5 @@ private:
QString m_name;
int m_shoeSize;
};
-QML_DECLARE_TYPE(Person);
#endif // PERSON_H
diff --git a/examples/declarative/extending/signal/birthdayparty.h b/examples/declarative/extending/signal/birthdayparty.h
index bcdc513..a2b35cd 100644
--- a/examples/declarative/extending/signal/birthdayparty.h
+++ b/examples/declarative/extending/signal/birthdayparty.h
@@ -59,7 +59,6 @@ public:
private:
QDate m_rsvp;
};
-QML_DECLARE_TYPE(BirthdayPartyAttached)
class BirthdayParty : public QObject
{
@@ -89,8 +88,6 @@ private:
Person *m_celebrant;
QList<Person *> m_guests;
};
-
QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
-QML_DECLARE_TYPE(BirthdayParty)
#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/extending/signal/person.h b/examples/declarative/extending/signal/person.h
index 08caebf..7a4b9c3 100644
--- a/examples/declarative/extending/signal/person.h
+++ b/examples/declarative/extending/signal/person.h
@@ -71,7 +71,6 @@ private:
QString m_brand;
qreal m_price;
};
-QML_DECLARE_TYPE(ShoeDescription);
class Person : public QObject {
Q_OBJECT
@@ -88,20 +87,17 @@ private:
QString m_name;
ShoeDescription m_shoe;
};
-QML_DECLARE_TYPE(Person);
class Boy : public Person {
Q_OBJECT
public:
Boy(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Boy);
class Girl : public Person {
Q_OBJECT
public:
Girl(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Girl);
#endif // PERSON_H
diff --git a/examples/declarative/extending/valuesource/birthdayparty.h b/examples/declarative/extending/valuesource/birthdayparty.h
index 819a200..a9b3102 100644
--- a/examples/declarative/extending/valuesource/birthdayparty.h
+++ b/examples/declarative/extending/valuesource/birthdayparty.h
@@ -60,7 +60,6 @@ public:
private:
QDate m_rsvp;
};
-QML_DECLARE_TYPE(BirthdayPartyAttached)
class BirthdayParty : public QObject
{
@@ -95,8 +94,6 @@ private:
Person *m_celebrant;
QList<Person *> m_guests;
};
-
QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
-QML_DECLARE_TYPE(BirthdayParty)
#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/extending/valuesource/happybirthday.h b/examples/declarative/extending/valuesource/happybirthday.h
index b48c012..8548eb8 100644
--- a/examples/declarative/extending/valuesource/happybirthday.h
+++ b/examples/declarative/extending/valuesource/happybirthday.h
@@ -74,7 +74,6 @@ private:
// ![2]
};
// ![2]
-QML_DECLARE_TYPE(HappyBirthday);
#endif // HAPPYBIRTHDAY_H
diff --git a/examples/declarative/extending/valuesource/person.h b/examples/declarative/extending/valuesource/person.h
index 08caebf..7a4b9c3 100644
--- a/examples/declarative/extending/valuesource/person.h
+++ b/examples/declarative/extending/valuesource/person.h
@@ -71,7 +71,6 @@ private:
QString m_brand;
qreal m_price;
};
-QML_DECLARE_TYPE(ShoeDescription);
class Person : public QObject {
Q_OBJECT
@@ -88,20 +87,17 @@ private:
QString m_name;
ShoeDescription m_shoe;
};
-QML_DECLARE_TYPE(Person);
class Boy : public Person {
Q_OBJECT
public:
Boy(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Boy);
class Girl : public Person {
Q_OBJECT
public:
Girl(QObject * parent = 0);
};
-QML_DECLARE_TYPE(Girl);
#endif // PERSON_H
diff --git a/examples/declarative/proxywidgets/proxywidgets.cpp b/examples/declarative/proxywidgets/proxywidgets.cpp
index 47d0cb9..067eb2c 100644
--- a/examples/declarative/proxywidgets/proxywidgets.cpp
+++ b/examples/declarative/proxywidgets/proxywidgets.cpp
@@ -94,6 +94,4 @@ public:
#include "proxywidgets.moc"
-QML_DECLARE_TYPE(MyPushButton)
-
Q_EXPORT_PLUGIN2(proxywidgetsplugin, ProxyWidgetsPlugin);