Krita Source Code Documentation
Loading...
Searching...
No Matches
LogDockerDock.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef _LOGDOCKER_DOCK_H_
8#define _LOGDOCKER_DOCK_H_
9
10#include <QDockWidget>
11
13
14#include "ui_WdgLogDocker.h"
15class MessageSender : public QObject
16{
17 Q_OBJECT
18public:
19
20 MessageSender() : QObject() {}
21 ~MessageSender() override {}
22
23 void sendMessage(QtMsgType type, const QString &msg);
24
25Q_SIGNALS:
26
27 void emitMessage(QtMsgType type, const QString &msg);
28
29};
30
31class LogDockerDock : public QDockWidget, public KisMainwindowObserver, public Ui_WdgLogDocker {
32 Q_OBJECT
33public:
35 QString observerName() override { return "LogDockerDock"; }
36 void setCanvas(KoCanvasBase *canvas) override;
37 void unsetCanvas() override {}
38 void setViewManager(KisViewManager* kisview) override;
39
40private Q_SLOTS:
41
42 void toggleLogging(bool toggle);
43 void clearLog();
44 void saveLog();
45 void settings();
46 void insertMessage(QtMsgType type, const QString &msg);
47 void changeTheme();
48
49private:
50
51 void applyCategories();
52
54 static QTextCharFormat s_debug;
55 static QTextCharFormat s_info;
56 static QTextCharFormat s_warning;
57 static QTextCharFormat s_critical;
58 static QTextCharFormat s_fatal;
59 static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg);
60
61};
62
63
64#endif
The KisMainwindowObserver class is an interface for dock widgets that want to keep track of the main ...
static QTextCharFormat s_critical
void setCanvas(KoCanvasBase *canvas) override
void setViewManager(KisViewManager *kisview) override
QString observerName() override
void insertMessage(QtMsgType type, const QString &msg)
static QTextCharFormat s_info
static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
static QTextCharFormat s_debug
static QTextCharFormat s_warning
void toggleLogging(bool toggle)
void unsetCanvas() override
static QTextCharFormat s_fatal
static MessageSender * s_messageSender
~MessageSender() override
void emitMessage(QtMsgType type, const QString &msg)
void sendMessage(QtMsgType type, const QString &msg)