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
qdebugmessageservice.h
Go to the documentation of this file.
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
24QT_BEGIN_NAMESPACE
25
26class QDebugMessageServiceImpl : public QDebugMessageService
27{
28 Q_OBJECT
29public:
30 QDebugMessageServiceImpl(QObject *parent = nullptr);
31 ~QDebugMessageServiceImpl();
32
33 void sendDebugMessage(QtMsgType type, const QMessageLogContext &ctxt, const QString &buf);
34 void synchronizeTime(const QElapsedTimer &otherTimer) override;
35
36protected:
37 void stateChanged(State) override;
38
39private:
40 void restoreOldMessageHandler();
41
42 friend class QQmlDebuggerServiceFactory;
43
44 QtMessageHandler oldMsgHandler;
45 QQmlDebugService::State prevState;
46 QMutex initMutex;
47 QElapsedTimer timer;
48};
49
51
52#endif // QDEBUGMESSAGESERVICE_H
void DebugMessageHandler(QtMsgType type, const QMessageLogContext &ctxt, const QString &buf)