1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QDEBUGMESSAGESERVICE_H |
5 | #define QDEBUGMESSAGESERVICE_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <private/qqmldebugserviceinterfaces_p.h> |
19 | |
20 | #include <QtCore/qlogging.h> |
21 | #include <QtCore/qmutex.h> |
22 | #include <QtCore/qelapsedtimer.h> |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | class QDebugMessageServiceImpl : public QDebugMessageService |
27 | { |
28 | Q_OBJECT |
29 | public: |
30 | QDebugMessageServiceImpl(QObject *parent = nullptr); |
31 | |
32 | void sendDebugMessage(QtMsgType type, const QMessageLogContext &ctxt, const QString &buf); |
33 | void synchronizeTime(const QElapsedTimer &otherTimer) override; |
34 | |
35 | protected: |
36 | void stateChanged(State) override; |
37 | |
38 | private: |
39 | friend class QQmlDebuggerServiceFactory; |
40 | |
41 | QtMessageHandler oldMsgHandler; |
42 | QQmlDebugService::State prevState; |
43 | QMutex initMutex; |
44 | QElapsedTimer timer; |
45 | }; |
46 | |
47 | QT_END_NAMESPACE |
48 | |
49 | #endif // QDEBUGMESSAGESERVICE_H |
50 |