Mantid
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::QtSignalChannel Class Reference

Provides a translation layer that takes a Poco::Message and converts it to a Qt signal. More...

#include <QtSignalChannel.h>

Inheritance diagram for MantidQt::MantidWidgets::QtSignalChannel:

Public Slots

void setGlobalLogLevel (int level)
 Set the log level for all loggers. More...
 

Signals

void messageReceived (const Message &msg)
 

Public Member Functions

void log (const Poco::Message &msg) override
 Converts the Poco::Message to a Qt signal. More...
 
 QtSignalChannel (QString source="")
 Default constructor. More...
 
void setSource (const QString &source)
 If set, only Mantid log messages from this source are emitted. More...
 
const QString & source () const
 Get the current source are emitted. More...
 
 ~QtSignalChannel () override
 Destructor. More...
 

Private Member Functions

QtSignalChanneloperator= (const QtSignalChannel &)=delete
 
 QtSignalChannel (const QtSignalChannel &)=delete
 

Private Attributes

QString m_source
 Optional source (use std::string to avoid conversion in comparison) More...
 

Detailed Description

Provides a translation layer that takes a Poco::Message and converts it to a Qt signal.

Definition at line 25 of file QtSignalChannel.h.

Constructor & Destructor Documentation

◆ QtSignalChannel() [1/2]

MantidQt::MantidWidgets::QtSignalChannel::QtSignalChannel ( QString  source = "")

Default constructor.

Creates a QtSignalChannel.

This channel receives Poco::Message objects and re-emits MantidQt Message objects with the option to specify that only messages from a defined source are emitted.

Parameters
sourceA string specifying a source for the message

Definition at line 24 of file QtSignalChannel.cpp.

◆ ~QtSignalChannel()

MantidQt::MantidWidgets::QtSignalChannel::~QtSignalChannel ( )
overridedefault

Destructor.

◆ QtSignalChannel() [2/2]

MantidQt::MantidWidgets::QtSignalChannel::QtSignalChannel ( const QtSignalChannel )
privatedelete

Member Function Documentation

◆ log()

void MantidQt::MantidWidgets::QtSignalChannel::log ( const Poco::Message &  msg)
override

Converts the Poco::Message to a Qt signal.

If the source is set then only messages with a matching source cause a Qt signal to be emitted.

A newline is appended as the Poco log stream emits the message when a newline is received but doesn't actually send a newline character

Parameters
msgA Poco message object containing a priority & the string message

Definition at line 41 of file QtSignalChannel.cpp.

References m_source, and messageReceived().

◆ messageReceived

void MantidQt::MantidWidgets::QtSignalChannel::messageReceived ( const Message msg)
signal

Referenced by log().

◆ operator=()

QtSignalChannel & MantidQt::MantidWidgets::QtSignalChannel::operator= ( const QtSignalChannel )
privatedelete

◆ setGlobalLogLevel

void MantidQt::MantidWidgets::QtSignalChannel::setGlobalLogLevel ( int  level)
slot

Set the log level for all loggers.

Definition at line 51 of file QtSignalChannel.cpp.

References Mantid::Kernel::Logger::setLevelForAll().

◆ setSource()

void MantidQt::MantidWidgets::QtSignalChannel::setSource ( const QString &  source)

If set, only Mantid log messages from this source are emitted.

Parameters
sourceA string specifying the required source for messages that will be emitted

Definition at line 32 of file QtSignalChannel.cpp.

References m_source, and source().

Referenced by MantidQt::MantidWidgets::MessageDisplay::setSource().

◆ source()

const QString & MantidQt::MantidWidgets::QtSignalChannel::source ( ) const
inline

Get the current source are emitted.

Definition at line 37 of file QtSignalChannel.h.

Referenced by setSource().

Member Data Documentation

◆ m_source

QString MantidQt::MantidWidgets::QtSignalChannel::m_source
private

Optional source (use std::string to avoid conversion in comparison)

Definition at line 56 of file QtSignalChannel.h.

Referenced by log(), and setSource().


The documentation for this class was generated from the following files: