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// Qt-Security score:significant reason:default
4
5#include <QWaylandCompositor>
6#include <QWaylandOutput>
7
10
12
13QWaylandQuickXdgOutputV1::QWaylandQuickXdgOutputV1()
14 : QWaylandXdgOutputV1()
15{
16}
17
18void QWaylandQuickXdgOutputV1::componentComplete()
19{
20 // Try to find the manager from the compositor extensions
21 if (!manager()) {
22 for (auto *p = parent(); p != nullptr; p = p->parent()) {
23 if (auto *c = qobject_cast<QWaylandCompositor *>(p)) {
24 const auto extensions = c->extensions();
25 for (auto *extension : extensions) {
26 if (auto *m = qobject_cast<QWaylandXdgOutputManagerV1 *>(extension)) {
27 QWaylandXdgOutputV1Private::get(this)->setManager(m);
28 break;
29 }
30 }
31 }
32 }
33 }
34
35 // Try to find the output from the parents
36 if (!output()) {
37 for (auto *p = parent(); p != nullptr; p = p->parent()) {
38 if (auto *o = qobject_cast<QWaylandOutput *>(p)) {
39 QWaylandXdgOutputV1Private::get(this)->setOutput(o);
40 break;
41 }
42 }
43 }
44}
45
46QT_END_NAMESPACE
47
48#include "moc_qwaylandquickxdgoutputv1.cpp"
Combined button and popup list for selecting options.