OpenMS  2.8.0
Public Types | Public Member Functions | Protected Slots | Properties | Private Member Functions | Private Attributes | List of all members
LogWindow Class Reference

A log window (QTextEdit) with convenience functions. More...

#include <OpenMS/VISUAL/LogWindow.h>

Inheritance diagram for LogWindow:
[legend]
Collaboration diagram for LogWindow:
[legend]

Public Types

enum  LogState { NOTICE , WARNING , CRITICAL }
 Log message states. More...
 

Public Member Functions

 LogWindow (QWidget *parent)
 Default constructor. More...
 
void appendText (const QString &text)
 appends text without adding line breaks and shows the log-window More...
 
void appendNewHeader (const LogState state, const String &heading, const String &body)
 appends a new block with heading and a body More...
 
void addNewline ()
 appends a line break (same as append("")) More...
 
int maxLength () const
 read max_length More...
 
void setMaxLength (int max_length)
 set max_length More...
 

Protected Slots

void trimText_ ()
 if text length reached max_length_, then delete prefix until length of text is 1/2 of max_length_ More...
 

Properties

int max_length
 

Private Member Functions

void contextMenuEvent (QContextMenuEvent *event) override
 

Private Attributes

int max_length_ { -1 }
 -1 by default, which means there is no maximum length More...
 

Detailed Description

A log window (QTextEdit) with convenience functions.

Member Enumeration Documentation

◆ LogState

enum LogState

Log message states.

Enumerator
NOTICE 

Notice.

WARNING 

Warning.

CRITICAL 

Fatal error.

Constructor & Destructor Documentation

◆ LogWindow()

LogWindow ( QWidget parent)

Default constructor.

Member Function Documentation

◆ addNewline()

void addNewline ( )

appends a line break (same as append(""))

Referenced by TOPPViewBase::abortTOPPTool(), and TOPPViewBase::finishTOPPToolExecution().

◆ appendNewHeader()

void appendNewHeader ( const LogState  state,
const String heading,
const String body 
)

◆ appendText()

void appendText ( const QString &  text)

appends text without adding line breaks and shows the log-window

Referenced by TOPPViewBase::updateProcessLog().

◆ contextMenuEvent()

void contextMenuEvent ( QContextMenuEvent *  event)
overrideprivate

◆ maxLength()

int maxLength ( ) const

read max_length

◆ setMaxLength()

void setMaxLength ( int  max_length)

set max_length

Referenced by TOPPASBase::TOPPASBase().

◆ trimText_

void trimText_ ( )
protectedslot

if text length reached max_length_, then delete prefix until length of text is 1/2 of max_length_

Member Data Documentation

◆ max_length_

int max_length_ { -1 }
private

-1 by default, which means there is no maximum length

Property Documentation

◆ max_length

int max_length
readwrite