From 1b06776be339e1d27de69c74928444917736f8c1 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 15 Jan 2014 14:53:20 +0100 Subject: Remove examples written by Noam which are under the Nokia license. I'll write new examples from scratch using the proper license. Change-Id: If13e57cf8b19cf45178b6fccace59cb56410d84e Reviewed-by: Simon Hausmann --- examples/examples.pro | 6 --- examples/hybridshell/hybridshell.pro | 17 ------- examples/hybridshell/index.html | 82 ------------------------------ examples/hybridshell/main.cpp | 51 ------------------- examples/hybridshell/main.qml | 83 ------------------------------ examples/hybridshell/resources.qrc | 6 --- examples/hybridshell/shell.cpp | 70 -------------------------- examples/hybridshell/shell.h | 67 ------------------------- examples/qmlapp/index.html | 36 ------------- examples/qmlapp/qmlapp.qml | 97 ------------------------------------ examples/qtobject/index.html | 89 --------------------------------- examples/qtobject/main.cpp | 52 ------------------- examples/qtobject/main.qml | 78 ----------------------------- examples/qtobject/qtobject.pro | 17 ------- examples/qtobject/resources.qrc | 6 --- examples/qtobject/testobject.cpp | 49 ------------------ examples/qtobject/testobject.h | 53 -------------------- 17 files changed, 859 deletions(-) delete mode 100644 examples/hybridshell/hybridshell.pro delete mode 100644 examples/hybridshell/index.html delete mode 100644 examples/hybridshell/main.cpp delete mode 100644 examples/hybridshell/main.qml delete mode 100644 examples/hybridshell/resources.qrc delete mode 100644 examples/hybridshell/shell.cpp delete mode 100644 examples/hybridshell/shell.h delete mode 100644 examples/qmlapp/index.html delete mode 100644 examples/qmlapp/qmlapp.qml delete mode 100644 examples/qtobject/index.html delete mode 100644 examples/qtobject/main.cpp delete mode 100644 examples/qtobject/main.qml delete mode 100644 examples/qtobject/qtobject.pro delete mode 100644 examples/qtobject/resources.qrc delete mode 100644 examples/qtobject/testobject.cpp delete mode 100644 examples/qtobject/testobject.h (limited to 'examples') diff --git a/examples/examples.pro b/examples/examples.pro index 554ec11..114d0fb 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,9 +1,3 @@ TEMPLATE = subdirs SUBDIRS += standalone - -qtHaveModule(quick) { - SUBDIRS += \ - hybridshell \ - qtobject -} diff --git a/examples/hybridshell/hybridshell.pro b/examples/hybridshell/hybridshell.pro deleted file mode 100644 index 4ff38db..0000000 --- a/examples/hybridshell/hybridshell.pro +++ /dev/null @@ -1,17 +0,0 @@ -QT += qml quick - -CONFIG += warn_on - -SOURCES += \ - main.cpp \ - shell.cpp - -HEADERS += \ - shell.h - -RESOURCES += \ - resources.qrc - -OTHER_FILES += \ - main.qml \ - index.html diff --git a/examples/hybridshell/index.html b/examples/hybridshell/index.html deleted file mode 100644 index 91c447a..0000000 --- a/examples/hybridshell/index.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - QML/HTML Hybrid Shell - - - - - -
- - -
- - diff --git a/examples/hybridshell/main.cpp b/examples/hybridshell/main.cpp deleted file mode 100644 index 8c7e9b0..0000000 --- a/examples/hybridshell/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QWebChannel module on Qt labs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include -#include - -#include "shell.h" - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc, argv); - qmlRegisterType("QtWebChannel.Examples", 1, 0, "HybridShell"); - - QQuickView viewer; - viewer.setSource(QStringLiteral("qrc:/main.qml")); - viewer.show(); - - return app.exec(); -} diff --git a/examples/hybridshell/main.qml b/examples/hybridshell/main.qml deleted file mode 100644 index 24dc729..0000000 --- a/examples/hybridshell/main.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QWebChannel module on Qt labs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -import QtWebChannel 1.0 -import QtWebChannel.Examples 1.0 -import QtWebKit 3.0 -import QtWebKit.experimental 1.0 - -Rectangle { - HybridShell { - id: shell - onStdoutData: { - console.log(data); - webChannel.sendMessage("stdout", data); - } - onStderrData: { - console.error(data); - webChannel.sendMessage("stderr", data); - } - } - - WebChannel { - id: webChannel - onRawMessageReceived: { - shell.exec(JSON.parse(rawMessage).data); - } - - onInitialized: { - shell.start() - webView.url = "qrc:/index.html?webChannelBaseUrl=" + webChannel.baseUrl; - } - } - - width: 480 - height: 600 - - WebView { - id: webView - anchors.fill: parent - url: "about:blank" - experimental.preferences.developerExtrasEnabled: true - } -} diff --git a/examples/hybridshell/resources.qrc b/examples/hybridshell/resources.qrc deleted file mode 100644 index b93a6b2..0000000 --- a/examples/hybridshell/resources.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - index.html - main.qml - - diff --git a/examples/hybridshell/shell.cpp b/examples/hybridshell/shell.cpp deleted file mode 100644 index b15c2e8..0000000 --- a/examples/hybridshell/shell.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QWebChannel module on Qt labs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "shell.h" -#include - -Shell::Shell(QObject *parent) : - QObject(parent) -{ - connect(&process, SIGNAL(readyReadStandardError()), this, SLOT(handleOutput())); - connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(handleOutput())); -} - -void Shell::start() -{ - process.start("sh"); -} - -void Shell::exec(const QString& data) -{ - process.write(data.toUtf8()); - process.write("\n"); -} - -void Shell::handleOutput() -{ - QByteArray data = process.readAllStandardOutput(); - if (!data.isEmpty()) - emit stdoutData(data); - data = process.readAllStandardError(); - if (!data.isEmpty()) - emit stderrData(data); -} diff --git a/examples/hybridshell/shell.h b/examples/hybridshell/shell.h deleted file mode 100644 index c2313fc..0000000 --- a/examples/hybridshell/shell.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QWebChannel module on Qt labs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef SHELL_H -#define SHELL_H - -#include -#include -class Shell : public QObject -{ - Q_OBJECT -public: - explicit Shell(QObject *parent = 0); - -signals: - void stdoutData(const QString& data); - void stderrData(const QString& data); - -public slots: - void start(); - void exec(const QString& data); - -private slots: - void handleOutput(); - -private: - QProcess process; -}; - -#endif // SHELL_H diff --git a/examples/qmlapp/index.html b/examples/qmlapp/index.html deleted file mode 100644 index b3b8bb1..0000000 --- a/examples/qmlapp/index.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - Go -
- - diff --git a/examples/qmlapp/qmlapp.qml b/examples/qmlapp/qmlapp.qml deleted file mode 100644 index 35bce57..0000000 --- a/examples/qmlapp/qmlapp.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QWebChannel module on Qt labs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -import QtWebChannel 1.0 -import QtWebKit 3.0 -import QtWebKit.experimental 1.0 - -Rectangle { - width: 500 - height: 600 - WebChannel { - id: webChannel - - onRawMessageReceived: { - console.log(rawMessage); - var msg = JSON.parse(rawMessage); - editor.text += msg.data.a + "\n"; - sendMessage("b", "This is a response from QML"); - } - - onInitialized: { - console.log(baseUrl); - } - } - - TextEdit { - text: "enter data here\n" - id: editor - anchors.top: parent.top - width: parent.width - height: 400 - } - - Text { - id: txt - anchors.top: editor.bottom - width: parent.width - height: 100 - text: "Click to send message to HTML client" - MouseArea { - anchors.fill: parent - onClicked: { - webChannel.sendMessage("foobar", editor.text); - } - } - } - - WebView { - id: webView - width: parent.width - anchors.top: txt.bottom - height: 100 - url: "index.html?webChannelBaseUrl=" + webChannel.baseUrl; - experimental.preferences.developerExtrasEnabled: true - } - -} diff --git a/examples/qtobject/index.html b/examples/qtobject/index.html deleted file mode 100644 index 4987116..0000000 --- a/examples/qtobject/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - -
-
- Create New Object. Note: Only created objects can be deleted, the initial object will stay.
- - - diff --git a/examples/qtobject/main.cpp b/examples/qtobject/main.cpp deleted file mode 100644 index 4436862..0000000 --- a/examples/qtobject/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QWebChannel module on Qt labs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include -#include - -#include "testobject.h" - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc, argv); - qmlRegisterType("QtWebChannel.Examples", 1, 0, "TestObjectFactory"); - qmlRegisterType("QtWebChannel.Examples", 1, 0, "TestObject"); - - QQuickView viewer; - viewer.setSource(QStringLiteral("qrc:/main.qml")); - viewer.show(); - - return app.exec(); -} diff --git a/examples/qtobject/main.qml b/examples/qtobject/main.qml deleted file mode 100644 index d8ec54b..0000000 --- a/examples/qtobject/main.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QWebChannel module on Qt labs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -import QtWebChannel 1.0 -import QtWebChannel.Examples 1.0 -import QtWebKit 3.0 -import QtWebKit.experimental 1.0 - -Rectangle { - TestObjectFactory { - id: factory - WebChannel.id: "testObjectFactory" - } - TestObject { - id: testObject - objectName: "initialTestObject" - WebChannel.id: objectName - } - - WebChannel { - id: webChannel - - registeredObjects: [ - factory, - testObject - ]; - } - - width: 480 - height: 800 - - WebView { - id: webView - url: webChannel.baseUrl ? ("qrc:/index.html?webChannelBaseUrl=" + webChannel.baseUrl) : "about:blank"; - anchors.fill: parent - experimental.preferences.developerExtrasEnabled: true - } -} diff --git a/examples/qtobject/qtobject.pro b/examples/qtobject/qtobject.pro deleted file mode 100644 index 557603a..0000000 --- a/examples/qtobject/qtobject.pro +++ /dev/null @@ -1,17 +0,0 @@ -QT += qml quick - -CONFIG += warn_on - -SOURCES += \ - main.cpp \ - testobject.cpp - -HEADERS += \ - testobject.h - -RESOURCES += \ - resources.qrc - -OTHER_FILES += \ - main.qml \ - index.html diff --git a/examples/qtobject/resources.qrc b/examples/qtobject/resources.qrc deleted file mode 100644 index b93a6b2..0000000 --- a/examples/qtobject/resources.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - index.html - main.qml - - diff --git a/examples/qtobject/testobject.cpp b/examples/qtobject/testobject.cpp deleted file mode 100644 index 9d47e72..0000000 --- a/examples/qtobject/testobject.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "testobject.h" - -TestObject::TestObject(QObject *parent) : - QObject(parent) - , p1("Hello World") -{ - connect(&timer, SIGNAL(timeout()), this, SIGNAL(timeout())); -} - -QString TestObject::debugMe(const QString& data) -{ - qWarning() << data; - return QString("OK from %1: %2").arg(objectName()).arg(data); -} - -void TestObject::setProp1(const QString& s) -{ - p1 = s; - qWarning() << __func__ << p1; - emit sig1(1, 0.5, QStringLiteral("asdf")); - emit prop1Changed(); -} - -void TestObject::setProp2(const QString& s) -{ - p2 = s; - qWarning() << __func__ << p2; - emit sig2(); - emit prop2Changed(s); -} - -QString TestObject::manyArgs(int a, float b, const QString& c) const -{ - qDebug() << a << b << c; - return c; -} - -TestObjectFactory::TestObjectFactory(QObject* parent) - : QObject(parent) -{ - -} - -TestObject* TestObjectFactory::createObject(const QString& name) -{ - TestObject* ret = new TestObject(this); - ret->setObjectName(name); - return ret; -} diff --git a/examples/qtobject/testobject.h b/examples/qtobject/testobject.h deleted file mode 100644 index 72e57bb..0000000 --- a/examples/qtobject/testobject.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef TESTOBJECT_H -#define TESTOBJECT_H - -#include -#include -#include - -class TestObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString prop1 READ prop1 WRITE setProp1 NOTIFY prop1Changed) - Q_PROPERTY(QString prop2 READ prop2 WRITE setProp2 NOTIFY prop2Changed) -public: - explicit TestObject(QObject *parent = 0); - QString prop1() const { return "p1" + p1 + objectName(); } - void setProp1(const QString& s); - - QString prop2() const { return "p2" + p2 + objectName(); } - void setProp2(const QString& s); - -signals: - void timeout(); - void sig1(int a, float b, const QString& c); - void sig2(); - void prop1Changed(); - void prop2Changed(const QString& newValue); - -public slots: - void startTimer(int millis) - { - timer.start(millis); - } - - QString debugMe(const QString& data); - - QString manyArgs(int a, float b, const QString& c) const; - -private: - QString p1; - QString p2; - QTimer timer; -}; - -class TestObjectFactory : public QObject -{ - Q_OBJECT -public: - explicit TestObjectFactory(QObject* parent = 0); - - Q_INVOKABLE TestObject* createObject(const QString& name); -}; - -#endif // TESTOBJECT_H -- cgit v1.2.1