llm-chat 0.0.0
LLM-Chat
Loading...
Searching...
No Matches
application.h
Go to the documentation of this file.
1#pragma once
2
3#include <backend.h>
4
5#include <QGuiApplication>
6#include <QQmlApplicationEngine>
7
8#include "settings.h"
9
10namespace llm_chat {
11
14 public:
15 Application(int& argc, char** argv);
16 Application(const Application&) = delete;
20 ~Application() = default;
21
24 [[nodiscard]] int run() const;
25
28 [[nodiscard]] QQmlApplicationEngine* qmlEngine() const;
31 [[nodiscard]] Settings* settings() const;
32
33 private:
35 static void initializeSentry();
37 void registerQmlTypes() const;
39 void addFonts() const;
40
41 QScopedPointer<QGuiApplication> m_Application;
42 QScopedPointer<Settings> m_Settings{new Settings};
43 QScopedPointer<ChatBackend> m_ChatBackend{new ChatBackend};
44 QScopedPointer<QQmlApplicationEngine> m_Engine{new QQmlApplicationEngine};
45};
46
47} // namespace llm_chat
The main application class.
Definition application.h:13
Settings * settings() const
Returns the Settings instance.
Definition application.cpp:97
Application(const Application &)=delete
Application & operator=(Application &&)=delete
Application(int &argc, char **argv)
Definition application.cpp:67
Application(Application &&)=delete
Application & operator=(const Application &)=delete
int run() const
Runs the application.
Definition application.cpp:93
QQmlApplicationEngine * qmlEngine() const
Returns the QML Application Engine instance.
Definition application.cpp:95
The ChatBackend class handles the communication with the Ollama server.
Definition backend.h:15
The Settings class is a wrapper around QSettings that provides a more convenient interface for access...
Definition settings.h:12
Definition backend.cpp:11