summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-06 01:05:50 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-06 01:05:50 (GMT)
commit77a18ae03cfc54ef2d4027b3856d8099de3e1306 (patch)
treed2c153dce0b93876bec4c00db8ed9799621b25e4
parent7c3915c546a12a0118708708952cd0b0e5a7426a (diff)
downloadQt-77a18ae03cfc54ef2d4027b3856d8099de3e1306.zip
Qt-77a18ae03cfc54ef2d4027b3856d8099de3e1306.tar.gz
Qt-77a18ae03cfc54ef2d4027b3856d8099de3e1306.tar.bz2
Remove contacts example. We have much nicer examples of the same thing.
-rw-r--r--examples/declarative/contacts/contacts.pro22
-rw-r--r--examples/declarative/contacts/contacts.qml121
-rw-r--r--examples/declarative/contacts/dummydata/contactModel.qml103
-rw-r--r--examples/declarative/contacts/main.cpp80
4 files changed, 0 insertions, 326 deletions
diff --git a/examples/declarative/contacts/contacts.pro b/examples/declarative/contacts/contacts.pro
deleted file mode 100644
index 18293ee..0000000
--- a/examples/declarative/contacts/contacts.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-TEMPLATE = app
-TARGET = contacts
-
-MOC_DIR = .moc
-OBJECTS_DIR = .obj
-
-QT += declarative script sql
-
-unix {
- sqlitedb.output = ${QMAKE_FILE_BASE}.sqlite
- sqlitedb.commands = rm -f ${QMAKE_FILE_OUT}; if which sqlite3 ; then sqlite3 ${QMAKE_FILE_OUT} < ${QMAKE_FILE_NAME} ; fi
- sqlitedb.input = SQL_SOURCES
- sqlitedb.CONFIG += no_link target_predeps
-
- QMAKE_EXTRA_COMPILERS += sqlitedb
- QMAKE_EXTRA_TARGETS = sqlitedb
-}
-
-SQL_SOURCES += data/contacts.sql
-
-SOURCES += main.cpp
-
diff --git a/examples/declarative/contacts/contacts.qml b/examples/declarative/contacts/contacts.qml
deleted file mode 100644
index f9901ed..0000000
--- a/examples/declarative/contacts/contacts.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-Rect {
- id: page
- width: 320
- height: 480
- color: "white"
- resources: [
- Component {
- id: contactDelegate
- Rect {
- id: wrapper
- x: 20
- width: List.width-40
- color: "#FEFFEE"
- pen.color: "#FFBE4F"
- radius: 5
- filter: Shadow {
- xOffset: 5
- yOffset: 5
- }
- MouseRegion {
- id: pageMouse
- anchors.fill: parent
- onClicked: { if (wrapper.state == 'Details') { wrapper.state = '';} else {wrapper.state = 'Details';} }
- }
- Image {
- id: portraitPic
- source: portrait
- x: 10
- y: 10
- }
- Text {
- id: name
- text: firstName + ' ' + lastName
- anchors.left: portraitPic.right
- anchors.leftMargin: 10
- anchors.top: portraitPic.top
- anchors.right: wrapper.right
- anchors.rightMargin: 10
- font.family: "Comic Sans MS"
- font.bold: true
- font.size: 11
- }
- VerticalLayout {
- id: email_layout
- anchors.left: name.left
- anchors.top: name.bottom
- anchors.topMargin: 10
- Repeater {
- id: email_list
- dataSource: emails
- Component {
- Text {
- text: modelData
- height: 18
- font.italic: true
- color: "midnightblue"
- }
- }
- }
- }
- height: Math.max(email_layout.height + name.height + 25, portraitPic.height+20)
- states: [
- State {
- name: "Details"
- SetProperty {
- target: wrapper
- property: "color"
- value: "white"
- }
- SetProperty {
- target: wrapper
- property: "x"
- value: 0
- }
- SetProperty {
- target: wrapper
- property: "height"
- value: List.height
- }
- SetProperty {
- target: wrapper
- property: "width"
- value: List.width
- }
- SetProperty {
- target: wrapper.ListView.view
- property: "yPosition"
- value: wrapper.y
- }
- SetProperty {
- target: wrapper.ListView.view
- property: "locked"
- value: 1
- }
- }
- ]
- transitions: [
- Transition {
- ParallelAnimation {
- ColorAnimation {
- duration: 500
- }
- NumericAnimation {
- duration: 150
- properties: "x,yPosition,height,width"
- }
- }
- }
- ]
- }
- }
- ]
- ListView {
- id: List
- model: contactModel
- width: 320
- height: 480
- clip: true
- delegate: contactDelegate
- }
-}
diff --git a/examples/declarative/contacts/dummydata/contactModel.qml b/examples/declarative/contacts/dummydata/contactModel.qml
deleted file mode 100644
index 53f6b7b..0000000
--- a/examples/declarative/contacts/dummydata/contactModel.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-ListModel {
- ListElement {
- firstName: "Aaron"
- lastName: "Kennedy"
- portrait: "contact.png"
- emails: [
- ListElement { address: "akennedy@trolltech.com" },
- ListElement { address: "aaron.kennedy@trolltech.com" }
- ]
- }
- ListElement {
- firstName: "ListElement"
- lastName: 1
- portrait: "contact.png"
- }
- ListElement {
- firstName: "ListElement"
- lastName: 2
- portrait: "contact.png"
- }
- ListElement {
- firstName: "ListElement"
- lastName: 3
- portrait: "contact.png"
- }
- ListElement {
- firstName: "ListElement"
- lastName: 4
- portrait: "contact.png"
- }
- ListElement {
- firstName: "ListElement"
- lastName: 5
- portrait: "contact.png"
- }
- ListElement {
- firstName: "ListElement"
- lastName: 6
- portrait: "contact.png"
- }
- ListElement {
- firstName: "ListElement"
- lastName: 7
- portrait: "contact.png"
- }
- ListElement {
- firstName: "ListElement"
- lastName: 8
- portrait: "contact.png"
- }
- ListElement {
- firstName: "ListElement"
- lastName: 9
- portrait: "contact.png"
- }
- ListElement {
- firstName: "Alan"
- lastName: "Alpert"
- portrait: "contact.png"
- }
- ListElement {
- firstName: "Betty"
- lastName: "Boo"
- portrait: "contact.png"
- }
- ListElement {
- firstName: "Foo"
- lastName: "Bar"
- portrait: "contact.png"
- }
- ListElement {
- firstName: "Marius"
- lastName: "Bugge Monsen"
- portrait: "contact.png"
- }
- ListElement {
- firstName: "Martin"
- lastName: "Jones"
- portrait: "contact.png"
- emails: [
- ListElement { address: "mjones@trolltech.com" },
- ListElement { address: "martin.jones@trolltech.com" }
- ]
- }
- ListElement {
- firstName: "Michael"
- lastName: "Brasser"
- portrait: "contact.png"
- emails: ListElement {
- address: "mbrasser@trolltech.com"
- }
- }
- ListElement {
- firstName: "Yann"
- lastName: "Bodson"
- portrait: "contact.png"
- }
- ListElement {
- firstName: "Yogi"
- lastName: "Bear"
- portrait: "contact.png"
- }
-}
diff --git a/examples/declarative/contacts/main.cpp b/examples/declarative/contacts/main.cpp
deleted file mode 100644
index bda6565..0000000
--- a/examples/declarative/contacts/main.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "qml.h"
-#include <qfxview.h>
-
-#include <QWidget>
-#include <QApplication>
-#include <QFile>
-#include <QTime>
-#include <QVBoxLayout>
-
-const char *defaultFileName("contacts.qml");
-
-class Contacts : public QWidget
-{
-Q_OBJECT
-public:
- Contacts(const QString &fileName, int = 240, int = 320, QWidget *parent=0, Qt::WindowFlags flags=0);
-
-public slots:
- void sceneResized(QSize size)
- {
- if(size.width() > 0 && size.height() > 0)
- canvas->setFixedSize(size.width(), size.height());
- }
-
-private:
- QFxView *canvas;
-};
-
-Contacts::Contacts(const QString &fileName, int width, int height, QWidget *parent, Qt::WindowFlags flags)
-: QWidget(parent, flags), canvas(0)
-{
- setAttribute(Qt::WA_OpaquePaintEvent);
- setAttribute(Qt::WA_NoSystemBackground);
-
- QVBoxLayout *vbox = new QVBoxLayout;
- vbox->setMargin(0);
- setLayout(vbox);
-
- canvas = new QFxView(this);
- QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize)));
- canvas->setFixedSize(width, height);
- vbox->addWidget(canvas);
-
- QFile file(fileName);
- file.open(QFile::ReadOnly);
- QString qml = file.readAll();
- canvas->setQml(qml, fileName);
-
- canvas->execute();
-}
-
-int main(int argc, char ** argv)
-{
- QApplication app(argc, argv);
-
- bool frameless = false;
-
- int width = 240;
- int height = 320;
-
- QString fileName;
- for (int i = 1; i < argc; ++i) {
- QString arg = argv[i];
- if (arg == "-frameless") {
- frameless = true;
- } else {
- fileName = arg;
- break;
- }
- }
- if (fileName.isEmpty())
- fileName = QLatin1String(defaultFileName);
-
- Contacts contacts(fileName, width, height, 0, frameless ? Qt::FramelessWindowHint : Qt::Widget);
- contacts.show();
-
- return app.exec();
-}
-
-#include "main.moc"