AtCore  1.0.72
AtCore is a API to manage the serial connection between the computer and 3D Printers.
logwidget.h
Go to the documentation of this file.
1 /* AtCore KDE Libary for 3D Printers
2  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
3  SPDX-FileCopyrightText: 2018, 2020 Chris Rizzitello <rizzitello@kde.org>
4 */
5 
6 #pragma once
7 
8 #include <QWidget>
9 
10 #include "atcorewidgets_export.h"
11 
12 class QPlainTextEdit;
13 class QTemporaryFile;
14 
18 class ATCOREWIDGETS_EXPORT LogWidget : public QWidget
19 {
20  Q_OBJECT
21 public:
22  LogWidget(QTemporaryFile *tempFile, QWidget *parent = nullptr);
23  LogWidget(QWidget *parent = nullptr);
24 
29  void appendLog(const QString &msg);
30 
35  void appendRLog(const QByteArray &bmsg);
36 
41  void appendSLog(const QByteArray &bmsg);
42 
48  bool endsWith(const QString &string);
49 
50 private:
51  void initialize();
52 
57  QString getTime();
58 
62  void savePressed();
63 
68  void writeTempFile(const QString &text);
69 
73  void flushTemp();
74  QStringList unsyncedStrings;
75  QTemporaryFile *logFile = nullptr;
76  QPlainTextEdit *textLog = nullptr;
77 };
LogWidget::unsyncedStrings
QStringList unsyncedStrings
Definition: logwidget.h:74
LogWidget
The LogWidget will display the log for the connected atcore. Create with a pointer to a new QTemporar...
Definition: logwidget.h:18