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