aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/qtquick1/cppextensions/referenceexamples/attached
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/qtquick1/cppextensions/referenceexamples/attached')
-rw-r--r--examples/declarative/qtquick1/cppextensions/referenceexamples/attached/attached.pro17
-rw-r--r--examples/declarative/qtquick1/cppextensions/referenceexamples/attached/attached.qrc5
-rw-r--r--examples/declarative/qtquick1/cppextensions/referenceexamples/attached/birthdayparty.cpp91
-rw-r--r--examples/declarative/qtquick1/cppextensions/referenceexamples/attached/birthdayparty.h86
-rw-r--r--examples/declarative/qtquick1/cppextensions/referenceexamples/attached/example.qml71
-rw-r--r--examples/declarative/qtquick1/cppextensions/referenceexamples/attached/main.cpp90
-rw-r--r--examples/declarative/qtquick1/cppextensions/referenceexamples/attached/person.cpp118
-rw-r--r--examples/declarative/qtquick1/cppextensions/referenceexamples/attached/person.h105
8 files changed, 0 insertions, 583 deletions
diff --git a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/attached.pro b/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/attached.pro
deleted file mode 100644
index 3843528c50..0000000000
--- a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/attached.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = attached
-DEPENDPATH += .
-INCLUDEPATH += .
-QT += declarative
-
-# Input
-SOURCES += main.cpp \
- person.cpp \
- birthdayparty.cpp
-HEADERS += person.h \
- birthdayparty.h
-RESOURCES += attached.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/attached
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS attached.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/attached
-INSTALLS += target sources
diff --git a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/attached.qrc b/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/attached.qrc
deleted file mode 100644
index e2fa01d5e7..0000000000
--- a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/attached.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>example.qml</file>
-</qresource>
-</RCC>
diff --git a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/birthdayparty.cpp b/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/birthdayparty.cpp
deleted file mode 100644
index 5916d0389d..0000000000
--- a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/birthdayparty.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "birthdayparty.h"
-
-BirthdayPartyAttached::BirthdayPartyAttached(QObject *object)
-: QObject(object)
-{
-}
-
-QDate BirthdayPartyAttached::rsvp() const
-{
- return m_rsvp;
-}
-
-void BirthdayPartyAttached::setRsvp(const QDate &d)
-{
- m_rsvp = d;
-}
-
-BirthdayParty::BirthdayParty(QObject *parent)
-: QObject(parent), m_host(0)
-{
-}
-
-Person *BirthdayParty::host() const
-{
- return m_host;
-}
-
-void BirthdayParty::setHost(Person *c)
-{
- m_host = c;
-}
-
-QDeclarativeListProperty<Person> BirthdayParty::guests()
-{
- return QDeclarativeListProperty<Person>(this, m_guests);
-}
-
-int BirthdayParty::guestCount() const
-{
- return m_guests.count();
-}
-
-Person *BirthdayParty::guest(int index) const
-{
- return m_guests.at(index);
-}
-
-BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)
-{
- return new BirthdayPartyAttached(object);
-}
-
diff --git a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/birthdayparty.h b/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/birthdayparty.h
deleted file mode 100644
index 02e9593b8b..0000000000
--- a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/birthdayparty.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef BIRTHDAYPARTY_H
-#define BIRTHDAYPARTY_H
-
-#include <QObject>
-#include <QDate>
-#include <qdeclarative.h>
-#include "person.h"
-
-class BirthdayPartyAttached : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp)
-public:
- BirthdayPartyAttached(QObject *object);
-
- QDate rsvp() const;
- void setRsvp(const QDate &);
-
-private:
- QDate m_rsvp;
-};
-
-class BirthdayParty : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(Person *host READ host WRITE setHost)
- Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
- Q_CLASSINFO("DefaultProperty", "guests")
-public:
- BirthdayParty(QObject *parent = 0);
-
- Person *host() const;
- void setHost(Person *);
-
- QDeclarativeListProperty<Person> guests();
- int guestCount() const;
- Person *guest(int) const;
-
- static BirthdayPartyAttached *qmlAttachedProperties(QObject *);
-private:
- Person *m_host;
- QList<Person *> m_guests;
-};
-
-QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
-
-#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/example.qml b/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/example.qml
deleted file mode 100644
index d09d451f24..0000000000
--- a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/example.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import People 1.0
-
-BirthdayParty {
- host: Boy {
- name: "Bob Jones"
- shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 }
- }
-
- // ![1]
- Boy {
- name: "Leo Hodges"
- shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 }
-
- BirthdayParty.rsvp: "2009-07-06"
- }
- // ![1]
- Boy {
- name: "Jack Smith"
- shoe { size: 8; color: "blue"; brand: "Puma"; price: 19.95 }
- }
- Girl {
- name: "Anne Brown"
- shoe.size: 7
- shoe.color: "red"
- shoe.brand: "Marc Jacobs"
- shoe.price: 699.99
-
- BirthdayParty.rsvp: "2009-07-01"
- }
-}
-
diff --git a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/main.cpp b/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/main.cpp
deleted file mode 100644
index b92614a15d..0000000000
--- a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/main.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <QCoreApplication>
-#include <QDeclarativeEngine>
-#include <QDeclarativeComponent>
-#include <QDebug>
-#include "birthdayparty.h"
-#include "person.h"
-
-int main(int argc, char ** argv)
-{
- QCoreApplication app(argc, argv);
-
- qmlRegisterType<BirthdayPartyAttached>();
- qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
- qmlRegisterType<ShoeDescription>();
- qmlRegisterType<Person>();
- qmlRegisterType<Boy>("People", 1,0, "Boy");
- qmlRegisterType<Girl>("People", 1,0, "Girl");
-
- QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
- BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
-
- if (party && party->host()) {
- qWarning() << party->host()->name() << "is having a birthday!";
-
- if (qobject_cast<Boy *>(party->host()))
- qWarning() << "He is inviting:";
- else
- qWarning() << "She is inviting:";
-
- for (int ii = 0; ii < party->guestCount(); ++ii) {
- Person *guest = party->guest(ii);
-
- QDate rsvpDate;
- QObject *attached =
- qmlAttachedPropertiesObject<BirthdayParty>(guest, false);
- if (attached)
- rsvpDate = attached->property("rsvp").toDate();
-
- if (rsvpDate.isNull())
- qWarning() << " " << guest->name() << "RSVP date: Hasn't RSVP'd";
- else
- qWarning() << " " << guest->name() << "RSVP date:" << qPrintable(rsvpDate.toString());
- }
-
- } else {
- qWarning() << component.errors();
- }
-
- return 0;
-}
diff --git a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/person.cpp b/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/person.cpp
deleted file mode 100644
index 7afcdc6ca6..0000000000
--- a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/person.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "person.h"
-
-ShoeDescription::ShoeDescription(QObject *parent)
-: QObject(parent), m_size(0), m_price(0)
-{
-}
-
-int ShoeDescription::size() const
-{
- return m_size;
-}
-
-void ShoeDescription::setSize(int s)
-{
- m_size = s;
-}
-
-QColor ShoeDescription::color() const
-{
- return m_color;
-}
-
-void ShoeDescription::setColor(const QColor &c)
-{
- m_color = c;
-}
-
-QString ShoeDescription::brand() const
-{
- return m_brand;
-}
-
-void ShoeDescription::setBrand(const QString &b)
-{
- m_brand = b;
-}
-
-qreal ShoeDescription::price() const
-{
- return m_price;
-}
-
-void ShoeDescription::setPrice(qreal p)
-{
- m_price = p;
-}
-
-Person::Person(QObject *parent)
-: QObject(parent)
-{
-}
-
-QString Person::name() const
-{
- return m_name;
-}
-
-void Person::setName(const QString &n)
-{
- m_name = n;
-}
-
-ShoeDescription *Person::shoe()
-{
- return &m_shoe;
-}
-
-
-Boy::Boy(QObject * parent)
-: Person(parent)
-{
-}
-
-
-Girl::Girl(QObject * parent)
-: Person(parent)
-{
-}
-
diff --git a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/person.h b/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/person.h
deleted file mode 100644
index 032eca3c17..0000000000
--- a/examples/declarative/qtquick1/cppextensions/referenceexamples/attached/person.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef PERSON_H
-#define PERSON_H
-
-#include <QObject>
-#include <QColor>
-
-class ShoeDescription : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(int size READ size WRITE setSize)
- Q_PROPERTY(QColor color READ color WRITE setColor)
- Q_PROPERTY(QString brand READ brand WRITE setBrand)
- Q_PROPERTY(qreal price READ price WRITE setPrice)
-public:
- ShoeDescription(QObject *parent = 0);
-
- int size() const;
- void setSize(int);
-
- QColor color() const;
- void setColor(const QColor &);
-
- QString brand() const;
- void setBrand(const QString &);
-
- qreal price() const;
- void setPrice(qreal);
-private:
- int m_size;
- QColor m_color;
- QString m_brand;
- qreal m_price;
-};
-
-class Person : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(ShoeDescription *shoe READ shoe)
-public:
- Person(QObject *parent = 0);
-
- QString name() const;
- void setName(const QString &);
-
- ShoeDescription *shoe();
-private:
- QString m_name;
- ShoeDescription m_shoe;
-};
-
-class Boy : public Person
-{
- Q_OBJECT
-public:
- Boy(QObject * parent = 0);
-};
-
-class Girl : public Person
-{
- Q_OBJECT
-public:
- Girl(QObject * parent = 0);
-};
-
-#endif // PERSON_H