gboard
Loading...
Searching...
No Matches
GBoard Class Reference

A Qt widget that displays read-only log text with a compact "top bar" UI. More...

#include <gboard.h>

Public Member Functions

 GBoard (const std::shared_ptr< GOptions > &gopt, QWidget *parent=nullptr)
 Constructs a new GBoard widget.
 
 GBoard (const GBoard &)=delete
 
GBoardoperator= (const GBoard &)=delete
 
 GBoard (GBoard &&)=delete
 
GBoardoperator= (GBoard &&)=delete
 
void appendLog (const QString &text)
 Appends a log line to the internal history and updates the display.
 
- Public Member Functions inherited from GBase< GBoard >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Protected Attributes inherited from GBase< GBoard >
std::shared_ptr< GLoggerlog
 

Detailed Description

GBoard is intended to be used as a log sink and viewer:

  • Append-only ingestion: new log lines are added through appendLog().
  • Filtering: a search field filters the displayed content without losing the underlying log history.
  • User actions: clear (remove all stored lines) and save (export to a file).

Data model and display strategy

  • fullLogLines is the source of truth for all received log lines (stored as HTML fragments).
  • The visible QTextEdit is rebuilt from fullLogLines whenever the filter changes or a new line arrives.

Threading notes

In typical usage, log lines may arrive from non-GUI threads. The implementation ensures the actual QTextEdit update is executed on the GUI thread.

Ownership and lifetime

This widget owns its Qt child widgets (created with this as parent).

Definition at line 55 of file gboard.h.

Constructor & Destructor Documentation

◆ GBoard() [1/3]

GBoard::GBoard ( const std::shared_ptr< GOptions > & gopt,
QWidget * parent = nullptr )
explicit

The widget instantiates its internal UI:

  • search line edit (filter)
  • clear button
  • save button
  • log display area (QTextEdit, read-only, rich-text enabled)
Parameters
goptShared pointer to the module options/logging configuration.
parentParent widget (default is nullptr).

Definition at line 10 of file gboard.cc.

◆ GBoard() [2/3]

GBoard::GBoard ( const GBoard & )
delete

◆ GBoard() [3/3]

GBoard::GBoard ( GBoard && )
delete

Member Function Documentation

◆ appendLog()

void GBoard::appendLog ( const QString & text)

The input is treated as an HTML fragment (not a full HTML document):

  • It is stored verbatim into fullLogLines.
  • The display is refreshed so the new line becomes visible immediately if it matches the current filter.

Empty or whitespace-only fragments are ignored.

Parameters
textHTML fragment representing one log line.

Definition at line 73 of file gboard.cc.

◆ operator=() [1/2]

GBoard & GBoard::operator= ( const GBoard & )
delete

◆ operator=() [2/2]

GBoard & GBoard::operator= ( GBoard && )
delete

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