OpenMS
Loading...
Searching...
No Matches
LogWindow.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Chris Bielow $
6// $Authors: Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11// OpenMS_GUI config
12#include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13
15
16#include <QTextEdit>
17
18namespace OpenMS
19{
20
27 : public QTextEdit
28 {
29 Q_OBJECT
30 Q_PROPERTY(int max_length READ maxLength WRITE setMaxLength)
31
32 public:
40
43
45 void appendText(const QString& text);
46
48 void appendNewHeader(const LogState state, const std::string& heading, const std::string& body);
49
51 void addNewline();
52
54 int maxLength() const;
57
58 signals:
59
60 protected slots:
62 void trimText_();
63
64 private:
65 void contextMenuEvent(QContextMenuEvent* event) override;
66 int max_length_ { -1 };
67 };
68
69} //namespace
70
A log window (QTextEdit) with convenience functions.
Definition LogWindow.h:28
LogState
Log message states.
Definition LogWindow.h:35
@ WARNING
Warning.
Definition LogWindow.h:37
@ CRITICAL
Fatal error.
Definition LogWindow.h:38
@ NOTICE
Notice.
Definition LogWindow.h:36
void contextMenuEvent(QContextMenuEvent *event) override
LogWindow(QWidget *parent)
Default constructor.
int max_length_
-1 by default, which means there is no maximum length
Definition LogWindow.h:66
void trimText_()
if text length reached max_length_, then delete prefix until length of text is 1/2 of max_length_
void appendNewHeader(const LogState state, const std::string &heading, const std::string &body)
appends a new block with heading and a body
int maxLength() const
read max_length
void setMaxLength(int max_length)
set max_length
int max_length
Definition LogWindow.h:30
void appendText(const QString &text)
appends text without adding line breaks and shows the log-window
void addNewline()
appends a line break (same as append(""))
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19