Provides a console windows, within the CamiTK application.
More...
#include <ConsoleStream.h>
|
| void | appendText (QString text) |
| | use a signal to print safely even if cout/cerr are written from other thread
|
| |
|
| | ConsoleStream (QObject *parent=nullptr) |
| | default constructor, init(..) have to be called later, before first use
|
| |
| void | free () |
| | reset the state as it was before (stream use the old buffer again)
|
| |
| void | init (std::ostream *stream, QTextEdit *textEdit) |
| | initialize ConsoleStream using both input stream and output text edit
|
| |
| void | setStream (std::ostream *stream) |
| | set the value for the buffer to be replaced by the ConsoleStream
|
| |
| void | setTextEdit (QTextEdit *textEdit) |
| | set the log QTextEdit
|
| |
| | ~ConsoleStream () override |
| | destructor: use free() to restore previous stream output buffer
|
| |
|
| int_type | overflow (int_type v) override |
| | rewriting of the inherited method overflow
|
| |
| std::streamsize | xsputn (const char *p, std::streamsize n) override |
| | rewriting of the inherited method xsputn
|
| |
Provides a console windows, within the CamiTK application.
The console widget.
Usage:
...
QApplication app(argc, argv);
std::cerr << "Oops";
Provides a console windows, within the CamiTK application.
Definition ConsoleStream.h:74
Potential problem on windows (see thread)
- std::string::clear() and std::string::push_back(...) don't exist, but myString.clear() can be substituted by myString.erase(myString.begin(), myString.end()) and myString.push_back(v) can be replaced by myString += v.
- The usage of int_type seems to require a using std::ios::int_type statement.
◆ ConsoleStream()
| camitk::ConsoleStream::ConsoleStream |
( |
QObject * |
parent = nullptr | ) |
|
|
inline |
default constructor, init(..) have to be called later, before first use
◆ ~ConsoleStream()
| camitk::ConsoleStream::~ConsoleStream |
( |
| ) |
|
|
inlineoverride |
destructor: use free() to restore previous stream output buffer
References free().
◆ appendText
| void camitk::ConsoleStream::appendText |
( |
QString |
text | ) |
|
|
signal |
use a signal to print safely even if cout/cerr are written from other thread
◆ free()
| void camitk::ConsoleStream::free |
( |
| ) |
|
|
inline |
◆ init()
| void camitk::ConsoleStream::init |
( |
std::ostream * |
stream, |
|
|
QTextEdit * |
textEdit |
|
) |
| |
|
inline |
◆ overflow()
| int_type camitk::ConsoleStream::overflow |
( |
int_type |
v | ) |
|
|
inlineoverrideprotected |
rewriting of the inherited method overflow
◆ setStream()
| void camitk::ConsoleStream::setStream |
( |
std::ostream * |
stream | ) |
|
|
inline |
◆ setTextEdit()
| void camitk::ConsoleStream::setTextEdit |
( |
QTextEdit * |
textEdit | ) |
|
|
inline |
set the log QTextEdit
Referenced by init().
◆ xsputn()
| std::streamsize camitk::ConsoleStream::xsputn |
( |
const char * |
p, |
|
|
std::streamsize |
n |
|
) |
| |
|
inlineoverrideprotected |
rewriting of the inherited method xsputn
The documentation for this class was generated from the following file: