diff options
Diffstat (limited to 'examples/qml/cppextensions/referenceexamples/binding')
6 files changed, 19 insertions, 19 deletions
diff --git a/examples/qml/cppextensions/referenceexamples/binding/binding.pro b/examples/qml/cppextensions/referenceexamples/binding/binding.pro index 2add33fa47..0379f93ea7 100644 --- a/examples/qml/cppextensions/referenceexamples/binding/binding.pro +++ b/examples/qml/cppextensions/referenceexamples/binding/binding.pro @@ -1,4 +1,4 @@ -QT += declarative +QT += qml SOURCES += main.cpp \ person.cpp \ @@ -9,7 +9,7 @@ HEADERS += person.h \ happybirthdaysong.h RESOURCES += binding.qrc -target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/extending/binding +target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/binding sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS binding.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/extending/binding +sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/binding INSTALLS += target sources diff --git a/examples/qml/cppextensions/referenceexamples/binding/birthdayparty.cpp b/examples/qml/cppextensions/referenceexamples/binding/birthdayparty.cpp index 4f5acdfb75..62499862f0 100644 --- a/examples/qml/cppextensions/referenceexamples/binding/birthdayparty.cpp +++ b/examples/qml/cppextensions/referenceexamples/binding/birthdayparty.cpp @@ -75,9 +75,9 @@ void BirthdayParty::setHost(Person *c) emit hostChanged(); } -QDeclarativeListProperty<Person> BirthdayParty::guests() +QQmlListProperty<Person> BirthdayParty::guests() { - return QDeclarativeListProperty<Person>(this, m_guests); + return QQmlListProperty<Person>(this, m_guests); } int BirthdayParty::guestCount() const diff --git a/examples/qml/cppextensions/referenceexamples/binding/birthdayparty.h b/examples/qml/cppextensions/referenceexamples/binding/birthdayparty.h index 376d107f26..195e9cd9cf 100644 --- a/examples/qml/cppextensions/referenceexamples/binding/birthdayparty.h +++ b/examples/qml/cppextensions/referenceexamples/binding/birthdayparty.h @@ -43,7 +43,7 @@ #include <QObject> #include <QDate> #include <QDebug> -#include <qdeclarative.h> +#include <qqml.h> #include "person.h" class BirthdayPartyAttached : public QObject @@ -69,7 +69,7 @@ class BirthdayParty : public QObject // ![0] Q_PROPERTY(Person *host READ host WRITE setHost NOTIFY hostChanged) // ![0] - Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests) + Q_PROPERTY(QQmlListProperty<Person> guests READ guests) Q_PROPERTY(QString announcement READ announcement WRITE setAnnouncement) Q_CLASSINFO("DefaultProperty", "guests") public: @@ -78,7 +78,7 @@ public: Person *host() const; void setHost(Person *); - QDeclarativeListProperty<Person> guests(); + QQmlListProperty<Person> guests(); int guestCount() const; Person *guest(int) const; diff --git a/examples/qml/cppextensions/referenceexamples/binding/happybirthdaysong.cpp b/examples/qml/cppextensions/referenceexamples/binding/happybirthdaysong.cpp index df4dbec9c4..90220e15ae 100644 --- a/examples/qml/cppextensions/referenceexamples/binding/happybirthdaysong.cpp +++ b/examples/qml/cppextensions/referenceexamples/binding/happybirthdaysong.cpp @@ -49,7 +49,7 @@ HappyBirthdaySong::HappyBirthdaySong(QObject *parent) timer->start(1000); } -void HappyBirthdaySong::setTarget(const QDeclarativeProperty &p) +void HappyBirthdaySong::setTarget(const QQmlProperty &p) { m_target = p; } diff --git a/examples/qml/cppextensions/referenceexamples/binding/happybirthdaysong.h b/examples/qml/cppextensions/referenceexamples/binding/happybirthdaysong.h index a9f3a94544..ace48b2af0 100644 --- a/examples/qml/cppextensions/referenceexamples/binding/happybirthdaysong.h +++ b/examples/qml/cppextensions/referenceexamples/binding/happybirthdaysong.h @@ -40,20 +40,20 @@ #ifndef HAPPYBIRTHDAYSONG_H #define HAPPYBIRTHDAYSONG_H -#include <QDeclarativePropertyValueSource> -#include <QDeclarativeProperty> +#include <QQmlPropertyValueSource> +#include <QQmlProperty> #include <QStringList> -class HappyBirthdaySong : public QObject, public QDeclarativePropertyValueSource +class HappyBirthdaySong : public QObject, public QQmlPropertyValueSource { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) - Q_INTERFACES(QDeclarativePropertyValueSource) + Q_INTERFACES(QQmlPropertyValueSource) public: HappyBirthdaySong(QObject *parent = 0); - virtual void setTarget(const QDeclarativeProperty &); + virtual void setTarget(const QQmlProperty &); QString name() const; void setName(const QString &); @@ -66,7 +66,7 @@ signals: private: int m_line; QStringList m_lyrics; - QDeclarativeProperty m_target; + QQmlProperty m_target; QString m_name; }; diff --git a/examples/qml/cppextensions/referenceexamples/binding/main.cpp b/examples/qml/cppextensions/referenceexamples/binding/main.cpp index 551d24b702..389cb7609b 100644 --- a/examples/qml/cppextensions/referenceexamples/binding/main.cpp +++ b/examples/qml/cppextensions/referenceexamples/binding/main.cpp @@ -38,8 +38,8 @@ ** ****************************************************************************/ #include <QCoreApplication> -#include <QDeclarativeEngine> -#include <QDeclarativeComponent> +#include <QQmlEngine> +#include <QQmlComponent> #include <QDebug> #include "birthdayparty.h" #include "happybirthdaysong.h" @@ -56,8 +56,8 @@ int main(int argc, char ** argv) qmlRegisterType<Boy>("People", 1,0, "Boy"); qmlRegisterType<Girl>("People", 1,0, "Girl"); - QDeclarativeEngine engine; - QDeclarativeComponent component(&engine, QUrl("qrc:example.qml")); + QQmlEngine engine; + QQmlComponent component(&engine, QUrl("qrc:example.qml")); BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create()); if (party && party->host()) { |