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
qwaylandquickxdgoutputv1.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include <QWaylandCompositor>
5#include <QWaylandOutput>
6
9
11
12QWaylandQuickXdgOutputV1::QWaylandQuickXdgOutputV1()
13 : QWaylandXdgOutputV1()
14{
15}
16
17void QWaylandQuickXdgOutputV1::componentComplete()
18{
19 // Try to find the manager from the compositor extensions
20 if (!manager()) {
21 for (auto *p = parent(); p != nullptr; p = p->parent()) {
22 if (auto *c = qobject_cast<QWaylandCompositor *>(p)) {
23 for (auto *extension : c->extensions()) {
24 if (auto *m = qobject_cast<QWaylandXdgOutputManagerV1 *>(extension)) {
25 QWaylandXdgOutputV1Private::get(this)->setManager(m);
26 break;
27 }
28 }
29 }
30 }
31 }
32
33 // Try to find the output from the parents
34 if (!output()) {
35 for (auto *p = parent(); p != nullptr; p = p->parent()) {
36 if (auto *o = qobject_cast<QWaylandOutput *>(p)) {
37 QWaylandXdgOutputV1Private::get(this)->setOutput(o);
38 break;
39 }
40 }
41 }
42}
43
44QT_END_NAMESPACE
45
46#include "moc_qwaylandquickxdgoutputv1.cpp"