QtBackgroundProcess  1.5.2
A Library to create background applications with simple, automated foreground control
Public Slots | Public Member Functions | Protected Member Functions | List of all members
QtBackgroundProcess::GlobalTerminal Class Reference

A virtual terminal that forwards input to all connected terminals. More...

#include <globalterminal.h>

+ Inheritance diagram for QtBackgroundProcess::GlobalTerminal:

Public Slots

void writeLine (const QByteArray &line, bool doFlush=true)
 Writes the given line on all connected terminals. More...
 
void flush ()
 Performs a flush on all connected terminals. More...
 

Public Member Functions

 GlobalTerminal (QObject *parent=nullptr, bool enableBootBuffer=false)
 Creates a new global terminal. More...
 
 ~GlobalTerminal ()
 Destructor.
 
bool isSequential () const override
 Inherits QIODevice::isSequential.
 
bool canReadLine () const override
 Inherits QIODevice::canReadLine.
 
- Public Member Functions inherited from QIODevice
 QIODevice (QObject *parent)
 
OpenMode openMode () const
 
void setTextModeEnabled (bool enabled)
 
bool isTextModeEnabled () const
 
bool isOpen () const
 
bool isReadable () const
 
bool isWritable () const
 
int readChannelCount () const
 
int writeChannelCount () const
 
int currentReadChannel () const
 
void setCurrentReadChannel (int channel)
 
int currentWriteChannel () const
 
void setCurrentWriteChannel (int channel)
 
virtual qint64 pos () const
 
virtual qint64 size () const
 
virtual bool seek (qint64 pos)
 
virtual bool atEnd () const
 
virtual bool reset ()
 
virtual qint64 bytesAvailable () const
 
virtual qint64 bytesToWrite () const
 
qint64 read (char *data, qint64 maxSize)
 
QByteArray read (qint64 maxSize)
 
QByteArray readAll ()
 
qint64 readLine (char *data, qint64 maxSize)
 
QByteArray readLine (qint64 maxSize)
 
void startTransaction ()
 
void commitTransaction ()
 
void rollbackTransaction ()
 
bool isTransactionStarted () const
 
qint64 write (const char *data, qint64 maxSize)
 
qint64 write (const char *data)
 
qint64 write (const QByteArray &byteArray)
 
qint64 peek (char *data, qint64 maxSize)
 
QByteArray peek (qint64 maxSize)
 
virtual bool waitForReadyRead (int msecs)
 
virtual bool waitForBytesWritten (int msecs)
 
void ungetChar (char c)
 
bool putChar (char c)
 
bool getChar (char *c)
 
QString errorString () const
 
void readyRead ()
 
void channelReadyRead (int channel)
 
void bytesWritten (qint64 bytes)
 
void channelBytesWritten (int channel, qint64 bytes)
 
void aboutToClose ()
 
void readChannelFinished ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual const QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const
 
const QObjectList & children () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
void dumpObjectTree () const
 
void dumpObjectInfo () const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 

Protected Member Functions

qint64 readData (char *data, qint64 maxlen) override
 Inherits QIODevice::readData.
 
qint64 writeData (const char *data, qint64 len) override
 Inherits QIODevice::writeData.
 
- Protected Member Functions inherited from QIODevice
virtual qint64 readLineData (char *data, qint64 maxSize)
 
void setOpenMode (OpenMode openMode)
 
void setErrorString (const QString &str)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
- Public Attributes inherited from QIODevice
typedef OpenMode
 
- Properties inherited from QObject
 objectName
 

Detailed Description

A virtual terminal that forwards input to all connected terminals.

The global terminal simply forwards everything written to it to all currently connected terminals. As such, it's a write-only device.

The GlobalTerminal implements the QIODevice interface. This allows easy integration into the application. The terminal is a sequential write-only device.

See also
Terminal, App::forwardMasterLog

Definition at line 15 of file globalterminal.h.

Constructor & Destructor Documentation

◆ GlobalTerminal()

QtBackgroundProcess::GlobalTerminal::GlobalTerminal ( QObject parent = nullptr,
bool  enableBootBuffer = false 
)
explicit

Creates a new global terminal.

Parameters
parentThe parent object for the global terminal
enableBootBufferAllows you to buffer input until terminals are connected

By default, the global terminal simply forwards all input to all connected terminals, unbuffered. However, to make shure all messages are delivered, The terminal can be told to buffer all messages, until the first terminal connects. As soon as that happens, the buffer is written to the terminal, cleared, and disabled. The buffer existst at most 10 seconds, until it's cleared automatically. This is an internal feature, and should only be used if you have global messages on your terminal, that are sent before the first terminal can connect. One example would be the startup function

See also
App::startupApp

Member Function Documentation

◆ flush

void QtBackgroundProcess::GlobalTerminal::flush ( )
slot

Performs a flush on all connected terminals.

See also
Terminal::flush

◆ writeLine

void QtBackgroundProcess::GlobalTerminal::writeLine ( const QByteArray line,
bool  doFlush = true 
)
slot

Writes the given line on all connected terminals.

See also
Terminal::writeLine

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