diff options
author | Liang Qi <liang.qi@qt.io> | 2017-01-25 12:12:45 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-01-25 12:19:40 +0100 |
commit | 44e3a9d321190f2958e1a1bdfa7f840e56355279 (patch) | |
tree | 4d167e9d0cfcb59eb6e2dd5ed4f55981627e9339 /tests | |
parent | e26696524ceb58f4fe0cb7202d873240b6a9478d (diff) | |
parent | f72d63866d3f5820865fcd309b649dc9932518ee (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
.qmake.conf
examples/wayland/custom-extension/client-common/main.cpp
src/client/qwaylandwlshellintegration_p.h
src/client/qwaylandxdgshellintegration_p.h
src/compositor/compositor_api/qwaylandquickoutput.h
src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h
Change-Id: Ic78c610ddf102b0a185294f625bbfcb9238b0f3c
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/client/client/mockinput.h | 14 | ||||
-rw-r--r-- | tests/auto/client/client/mocksurface.h | 12 | ||||
-rw-r--r-- | tests/auto/client/client/tst_client.cpp | 4 | ||||
-rw-r--r-- | tests/auto/compositor/compositor/testcompositor.h | 4 | ||||
-rw-r--r-- | tests/auto/compositor/compositor/testkeyboardgrabber.h | 8 | ||||
-rw-r--r-- | tests/auto/compositor/compositor/testseat.h | 2 | ||||
-rw-r--r-- | tests/auto/compositor/compositor/tst_compositor.cpp | 6 | ||||
-rw-r--r-- | tests/manual/scaling-compositor/main.cpp | 49 | ||||
-rw-r--r-- | tests/manual/scaling-compositor/main.qml | 84 | ||||
-rw-r--r-- | tests/manual/scaling-compositor/qml.qrc | 5 | ||||
-rw-r--r-- | tests/manual/scaling-compositor/scaling-compositor.pro | 7 | ||||
-rw-r--r-- | tests/manual/subsurface/shmwindow.h | 4 |
12 files changed, 172 insertions, 27 deletions
diff --git a/tests/auto/client/client/mockinput.h b/tests/auto/client/client/mockinput.h index 7e88ffb0f..9c217b6ac 100644 --- a/tests/auto/client/client/mockinput.h +++ b/tests/auto/client/client/mockinput.h @@ -54,10 +54,10 @@ public: Touch *touch() const { return m_touch.data(); } protected: - void seat_bind_resource(Resource *resource) Q_DECL_OVERRIDE; - void seat_get_keyboard(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; - void seat_get_pointer(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; - void seat_get_touch(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; + void seat_bind_resource(Resource *resource) override; + void seat_get_keyboard(Resource *resource, uint32_t id) override; + void seat_get_pointer(Resource *resource, uint32_t id) override; + void seat_get_touch(Resource *resource, uint32_t id) override; private: Compositor *m_compositor; @@ -80,7 +80,7 @@ public: void sendKey(uint32_t key, uint32_t state); protected: - void keyboard_destroy_resource(wl_keyboard::Resource *resource) Q_DECL_OVERRIDE; + void keyboard_destroy_resource(wl_keyboard::Resource *resource) override; private: Compositor *m_compositor; @@ -103,7 +103,7 @@ public: void sendButton(uint32_t button, uint32_t state); protected: - void pointer_destroy_resource(wl_pointer::Resource *resource) Q_DECL_OVERRIDE; + void pointer_destroy_resource(wl_pointer::Resource *resource) override; private: Compositor *m_compositor; @@ -158,7 +158,7 @@ public: DataDevice *dataDevice() const; protected: - void data_device_manager_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat) Q_DECL_OVERRIDE; + void data_device_manager_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat) override; void data_device_manager_create_data_source(Resource *resource, uint32_t id) override; private: diff --git a/tests/auto/client/client/mocksurface.h b/tests/auto/client/client/mocksurface.h index d04386ac8..e34d6596e 100644 --- a/tests/auto/client/client/mocksurface.h +++ b/tests/auto/client/client/mocksurface.h @@ -49,16 +49,16 @@ public: protected: - void surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; + void surface_destroy_resource(Resource *resource) override; - void surface_destroy(Resource *resource) Q_DECL_OVERRIDE; + void surface_destroy(Resource *resource) override; void surface_attach(Resource *resource, - struct wl_resource *buffer, int x, int y) Q_DECL_OVERRIDE; + struct wl_resource *buffer, int x, int y) override; void surface_damage(Resource *resource, - int32_t x, int32_t y, int32_t width, int32_t height) Q_DECL_OVERRIDE; + int32_t x, int32_t y, int32_t width, int32_t height) override; void surface_frame(Resource *resource, - uint32_t callback) Q_DECL_OVERRIDE; - void surface_commit(Resource *resource) Q_DECL_OVERRIDE; + uint32_t callback) override; + void surface_commit(Resource *resource) override; private: wl_resource *m_buffer; diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp index f48bb8724..0c9c007a2 100644 --- a/tests/auto/client/client/tst_client.cpp +++ b/tests/auto/client/client/tst_client.cpp @@ -91,7 +91,7 @@ public: ++mouseReleaseEventCount; } - void touchEvent(QTouchEvent *event) Q_DECL_OVERRIDE + void touchEvent(QTouchEvent *event) override { ++touchEventCount; } @@ -269,7 +269,7 @@ public: bool dragStarted; protected: - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE + void mousePressEvent(QMouseEvent *event) override { if (dragStarted) return; diff --git a/tests/auto/compositor/compositor/testcompositor.h b/tests/auto/compositor/compositor/testcompositor.h index 8eeb7ade6..d80fe3588 100644 --- a/tests/auto/compositor/compositor/testcompositor.h +++ b/tests/auto/compositor/compositor/testcompositor.h @@ -43,8 +43,8 @@ public slots: void onSurfaceAboutToBeDestroyed(QWaylandSurface *surface); protected: - QWaylandSeat *createSeat() Q_DECL_OVERRIDE; - QWaylandKeyboard *createKeyboardDevice(QWaylandSeat *seat) Q_DECL_OVERRIDE; + QWaylandSeat *createSeat() override; + QWaylandKeyboard *createKeyboardDevice(QWaylandSeat *seat) override; public: QList<QWaylandSurface *> surfaces; diff --git a/tests/auto/compositor/compositor/testkeyboardgrabber.h b/tests/auto/compositor/compositor/testkeyboardgrabber.h index 0ef595987..7f0f2c86c 100644 --- a/tests/auto/compositor/compositor/testkeyboardgrabber.h +++ b/tests/auto/compositor/compositor/testkeyboardgrabber.h @@ -34,10 +34,10 @@ class TestKeyboardGrabber : public QWaylandKeyboard public: TestKeyboardGrabber(QWaylandSeat *seat); - void setFocus(QWaylandSurface *surface) Q_DECL_OVERRIDE; - void sendKeyModifiers(QWaylandClient *client, uint32_t serial) Q_DECL_OVERRIDE; - void sendKeyPressEvent(uint code) Q_DECL_OVERRIDE; - void sendKeyReleaseEvent(uint code) Q_DECL_OVERRIDE; + void setFocus(QWaylandSurface *surface) override; + void sendKeyModifiers(QWaylandClient *client, uint32_t serial) override; + void sendKeyPressEvent(uint code) override; + void sendKeyReleaseEvent(uint code) override; signals: void focusedCalled(); diff --git a/tests/auto/compositor/compositor/testseat.h b/tests/auto/compositor/compositor/testseat.h index 7fa7030fa..b9f04a2c2 100644 --- a/tests/auto/compositor/compositor/testseat.h +++ b/tests/auto/compositor/compositor/testseat.h @@ -42,7 +42,7 @@ public: TestSeat(QWaylandCompositor *compositor, QWaylandSeat::CapabilityFlags caps); ~TestSeat(); - bool isOwner(QInputEvent *inputEvent) const Q_DECL_OVERRIDE; + bool isOwner(QInputEvent *inputEvent) const override; QList<QMouseEvent *> createMouseEvents(int count); diff --git a/tests/auto/compositor/compositor/tst_compositor.cpp b/tests/auto/compositor/compositor/tst_compositor.cpp index b31d51b4e..3d7d2dab9 100644 --- a/tests/auto/compositor/compositor/tst_compositor.cpp +++ b/tests/auto/compositor/compositor/tst_compositor.cpp @@ -315,7 +315,7 @@ void tst_WaylandCompositor::frameCallback() class BufferView : public QWaylandView { public: - void bufferCommitted(const QWaylandBufferRef &ref, const QRegion &damage) Q_DECL_OVERRIDE + void bufferCommitted(const QWaylandBufferRef &ref, const QRegion &damage) override { Q_UNUSED(damage); bufferRef = ref; @@ -529,7 +529,7 @@ void tst_WaylandCompositor::sendsXdgConfigure() { public: MockXdgSurface(::xdg_surface *xdgSurface) : QtWayland::xdg_surface(xdgSurface) {} - void xdg_surface_configure(int32_t width, int32_t height, wl_array *rawStates, uint32_t serial) Q_DECL_OVERRIDE + void xdg_surface_configure(int32_t width, int32_t height, wl_array *rawStates, uint32_t serial) override { configureSize = QSize(width, height); configureSerial = serial; @@ -729,7 +729,7 @@ void tst_WaylandCompositor::sendsIviConfigure() { public: MockIviSurface(::ivi_surface *iviSurface) : QtWayland::ivi_surface(iviSurface) {} - void ivi_surface_configure(int32_t width, int32_t height) Q_DECL_OVERRIDE + void ivi_surface_configure(int32_t width, int32_t height) override { configureSize = QSize(width, height); } diff --git a/tests/manual/scaling-compositor/main.cpp b/tests/manual/scaling-compositor/main.cpp new file mode 100644 index 000000000..33ffb0386 --- /dev/null +++ b/tests/manual/scaling-compositor/main.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt-project.org/legal +** +** 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 The Qt Company Ltd 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 <QtGui/QGuiApplication> +#include <QtQml/QQmlApplicationEngine> + +int main(int argc, char* argv[]) +{ + QGuiApplication app(argc, argv); + QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); + return app.exec(); +} diff --git a/tests/manual/scaling-compositor/main.qml b/tests/manual/scaling-compositor/main.qml new file mode 100644 index 000000000..e017a44f6 --- /dev/null +++ b/tests/manual/scaling-compositor/main.qml @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt-project.org/legal +** +** 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 The Qt Company Ltd 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 2.2 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 +import QtWayland.Compositor 1.0 + +WaylandCompositor { + id: comp + WaylandOutput { + id: output + compositor: comp + sizeFollowsWindow: true + scaleFactor: 2 + window: Window { + id: win + width: 500 + height: 500 + visible: true + title: "Scaling compositor x" + output.scaleFactor + Button { + id: incrementButton + text: "+" + onClicked: ++output.scaleFactor + } + Button { + text: "-" + onClicked: output.scaleFactor = Math.max(1, output.scaleFactor - 1) + anchors.left: incrementButton.right + } + Repeater { + model: shellSurfaces + ShellSurfaceItem { + shellSurface: modelData + onSurfaceDestroyed: shellSurfaces.remove(index); + } + } + } + } + + ListModel { id: shellSurfaces } + + WlShell { + onWlShellSurfaceCreated: shellSurfaces.append({shellSurface: shellSurface}); + } +} diff --git a/tests/manual/scaling-compositor/qml.qrc b/tests/manual/scaling-compositor/qml.qrc new file mode 100644 index 000000000..6b2d0a781 --- /dev/null +++ b/tests/manual/scaling-compositor/qml.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>main.qml</file> +</qresource> +</RCC> diff --git a/tests/manual/scaling-compositor/scaling-compositor.pro b/tests/manual/scaling-compositor/scaling-compositor.pro new file mode 100644 index 000000000..847e07ea7 --- /dev/null +++ b/tests/manual/scaling-compositor/scaling-compositor.pro @@ -0,0 +1,7 @@ +TEMPLATE = app + +QT += gui qml quickcontrols2 + +SOURCES += main.cpp + +RESOURCES += qml.qrc diff --git a/tests/manual/subsurface/shmwindow.h b/tests/manual/subsurface/shmwindow.h index 451f5fc4a..44d111e79 100644 --- a/tests/manual/subsurface/shmwindow.h +++ b/tests/manual/subsurface/shmwindow.h @@ -50,8 +50,8 @@ public: explicit ShmWindow(QWindow *parent); protected: - void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) override; + void timerEvent(QTimerEvent *) override; private: int m_rotation; |