From bd1f5e1651c7cdaa712feebe2573dd158c87bb07 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 20 May 2015 14:37:58 +0200 Subject: 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 --- tests/auto/auto.pro | 4 ++ tests/auto/qml/qml.pro | 3 ++ tests/auto/qml/qmlwebsockets/qmlwebsockets.pro | 9 ++++ tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp | 35 +++++++++++++++ tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml | 52 ++++++++++++++++++++++ .../qmlwebsockets_compat/qmlwebsockets_compat.pro | 9 ++++ .../tst_qmlwebsockets_compat.cpp | 35 +++++++++++++++ .../tst_qmlwebsockets_compat.qml | 52 ++++++++++++++++++++++ 8 files changed, 199 insertions(+) create mode 100644 tests/auto/qml/qml.pro create mode 100644 tests/auto/qml/qmlwebsockets/qmlwebsockets.pro create mode 100644 tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp create mode 100644 tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml create mode 100644 tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro create mode 100644 tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp create mode 100644 tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml (limited to 'tests/auto') 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 +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 +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 + } +} -- cgit v1.2.1