summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-05-20 14:37:58 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-05-22 07:13:36 +0000
commitbd1f5e1651c7cdaa712feebe2573dd158c87bb07 (patch)
tree63f3d142ee8c8818ea9e258749fedf498e05d265
parentfaab6ff98dafa564f2c58bd95689ffba6d3a4e32 (diff)
downloadqtwebsockets-bd1f5e1651c7cdaa712feebe2573dd158c87bb07.tar.gz
Fix qmldir for qmlwebsockets_compat
It is not supported to have both "import Qt.WebSockets 1.0" and "import QtWebSockets 1.0" in the same project. Task-number: QTBUG-46205 Change-Id: I71b824b091f4491b8ab5e1eae8290a51159b03e2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r--.gitignore1
-rw-r--r--examples/websockets/qmlwebsocketclient/qml/qmlwebsocketclient/main.qml2
-rw-r--r--examples/websockets/qmlwebsocketserver/qml/qmlwebsocketserver/main.qml2
-rw-r--r--src/imports/qmlwebsockets_compat/qmldir2
-rw-r--r--tests/auto/auto.pro4
-rw-r--r--tests/auto/qml/qml.pro3
-rw-r--r--tests/auto/qml/qmlwebsockets/qmlwebsockets.pro9
-rw-r--r--tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp35
-rw-r--r--tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml52
-rw-r--r--tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro9
-rw-r--r--tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp35
-rw-r--r--tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml52
12 files changed, 202 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 218d86e..78433a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,4 +56,3 @@ include
tests/auto/cmake/build
lib/
mkspecs/
-qml/
diff --git a/examples/websockets/qmlwebsocketclient/qml/qmlwebsocketclient/main.qml b/examples/websockets/qmlwebsocketclient/qml/qmlwebsocketclient/main.qml
index 6d2749c..35d64e0 100644
--- a/examples/websockets/qmlwebsocketclient/qml/qmlwebsocketclient/main.qml
+++ b/examples/websockets/qmlwebsocketclient/qml/qmlwebsocketclient/main.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.WebSockets 1.0
+import QtWebSockets 1.0
Rectangle {
width: 360
diff --git a/examples/websockets/qmlwebsocketserver/qml/qmlwebsocketserver/main.qml b/examples/websockets/qmlwebsocketserver/qml/qmlwebsocketserver/main.qml
index 6c3433f..c0178ba 100644
--- a/examples/websockets/qmlwebsocketserver/qml/qmlwebsocketserver/main.qml
+++ b/examples/websockets/qmlwebsocketserver/qml/qmlwebsocketserver/main.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import Qt.WebSockets 1.0
+import QtWebSockets 1.0
Rectangle {
width: 360
diff --git a/src/imports/qmlwebsockets_compat/qmldir b/src/imports/qmlwebsockets_compat/qmldir
index 8541103..eca44f0 100644
--- a/src/imports/qmlwebsockets_compat/qmldir
+++ b/src/imports/qmlwebsockets_compat/qmldir
@@ -1,4 +1,4 @@
module Qt.WebSockets
-plugin ../../QtWebSockets/declarative_qmlwebsockets
+plugin declarative_qmlwebsockets ../../QtWebSockets/
classname QtWebSocketsDeclarativeModule
typeinfo ../../QtWebSockets/plugins.qmltypes
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 634e44b..d83cc1f 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,3 +1,7 @@
TEMPLATE = subdirs
SUBDIRS += websockets
+
+qtHaveModule(quick) {
+ SUBDIRS += qml
+}
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
new file mode 100644
index 0000000..24941ad
--- /dev/null
+++ b/tests/auto/qml/qml.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+
+SUBDIRS += qmlwebsockets qmlwebsockets_compat
diff --git a/tests/auto/qml/qmlwebsockets/qmlwebsockets.pro b/tests/auto/qml/qmlwebsockets/qmlwebsockets.pro
new file mode 100644
index 0000000..9405f37
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets/qmlwebsockets.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = tst_qmlwebsockets
+CONFIG += qmltestcase
+CONFIG += console
+SOURCES += tst_qmlwebsockets.cpp
+
+importFiles.path = .
+DEPLOYMENT += importFiles
+
diff --git a/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp
new file mode 100644
index 0000000..c230bf5
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** 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 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQuickTest/quicktest.h>
+QUICK_TEST_MAIN(qmlwebsockets)
diff --git a/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml
new file mode 100644
index 0000000..6018037
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** 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 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.5
+import QtWebSockets 1.0
+
+Rectangle {
+ width: 360
+ height: 360
+
+ function appendMessage(message) {
+ messageBox.text += "\n" + message
+ }
+
+ WebSocketServer {
+ id: server
+ }
+
+ WebSocket {
+ id: socket
+ }
+}
diff --git a/tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro b/tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro
new file mode 100644
index 0000000..104e6de
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = tst_qmlwebsockets_compat
+CONFIG += qmltestcase
+CONFIG += console
+SOURCES += tst_qmlwebsockets_compat.cpp
+
+importFiles.path = .
+DEPLOYMENT += importFiles
+
diff --git a/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp
new file mode 100644
index 0000000..0ce5bce
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** 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 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQuickTest/quicktest.h>
+QUICK_TEST_MAIN(qmlwebsockets_compat)
diff --git a/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml
new file mode 100644
index 0000000..fa2a992
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** 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 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.5
+import Qt.WebSockets 1.0
+
+Rectangle {
+ width: 360
+ height: 360
+
+ function appendMessage(message) {
+ messageBox.text += "\n" + message
+ }
+
+ WebSocketServer {
+ id: server
+ }
+
+ WebSocket {
+ id: socket
+ }
+}