Workspace 6.21.5
|
#include <Workspace/Presentation/Logging/textviewer.h>
Inherits QTextEdit.
Public Slots | |
void | addText (const QString &text) |
void | disconnectFromCurrentWorkspace () |
void | find (const QRegExp &pattern) |
void | loadText (const QString &fileName) |
void | setWordWrapping (bool checked) |
Signals | |
void | logCopy (bool b) |
void | selectOperation (QString idPath) |
Public Member Functions | |
TextViewer (QWidget *parent=nullptr) | |
~TextViewer () override | |
void | captureLogStream () |
void | captureLogStreamWithTimestamp () |
bool | getWordWrapping () const |
void | stopLogStreamCapture () |
Protected Member Functions | |
void | contextMenuEvent (QContextMenuEvent *event) override |
void | dragEnterEvent (QDragEnterEvent *e) override |
void | dragLeaveEvent (QDragLeaveEvent *e) override |
void | dragMoveEvent (QDragMoveEvent *e) override |
void | focusInEvent (QFocusEvent *event) override |
void | focusOutEvent (QFocusEvent *event) override |
void | keyPressEvent (QKeyEvent *e) override |
void | mouseMoveEvent (QMouseEvent *e) override |
void | mousePressEvent (QMouseEvent *e) override |
void | resizeEvent (QResizeEvent *event) override |
Displays text information to a user, with the ability to filter or highlight text. Note that the viewer is assumed to be a logging widget and more importantly, that only one instance is typically in existence at any point in time. In some circumstances where a .ui
file is loaded dynamically at run time by the Workspace framework, the private connectToWorkspace() slot will be called automatically and this is where the widget grabs the main log stream.
TextViewer | ( | QWidget * | parent = nullptr | ) |
parent | The parent widget. |
|
override |
|
slot |
text | the text that is being added to the display. |
This is used for performance reasons. If you use this to update the display instead of calling setText() repeatedly, you will see a performance increase, as this will detect changes in the document (if any) and update those only.
void captureLogStream | ( | ) |
Call this function when you want the text viewer to capture all text sent to the main log stream. The only situation where you would normally call this function is if your application has only one TextViewer and you want to redirect the log to it.
void captureLogStreamWithTimestamp | ( | ) |
Call this function when you want the text viewer to capture all text sent to the main log stream with timestamp. The only situation where you would normally call this function is if your application has only one TextViewer and you want to redirect the log to it.
|
overrideprotected |
This is called when a user right clicks on the QTextEdit widget.
|
slot |
Detaches from any previously connected workspaces (will stop logging from main log stream).
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
slot |
|
overrideprotected |
|
overrideprotected |
bool getWordWrapping | ( | ) | const |
|
overrideprotected |
|
slot |
fileName | The name of the file to display. If a relative path is given, it is taken as relative to the current directory. |
Sets the contents of the document to the contents of the specified file. If the file could not be opened for reading, the current contents of the widget are left unchanged.
|
signal |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
event | is sent from the widget on resize. |
Called every time the widget is resized to update highlighting.
|
signal |
|
slot |
void stopLogStreamCapture | ( | ) |
Prevents text viewer from capturing any further text sent to the main log stream.