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
qwaylandquicksurface.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#include <QSGTexture>
6#include <QQuickWindow>
7#include <QDebug>
8
13#include <QtWaylandCompositor/qwaylandbufferref.h>
14#include <QtWaylandCompositor/QWaylandView>
15#include <QtWaylandCompositor/private/qwaylandsurface_p.h>
16
18
19QWaylandQuickSurface::QWaylandQuickSurface()
20 : QWaylandSurface(* new QWaylandQuickSurfacePrivate())
21{
22
23}
24QWaylandQuickSurface::QWaylandQuickSurface(QWaylandCompositor *compositor, QWaylandClient *client, quint32 id, int version)
25 : QWaylandSurface(* new QWaylandQuickSurfacePrivate())
26{
27 initialize(compositor, client, id, version);
28}
29
30QWaylandQuickSurface::QWaylandQuickSurface(QWaylandQuickSurfacePrivate &dptr)
31 : QWaylandSurface(dptr)
32{
33}
34
35QWaylandQuickSurface::~QWaylandQuickSurface()
36{
37
38}
39
40/*!
41 * \qmlproperty bool QtWayland.Compositor::WaylandSurface::useTextureAlpha
42 * \default true
43 *
44 * This property specifies whether the surface should use texture alpha for blending.
45 *
46 * When \c true, the surface's alpha channel will be used for blending; when
47 * \c false, the surface will be treated as opaque.
48 */
49
50/*!
51 * \property QWaylandQuickSurface::useTextureAlpha
52 *
53 * This property holds whether the surface should use texture alpha for
54 * blending.
55 *
56 * When \c true, the surface's alpha channel will be used for blending; when
57 * \c false, the surface will be treated as opaque.
58 */
59bool QWaylandQuickSurface::useTextureAlpha() const
60{
61 Q_D(const QWaylandQuickSurface);
62 return d->useTextureAlpha;
63}
64
65void QWaylandQuickSurface::setUseTextureAlpha(bool useTextureAlpha)
66{
67 Q_D(QWaylandQuickSurface);
68 if (d->useTextureAlpha != useTextureAlpha) {
69 d->useTextureAlpha = useTextureAlpha;
70 emit useTextureAlphaChanged();
71 emit configure(d->bufferRef.hasBuffer());
72 }
73}
74
75QT_END_NAMESPACE
76
77#include "moc_qwaylandquicksurface.cpp"
Combined button and popup list for selecting options.