aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmldebug/qdebugmessageclient.h
blob: 18b3aa3bd35ffe343ade8499d430b96949a092fa (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
35
36
37
38
39
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include "qmldebugclient.h"
#include "qmldebug_global.h"

namespace QmlDebug {

struct QDebugContextInfo
{
    int line;
    QString file;
    QString function;
    QString category;
    qint64 timestamp;
};

class QMLDEBUG_EXPORT QDebugMessageClient : public QmlDebugClient
{
    Q_OBJECT

public:
    explicit QDebugMessageClient(QmlDebugConnection *client);

    void stateChanged(State state) override;
    void messageReceived(const QByteArray &) override;

signals:
    void newState(QmlDebug::QmlDebugClient::State);
    void message(QtMsgType, const QString &,
                 const QmlDebug::QDebugContextInfo &);

private:
    Q_DISABLE_COPY(QDebugMessageClient)
};

} // namespace QmlDebug