Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandquickshellintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
6
7/*!
8 * \class QWaylandQuickShellIntegration
9 * \inmodule QtWaylandCompositor
10 * \since 5.14
11 * \brief Provides support for shell surface integration with QtQuick.
12 *
13 * Shell surface implementations should inherit from this class in order to provide
14 * an integration between the shell surface and QtQuick.
15 *
16 * Shell integration is installed as an event filter for a QWaylandQuickShellSurfaceItem.
17 * Reimplement the event filter method and return \c true when you want to filter the
18 * event out, otherwise return \c false.
19 *
20 * Example:
21 *
22 * \code
23 * class MyShellIntegration : public QWaylandQuickShellIntegration
24 * {
25 * Q_OBJECT
26 * public:
27 * MyShellIntegration(QObject *parent = nullptr);
28 *
29 * protected:
30 * bool eventFilter(QObject *object, QEvent *event) override;
31 * };
32 *
33 * MyShellIntegration::MyShellIntegration(QObject *parent)
34 * : QWaylandQuickShellIntegration(parent)
35 * {
36 * }
37 *
38 * bool MyShellIntegration::eventFilter(QObject *object, QEvent *event)
39 * {
40 * QWaylandQuickShellSurfaceItem *shellSurfaceItem = qobject_cast<QWaylandQuickShellSurfaceItem *>(object);
41 * if (!shellSurfaceItem)
42 * return QWaylandQuickShellIntegration::eventFilter(object, event);
43 *
44 * if (event->type() == QEvent::MouseMove) {
45 * QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
46 * qDebug() << "Mouse moved on" << shellSurfaceItem << "pos:" << mouseEvent->pos();
47 * return true;
48 * }
49 *
50 * return QWaylandQuickShellIntegration::eventFilter(object, event);
51 * }
52 * \endcode
53 *
54 * \sa QWaylandQuickShellSurfaceItem
55 * \sa QObject::eventFilter()
56 */
57
59
60QWaylandQuickShellIntegration::QWaylandQuickShellIntegration(QObject *parent)
61 : QObject(parent)
62{
63}
64
65QWaylandQuickShellIntegration::~QWaylandQuickShellIntegration()
66{
67}
68
69QT_END_NAMESPACE
70
71#include "moc_qwaylandquickshellintegration.cpp"
Combined button and popup list for selecting options.