mirror of
https://github.com/ShowFL/Toou-2D.git
synced 2026-10-29 04:16:34 +08:00
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#ifndef T2D_H
|
|
#define T2D_H
|
|
|
|
#include <QObject>
|
|
#include <QQmlEngine>
|
|
#include <QQuickWindow>
|
|
#include "world.h"
|
|
#include "def.h"
|
|
|
|
class T2D : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
static QObject *exampleQmlSingletonType(QQmlEngine *engine, QJSEngine *scriptEngine);
|
|
static T2D *getInstance();
|
|
|
|
Q_INVOKABLE QString version() const;
|
|
Q_INVOKABLE QString awesomeFromKey(const QString& key);
|
|
Q_INVOKABLE QString awesomeFromValue(int type);
|
|
Q_INVOKABLE QStringList awesomelist();
|
|
|
|
void registerTypes(const char *uri);
|
|
void initializeEngine(QQmlEngine *engine, const char *uri);
|
|
|
|
void initWorld(T2DWorld* world);
|
|
void initQuickRoot(QQuickWindow* root);
|
|
|
|
void setAppStartupTheme(const QString& themeName);
|
|
void addAppThemePath(const QString& path);
|
|
|
|
Q_INVOKABLE int mouseAreaCursorShape();
|
|
void setMouseAreaCursorShape(Qt::CursorShape cursor);
|
|
signals:
|
|
|
|
private:
|
|
static T2D* m_instance;
|
|
|
|
QQmlEngine* m_engine = nullptr;
|
|
QQuickWindow* m_root = nullptr;
|
|
T2DWorld* m_world = nullptr;
|
|
|
|
Qt::CursorShape m_mouseAreaCurrsor = Qt::ArrowCursor;
|
|
};
|
|
|
|
#endif // T2D_H
|