added some initializer classes

This commit is contained in:
Dorian Zedler 2020-05-24 15:03:39 +02:00
parent 81e90dddec
commit 1f6ecd3319
Signed by: dorian
GPG key ID: 989DE36109AFA354
6 changed files with 85 additions and 3 deletions

View file

@ -1,5 +1,9 @@
QT -= gui QT -= gui
QT += network multimedia QT += network multimedia quick
CONFIG(contains(QMAKE_LFLAGS_CONSOLE)){
message("this is console")
}
TEMPLATE = lib TEMPLATE = lib
DEFINES += SCSTWLIBRARIES_LIBRARY DEFINES += SCSTWLIBRARIES_LIBRARY
@ -20,6 +24,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \ SOURCES += \
sources/ScStw.cpp \ sources/ScStw.cpp \
sources/scstwclient.cpp \ sources/scstwclient.cpp \
sources/scstwlibraries.cpp \
sources/scstwrace.cpp \ sources/scstwrace.cpp \
sources/scstwremotemonitorrace.cpp \ sources/scstwremotemonitorrace.cpp \
sources/scstwsoundplayer.cpp \ sources/scstwsoundplayer.cpp \
@ -28,6 +33,7 @@ SOURCES += \
HEADERS += \ HEADERS += \
headers/ScStw.hpp \ headers/ScStw.hpp \
headers/ScStwLibraries_global.h \ headers/ScStwLibraries_global.h \
headers/scstwlibraries.h \
headers/scstwrace.h \ headers/scstwrace.h \
headers/scstwclient.h \ headers/scstwclient.h \
headers/scstwremotemonitorrace.h \ headers/scstwremotemonitorrace.h \

View file

@ -0,0 +1,24 @@
#ifndef SCSTWLIBRARIES_H
#define SCSTWLIBRARIES_H
#include <QObject>
#include <QQmlApplicationEngine>
#include "scstwclient.h"
#include "scstwtimer.h"
#include "scstwrace.h"
class ScStwLibraries : public QObject
{
Q_OBJECT
public:
static void init();
private:
explicit ScStwLibraries(QObject *parent = nullptr);
signals:
};
#endif // SCSTWLIBRARIES_H

View file

@ -0,0 +1,13 @@
#include "../headers/scstwlibraries.h"
ScStwLibraries::ScStwLibraries(QObject *parent) : QObject(parent)
{
}
void ScStwLibraries::init() {
qmlRegisterType<ScStwRace>("de.itsblue.ScStw", 2, 0, "ScStwRace");
qmlRegisterType<ScStwTimer>("de.itsblue.ScStw", 2, 0, "ScStwTimer");
qmlRegisterType<ScStw>("de.itsblue.ScStw", 2, 0, "ScStw");
qmlRegisterType<ScStwClient>("de.itsblue.ScStw", 2, 0, "ScStwClient");
}

View file

@ -18,11 +18,13 @@ DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \ SOURCES += \
sources/scstwapptheme.cpp \ sources/scstwapptheme.cpp \
sources/scstwappthememanager.cpp sources/scstwappthememanager.cpp \
sources/scstwstyling.cpp
HEADERS += \ HEADERS += \
headers/scstwapptheme.h \ headers/scstwapptheme.h \
headers/scstwappthememanager.h headers/scstwappthememanager.h \
headers/scstwstyling.h
RESOURCES += \ RESOURCES += \
resources/qml/ScStwStylingQml.qrc \ resources/qml/ScStwStylingQml.qrc \

View file

@ -0,0 +1,25 @@
#ifndef SCSTWSTYLING_H
#define SCSTWSTYLING_H
#include <QObject>
#include <QQmlApplicationEngine>
#include "scstwapptheme.h"
#include "scstwappthememanager.h"
class ScStwStyling : public QObject
{
Q_OBJECT
public:
static void init(QQmlApplicationEngine *engine);
private:
explicit ScStwStyling(QObject *parent = nullptr);
signals:
};
#endif // SCSTWSTYLING_H

View file

@ -0,0 +1,12 @@
#include "../headers/scstwstyling.h"
ScStwStyling::ScStwStyling(QObject *parent) : QObject(parent)
{
}
void ScStwStyling::init(QQmlApplicationEngine *engine) {
qmlRegisterUncreatableType<ScStwAppTheme>("de.itsblue.ScStw.styling", 2, 0, "ScStwAppTheme", "The ScStwAppTheme has to be managed by a ScStwAppTheme manager and is therefore not creatable");
qmlRegisterType<ScStwAppThemeManager>("de.itsblue.ScStw.styling", 2, 0, "ScStwAppThemeManager");
engine->addImportPath(":/lib");
}