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
qwaylanddestroylistener.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
7
9
10QWaylandDestroyListenerPrivate::QWaylandDestroyListenerPrivate()
11{
12 listener.parent = this;
13 listener.listener.notify = handler;
14 wl_list_init(&listener.listener.link);
15}
16
17QWaylandDestroyListener::QWaylandDestroyListener(QObject *parent)
18 : QObject(* new QWaylandDestroyListenerPrivate(), parent)
19{
20}
21void QWaylandDestroyListener::listenForDestruction(::wl_resource *resource)
22{
23 Q_D(QWaylandDestroyListener);
24 wl_resource_add_destroy_listener(resource, &d->listener.listener);
25}
26
27void QWaylandDestroyListener::reset()
28{
29 Q_D(QWaylandDestroyListener);
30 wl_list_remove(&d->listener.listener.link);
31 wl_list_init(&d->listener.listener.link);
32}
33
34void QWaylandDestroyListenerPrivate::handler(wl_listener *listener, void *data)
35{
36 QWaylandDestroyListenerPrivate *that = reinterpret_cast<Listener *>(listener)->parent;
37 emit that->q_func()->fired(data);
38}
39
40QT_END_NAMESPACE
41
42#include "moc_qwaylanddestroylistener.cpp"
Combined button and popup list for selecting options.