Mantid
Loading...
Searching...
No Matches
QtSignalChannel.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "DllOption.h"
10
11#include <Poco/Channel.h>
12#include <QObject>
13
14namespace MantidQt {
15namespace MantidWidgets {
16//---------------------------------------------------------------------
17//
18//---------------------------------------------------------------------
19class Message;
20
25class EXPORT_OPT_MANTIDQT_COMMON QtSignalChannel : public QObject, public Poco::Channel {
26 Q_OBJECT
27
28public:
30 QtSignalChannel(QString source = "");
32 ~QtSignalChannel() override;
33
35 void setSource(const QString &source);
37 inline const QString &source() const { return m_source; }
38
40 void log(const Poco::Message &msg) override;
41
42public slots:
44 void setGlobalLogLevel(int level);
45
46signals:
47 // Emitted when a Poco log message is received in this channel
48 void messageReceived(const Message &msg);
49
50private:
51 // Delete the copy constructor and assignment operator
54
56 QString m_source;
57};
58} // namespace MantidWidgets
59} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
Provides a simple binding of a text message with a priority.
Definition: Message.h:28
Provides a translation layer that takes a Poco::Message and converts it to a Qt signal.
QString m_source
Optional source (use std::string to avoid conversion in comparison)
QtSignalChannel & operator=(const QtSignalChannel &)=delete
const QString & source() const
Get the current source are emitted.
void messageReceived(const Message &msg)
QtSignalChannel(const QtSignalChannel &)=delete
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...