Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
UiEngine.h
1/*
2 * UiEngine.h
3 * This file is part of Open-Typer
4 *
5 * Copyright (C) 2023 - adazem009
6 *
7 * Open-Typer is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * Open-Typer is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Open-Typer. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef UIENGINE_H
22#define UIENGINE_H
23
24#include <memory>
25
26#include "../IUiEngine.h"
27
29class UiEngine : public IUiEngine
30{
31 public:
32 static std::shared_ptr<UiEngine> instance();
33 QQmlEngine *qmlEngine() override;
34 void setQmlEngine(QQmlEngine *engine);
35 void addSourceImportPath(const QString &path) override;
36
37 private:
38 static std::shared_ptr<UiEngine> m_instance;
39 QQmlEngine *m_qmlEngine = nullptr;
40};
41
42#endif // UIENGINE_H
Definition IUiEngine.h:28
The UiEngine class manages the QQmlEngine of the application.
Definition UiEngine.h:30
QQmlEngine * qmlEngine() override
Definition UiEngine.cpp:32
void addSourceImportPath(const QString &path) override
Definition UiEngine.cpp:44
static std::shared_ptr< UiEngine > instance()
Definition UiEngine.cpp:26
void setQmlEngine(QQmlEngine *engine)
Definition UiEngine.cpp:38