QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlPlainTextLogger Class Reference

A subclass of QPlainTextEdit which implements QtlLogger interface. More...

Inheritance diagram for QtlPlainTextLogger:
QtlLogger

Public Slots

void save ()
 Save the content of the log window in a file. More...
 
void saveToFile (const QString &fileName)
 Save the content of the log window in a file. More...
 
void setDebugMode (bool on)
 Set / reset the debug mode. More...
 

Public Member Functions

 QtlPlainTextLogger (QWidget *parent=0)
 Constructor. More...
 
 QtlPlainTextLogger (const QString &text, QWidget *parent=0)
 Constructor. More...
 
virtual void debug (const QString &line, const QColor &color=QColor()) Q_DECL_OVERRIDE
 Log a line of debug text. More...
 
bool debugMode () const
 Check if debug mode is active. More...
 
virtual void line (const QString &line, const QColor &color=QColor()) Q_DECL_OVERRIDE
 Log a line of text. More...
 
virtual void text (const QString &text) Q_DECL_OVERRIDE
 Log text. More...
 

Private Attributes

bool _debug
 Debug mode. More...
 
QString _lastSavedLog
 Last saved log file name. More...
 

Detailed Description

A subclass of QPlainTextEdit which implements QtlLogger interface.

Constructor & Destructor Documentation

◆ QtlPlainTextLogger() [1/2]

QtlPlainTextLogger::QtlPlainTextLogger ( QWidget *  parent = 0)
explicit

Constructor.

Parameters
[in]parentOptional parent widget.

◆ QtlPlainTextLogger() [2/2]

QtlPlainTextLogger::QtlPlainTextLogger ( const QString &  text,
QWidget *  parent = 0 
)
explicit

Constructor.

Parameters
[in]textInitial content.
[in]parentOptional parent widget.

Member Function Documentation

◆ text()

void QtlPlainTextLogger::text ( const QString &  text)
virtual

Log text.

Reimplemented from QtlLogger.

Parameters
[in]textText to log.

Implements QtlLogger.

◆ line()

void QtlPlainTextLogger::line ( const QString &  line,
const QColor &  color = QColor() 
)
virtual

Log a line of text.

Reimplemented from QtlLogger.

Parameters
[in]lineLine to log. No need to contain a trailing new-line character.
[in]colorWhen a valid color is passed, try to display the text in this color.

Implements QtlLogger.

◆ debug()

void QtlPlainTextLogger::debug ( const QString &  line,
const QColor &  color = QColor() 
)
virtual

Log a line of debug text.

Reimplemented from QtlLogger.

Parameters
[in]lineLine to log. No need to contain a trailing new-line character.
[in]colorWhen a valid color is passed, try to display the text in this color.

Implements QtlLogger.

◆ debugMode()

bool QtlPlainTextLogger::debugMode ( ) const
inline

Check if debug mode is active.

Returns
True if debug mode is set, false otherwise.

◆ save

void QtlPlainTextLogger::save ( )
slot

Save the content of the log window in a file.

Ask the user to select a file.

◆ saveToFile

void QtlPlainTextLogger::saveToFile ( const QString &  fileName)
slot

Save the content of the log window in a file.

Parameters
[in]fileNameName of the file to write the log window content into. If empty, ask the user to select a file.

◆ setDebugMode

void QtlPlainTextLogger::setDebugMode ( bool  on)
slot

Set / reset the debug mode.

Parameters
[in]onWhen true, the debug() lines are displayed. When false, they are discarded.

Member Data Documentation

◆ _debug

bool QtlPlainTextLogger::_debug
private

Debug mode.

◆ _lastSavedLog

QString QtlPlainTextLogger::_lastSavedLog
private

Last saved log file name.


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