Signals | Public Member Functions | Static Public Member Functions | List of all members
MessageHandler Class Reference

widget to show Qt and VTK messages. More...

#include <pqOutputWidget.h>

Inherits QObject.

Signals

void message (QtMsgType type, const QString &msg)
 
void showMessage (QString msg, QtMsgType type)
 

Public Member Functions

 MessageHandler (QObject *parent=nullptr)
 

Static Public Member Functions

static void install (pqOutputWidget *widget)
 This function can be used to install a message handler for Qt that forwards all messages generated by Qt to the vtkOutputWindow instance obtained by vtkOutputWindow::GetInstance(). More...
 
static void handler (QtMsgType type, const QMessageLogContext &, const QString &msg)
 This is the function installed with Qt. More...
 
static void handlerVTK (QtMsgType type, const QString &msg)
 This function is used for VTK messages that don't have QMessageLogContext. More...
 

Detailed Description

widget to show Qt and VTK messages.

This utility class allows us to install a Qt message handler. We are using a signal/slot to ensure that the messages are written on the main thread.

This utility class also helps us support VTK messages coming from different threads.

N.B. This is really a internal class however has to be exported so it can be used inside a message handler function inside Qt.

Definition at line 61 of file pqOutputWidget.h.

Constructor & Destructor Documentation

◆ MessageHandler()

MessageHandler::MessageHandler ( QObject *  parent = nullptr)

Member Function Documentation

◆ install()

static void MessageHandler::install ( pqOutputWidget widget)
static

This function can be used to install a message handler for Qt that forwards all messages generated by Qt to the vtkOutputWindow instance obtained by vtkOutputWindow::GetInstance().

Thus, this is quick way to forward all Qt messages to be forwarded to VTK for output using the same mechanisms setup for handling VTK messages.

◆ handler()

static void MessageHandler::handler ( QtMsgType  type,
const QMessageLogContext &  ,
const QString &  msg 
)
static

This is the function installed with Qt.

◆ handlerVTK()

static void MessageHandler::handlerVTK ( QtMsgType  type,
const QString &  msg 
)
static

This function is used for VTK messages that don't have QMessageLogContext.

◆ message

void MessageHandler::message ( QtMsgType  type,
const QString &  msg 
)
signal

◆ showMessage

void MessageHandler::showMessage ( QString  msg,
QtMsgType  type 
)
signal

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