RhythmGame 1.4.3
Loading...
Searching...
No Matches
Logger.h
Go to the documentation of this file.
1//
2// Created by bobini on 08.09.23.
3//
4
5#ifndef RHYTHMGAME_LOGGER_H
6#define RHYTHMGAME_LOGGER_H
7
8#include <QObject>
9#include <qstringlistmodel.h>
10#include <QtQml/qqmlregistration.h>
11namespace qml_components {
12
16class Logger final : public QObject
17{
18 Q_OBJECT
19 QML_ELEMENT
20
24 Q_PROPERTY(QStringListModel* history READ getHistory CONSTANT FINAL)
25 QStringListModel* history{};
26
27 public:
28 explicit Logger(QObject* parent = nullptr);
29 Q_INVOKABLE void addLog(const QString& msg);
30 auto getHistory() const -> QStringListModel*;
31
32 signals:
33 void logged(const QString& msg);
34};
35
36} // namespace qml_components
37
38#endif // RHYTHMGAME_LOGGER_H
Lets you access the entire log history of this session.
Definition Logger.h:17
Q_INVOKABLE void addLog(const QString &msg)
Definition Logger.cpp:16
QML_ELEMENTQStringListModel * history
All log messages.
Definition Logger.h:24
void logged(const QString &msg)
auto getHistory() const -> QStringListModel *
Definition Logger.cpp:23
Contains classes that wrap some functionality for use in QML.
Definition ProfileArenaIdentityProvider.h:9