aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/cppextensions/referenceexamples/default
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/cppextensions/referenceexamples/default')
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp71
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h70
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/default.pro13
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/default.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/example.qml54
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/main.cpp75
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/person.cpp78
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/person.h77
8 files changed, 0 insertions, 443 deletions
diff --git a/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp
deleted file mode 100644
index 1859ca9461..0000000000
--- a/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp
+++ /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$
-**
-****************************************************************************/
-#include "birthdayparty.h"
-
-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);
-}
-
diff --git a/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h
deleted file mode 100644
index cfca6689db..0000000000
--- a/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h
+++ /dev/null
@@ -1,70 +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 <QDeclarativeListProperty>
-#include "person.h"
-
-// ![0]
-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;
-
-private:
- Person *m_host;
- QList<Person *> m_guests;
-};
-// ![0]
-
-#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/default/default.pro b/examples/declarative/cppextensions/referenceexamples/default/default.pro
deleted file mode 100644
index 6533cdd7d3..0000000000
--- a/examples/declarative/cppextensions/referenceexamples/default/default.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-QT += declarative
-
-SOURCES += main.cpp \
- person.cpp \
- birthdayparty.cpp
-HEADERS += person.h \
- birthdayparty.h
-RESOURCES += default.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/extending/default
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS default.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/extending/default
-INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/default/default.qrc b/examples/declarative/cppextensions/referenceexamples/default/default.qrc
deleted file mode 100644
index e2fa01d5e7..0000000000
--- a/examples/declarative/cppextensions/referenceexamples/default/default.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/cppextensions/referenceexamples/default/example.qml b/examples/declarative/cppextensions/referenceexamples/default/example.qml
deleted file mode 100644
index 9ef24b59b7..0000000000
--- a/examples/declarative/cppextensions/referenceexamples/default/example.qml
+++ /dev/null
@@ -1,54 +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
-
-// ![0]
-BirthdayParty {
- host: Boy {
- name: "Bob Jones"
- shoeSize: 12
- }
-
- Boy { name: "Leo Hodges" }
- Boy { name: "Jack Smith" }
- Girl { name: "Anne Brown" }
-}
-// ![0]
diff --git a/examples/declarative/cppextensions/referenceexamples/default/main.cpp b/examples/declarative/cppextensions/referenceexamples/default/main.cpp
deleted file mode 100644
index 3a03279129..0000000000
--- a/examples/declarative/cppextensions/referenceexamples/default/main.cpp
+++ /dev/null
@@ -1,75 +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<BirthdayParty>("People", 1,0, "BirthdayParty");
- 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)
- qWarning() << " " << party->guest(ii)->name();
- } else {
- qWarning() << component.errors();
- }
-
- return 0;
-}
diff --git a/examples/declarative/cppextensions/referenceexamples/default/person.cpp b/examples/declarative/cppextensions/referenceexamples/default/person.cpp
deleted file mode 100644
index 5a615a1ecd..0000000000
--- a/examples/declarative/cppextensions/referenceexamples/default/person.cpp
+++ /dev/null
@@ -1,78 +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"
-
-Person::Person(QObject *parent)
-: QObject(parent), m_shoeSize(0)
-{
-}
-
-QString Person::name() const
-{
- return m_name;
-}
-
-void Person::setName(const QString &n)
-{
- m_name = n;
-}
-
-int Person::shoeSize() const
-{
- return m_shoeSize;
-}
-
-void Person::setShoeSize(int s)
-{
- m_shoeSize = s;
-}
-
-
-Boy::Boy(QObject * parent)
-: Person(parent)
-{
-}
-
-
-Girl::Girl(QObject * parent)
-: Person(parent)
-{
-}
-
diff --git a/examples/declarative/cppextensions/referenceexamples/default/person.h b/examples/declarative/cppextensions/referenceexamples/default/person.h
deleted file mode 100644
index d85672798c..0000000000
--- a/examples/declarative/cppextensions/referenceexamples/default/person.h
+++ /dev/null
@@ -1,77 +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>
-
-class Person : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize)
-public:
- Person(QObject *parent = 0);
-
- QString name() const;
- void setName(const QString &);
-
- int shoeSize() const;
- void setShoeSize(int);
-private:
- QString m_name;
- int m_shoeSize;
-};
-
-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