aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/qtquick1/cppextensions/qwidgets
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/qtquick1/cppextensions/qwidgets')
-rw-r--r--examples/declarative/qtquick1/cppextensions/qwidgets/QWidgets/qmldir1
-rw-r--r--examples/declarative/qtquick1/cppextensions/qwidgets/README6
-rw-r--r--examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.cpp96
-rw-r--r--examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.pro14
-rw-r--r--examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.qml110
-rw-r--r--examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.qmlproject14
6 files changed, 0 insertions, 241 deletions
diff --git a/examples/declarative/qtquick1/cppextensions/qwidgets/QWidgets/qmldir b/examples/declarative/qtquick1/cppextensions/qwidgets/QWidgets/qmldir
deleted file mode 100644
index a7c1d95c76..0000000000
--- a/examples/declarative/qtquick1/cppextensions/qwidgets/QWidgets/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin qmlqwidgetsplugin
diff --git a/examples/declarative/qtquick1/cppextensions/qwidgets/README b/examples/declarative/qtquick1/cppextensions/qwidgets/README
deleted file mode 100644
index e2f1b2ba56..0000000000
--- a/examples/declarative/qtquick1/cppextensions/qwidgets/README
+++ /dev/null
@@ -1,6 +0,0 @@
-This example shows how to embed QWidget-based objects into QML.
-
-To run:
-
- make install
- qml qwidgets.qml
diff --git a/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.cpp b/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.cpp
deleted file mode 100644
index 2230c97f39..0000000000
--- a/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.cpp
+++ /dev/null
@@ -1,96 +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 <QtDeclarative/QDeclarativeExtensionPlugin>
-#include <QtDeclarative/qdeclarative.h>
-#include <QtWidgets/QGraphicsProxyWidget>
-#include <QtWidgets/QPushButton>
-#include <QtCore/QDebug>
-
-class MyPushButton : public QGraphicsProxyWidget
-{
- Q_OBJECT
- Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
-
-public:
- MyPushButton(QGraphicsItem* parent = 0)
- : QGraphicsProxyWidget(parent)
- {
- widget = new QPushButton("MyPushButton");
- widget->setAttribute(Qt::WA_NoSystemBackground);
- setWidget(widget);
-
- QObject::connect(widget, SIGNAL(clicked(bool)), this, SIGNAL(clicked(bool)));
- }
-
- QString text() const
- {
- return widget->text();
- }
-
- void setText(const QString& text)
- {
- if (text != widget->text()) {
- widget->setText(text);
- emit textChanged();
- }
- }
-
-Q_SIGNALS:
- void clicked(bool);
- void textChanged();
-
-private:
- QPushButton *widget;
-};
-
-class QWidgetsPlugin : public QDeclarativeExtensionPlugin
-{
- Q_OBJECT
-public:
- void registerTypes(const char *uri)
- {
- qmlRegisterType<MyPushButton>(uri, 1, 0, "MyPushButton");
- }
-};
-
-#include "qwidgets.moc"
-
-Q_EXPORT_PLUGIN2(qmlqwidgetsplugin, QWidgetsPlugin);
diff --git a/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.pro
deleted file mode 100644
index 292ac2c5f5..0000000000
--- a/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TEMPLATE = lib
-CONFIG += qt plugin
-QT += declarative
-
-DESTDIR = QWidgets
-TARGET = qmlqwidgetsplugin
-
-SOURCES += qwidgets.cpp
-
-sources.files += qwidgets.pro qwidgets.cpp qwidgets.qml
-sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins
-target.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins
-
-INSTALLS += sources target
diff --git a/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.qml b/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.qml
deleted file mode 100644
index 4e1835e167..0000000000
--- a/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.qml
+++ /dev/null
@@ -1,110 +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 QtQuick 1.0
-import "QWidgets" 1.0
-
-Rectangle {
- id: window
-
- property int margin: 30
-
- width: 640; height: 480
- color: palette.window
-
- SystemPalette { id: palette }
-
- MyPushButton {
- id: button1
- x: margin; y: margin
- text: "Right"
- transformOriginPoint: Qt.point(width / 2, height / 2)
-
- onClicked: window.state = "right"
- }
-
- MyPushButton {
- id: button2
- x: margin; y: margin + 30
- text: "Bottom"
- transformOriginPoint: Qt.point(width / 2, height / 2)
-
- onClicked: window.state = "bottom"
- }
-
- MyPushButton {
- id: button3
- x: margin; y: margin + 60
- text: "Quit"
- transformOriginPoint: Qt.point(width / 2, height / 2)
-
- onClicked: Qt.quit()
- }
-
- states: [
- State {
- name: "right"
- PropertyChanges { target: button1; x: window.width - width - margin; text: "Left"; onClicked: window.state = "" }
- PropertyChanges { target: button2; x: window.width - width - margin }
- PropertyChanges { target: button3; x: window.width - width - margin }
- PropertyChanges { target: window; color: Qt.darker(palette.window) }
- },
- State {
- name: "bottom"
- PropertyChanges { target: button1; y: window.height - height - margin; rotation: 180 }
- PropertyChanges {
- target: button2
- x: button1.x + button1.width + 10; y: window.height - height - margin
- rotation: 180
- text: "Top"
- onClicked: window.state = ""
- }
- PropertyChanges { target: button3; x: button2.x + button2.width + 10; y: window.height - height - margin; rotation: 180 }
- PropertyChanges { target: window; color: Qt.lighter(palette.window) }
- }
- ]
-
- transitions: Transition {
- ParallelAnimation {
- NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: Easing.OutQuad }
- ColorAnimation { target: window; duration: 600 }
- }
- }
-}
diff --git a/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.qmlproject b/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.qmlproject
deleted file mode 100644
index 2bb4016996..0000000000
--- a/examples/declarative/qtquick1/cppextensions/qwidgets/qwidgets.qmlproject
+++ /dev/null
@@ -1,14 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
-}