BPS C++ API  2.24.4
bpstextlogwidget.h
Go to the documentation of this file.
1 
4 #ifndef BPSTEXTLOGWIDGET_H
5 #define BPSTEXTLOGWIDGET_H
6 
7 #include "bpsgui_global.h"
8 #include <QWidget>
9 
14 {
15  Q_OBJECT
17 
18 public:
22  enum Mode {
23  TEXT,
25  HEX
26  };
27 
31  BpsTextLogWidget(QWidget* aParent = nullptr);
32 
33  virtual ~BpsTextLogWidget();
34 
38  Mode mode() const;
39 
45  void setMode(Mode aMode);
46 
52  void setLimit(int aLines);
53 
57  int limit() const;
58 
64  void log(const QString& aText, const QColor& aColor = Qt::black);
65 
71  void log(const QByteArray& aData, const QColor& aColor = Qt::black);
72 
80  void logASCII(const QString& aText, const QColor& aColor = Qt::black);
81 
89  void logASCII(const QByteArray& aData, const QColor& aColor = Qt::black);
90 
96  void logHEX(const QString& aText, const QColor& aColor = Qt::black);
97 
103  void logHEX(const QByteArray& aData, const QColor& aColor = Qt::black);
104 
111  void logText(const QString& aText, const QColor& aColor = Qt::black);
112 
119  void logText(const QByteArray& aData, const QColor& aColor = Qt::black);
120 
124  QString text() const;
125 
129  void clear();
130 
137  void logTick(const QChar aChar, const QColor& aColor = Qt::black);
138 
139 };
140 
141 #endif // BPSTEXTLOGWIDGET_H
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
Public include file for BPS GUI library macros.
#define BPSGUI_EXPORT
Declare class an import from the shared library.
Definition: bpsgui_global.h:22
A widget to display text logging information.
Definition: bpstextlogwidget.h:14
void log(const QByteArray &aData, const QColor &aColor=Qt::black)
Write to log in current mode.
void setMode(Mode aMode)
Set the mode used for subsequent calls of log().
void clear()
Clear the log.
void setLimit(int aLines)
Set the maximum number of lines to hold in the log.
void logHEX(const QString &aText, const QColor &aColor=Qt::black)
Write as hexadecimal dump on left side block and printable characters in right side block.
BpsTextLogWidget(QWidget *aParent=nullptr)
QString text() const
Mode mode() const
void logASCII(const QString &aText, const QColor &aColor=Qt::black)
Write as ASCII dump, where all special and unprintable characters are displayed in human readable for...
void logText(const QByteArray &aData, const QColor &aColor=Qt::black)
Write as plain text to the log.
void logASCII(const QByteArray &aData, const QColor &aColor=Qt::black)
Write as ASCII dump, where all special and unprintable characters are displayed in human readable for...
void logHEX(const QByteArray &aData, const QColor &aColor=Qt::black)
Write as hexadecimal dump on left side block and printable characters in right side block.
Mode
Logging mode.
Definition: bpstextlogwidget.h:22
@ TEXT
Text mode: log() calls logText().
Definition: bpstextlogwidget.h:23
@ ASCII
ASCII mode: log() calls logASCII().
Definition: bpstextlogwidget.h:24
void log(const QString &aText, const QColor &aColor=Qt::black)
Write to log in current mode.
int limit() const
void logText(const QString &aText, const QColor &aColor=Qt::black)
Write as plain text to the log.
void logTick(const QChar aChar, const QColor &aColor=Qt::black)
Write as char as tick to the log.