Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaylandquickhardwarelayer.cpp
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
5
6#include <QtWaylandCompositor/private/qwlhardwarelayerintegration_p.h>
7#include <QtWaylandCompositor/private/qwlhardwarelayerintegrationfactory_p.h>
8
9#include <QtCore/private/qobject_p.h>
10#include <QMatrix4x4>
11
13
24
26
28{
31
32 QString environmentKey = QString::fromLocal8Bit(qgetenv("QT_WAYLAND_HARDWARE_LAYER_INTEGRATION").constData());
33 if (!environmentKey.isEmpty()) {
34 if (keys.contains(environmentKey)) {
36 } else {
37 qWarning() << "Unknown hardware layer integration:" << environmentKey
38 << "Valid layer integrations are" << keys;
39 }
40 } else if (!keys.isEmpty()) {
42 } else {
43 qWarning() << "No wayland hardware layer integrations found";
44 }
45 }
46
48}
49
73
75{
77 if (d->layerIntegration())
78 d->layerIntegration()->remove(this);
79}
80
95{
97 return d->m_stackingLevel;
98}
99
101{
103 if (level == d->m_stackingLevel)
104 return;
105
106 d->m_stackingLevel = level;
108}
109
111{
113 return d->m_waylandItem;
114}
115
117{
119 for (QObject *p = parent(); p != nullptr; p = p->parent()) {
120 if (auto *waylandItem = qobject_cast<QWaylandQuickItem *>(p)) {
121 d->m_waylandItem = waylandItem;
122 break;
123 }
124 }
125}
126
128{
130 Q_ASSERT(d->m_waylandItem);
131 if (auto integration = d->layerIntegration())
132 integration->add(this);
133 else
134 qWarning() << "No hardware layer integration. WaylandHarwareLayer has no effect.";
135}
136
141
142// This should be called if QWaylandQuickHardwareLayer used as a native instance, not a qml component.
148
150
151#include "moc_qwaylandquickhardwarelayer_p.cpp"
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5949
static QtWayland::HardwareLayerIntegration * s_hardwareLayerIntegration
QtWayland::HardwareLayerIntegration * layerIntegration()
QWaylandQuickHardwareLayer(QObject *parent=nullptr)
\qmltype WaylandHardwareLayer \inqmlmodule QtWayland.Compositor \preliminary
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void classBegin() override
Invoked after class creation, but before any properties have been set.
QWaylandQuickItem * waylandItem() const
\qmltype WaylandQuickItem \instantiates QWaylandQuickItem \inqmlmodule QtWayland.Compositor
void setPaintEnabled(bool paintEnabled)
static HardwareLayerIntegration * create(const QString &name, const QStringList &args)
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
#define qWarning
Definition qlogging.h:166
GLenum GLuint GLint level
GLboolean enable
GLfloat GLfloat p
[1]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
#define emit
QStringList keys