summaryrefslogtreecommitdiff
path: root/src/webchannelquick/qqmlwebchannelattached.cpp
blob: 5bbd1beea4f701523698f543d119cf1ddd83e6bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author
// Milian Wolff <milian.wolff@kdab.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "qqmlwebchannelattached_p.h"

QT_USE_NAMESPACE

QQmlWebChannelAttached::QQmlWebChannelAttached(QObject *parent) : QObject(parent) { }

QQmlWebChannelAttached::~QQmlWebChannelAttached() { }

/*!
    \qmlattachedproperty QString WebChannel::id

    \brief The identifier under which an object, registered to a WebChannel, is known to remote
   clients.

    This property must be set for every object that should be published over the WebChannel.
    While no restrictions are enforced on the format of the id, it is usually a good idea to
    choose a string that is also a valid JavaScript identifier.
*/
QString QQmlWebChannelAttached::id() const
{
    return m_id;
}

void QQmlWebChannelAttached::setId(const QString &id)
{
    if (id != m_id) {
        m_id = id;
        emit idChanged(id);
    }
}