Imported existing sources

This commit is contained in:
0xFEEDC0DE64
2018-09-17 19:24:38 +02:00
parent 89d7495472
commit 6d7c8d789f
6 changed files with 82 additions and 0 deletions

12
helloworldapplication.cpp Normal file
View File

@@ -0,0 +1,12 @@
#include "helloworldapplication.h"
HelloWorldApplication::HelloWorldApplication(const QJsonObject &config, QObject *parent) :
WebApplication(parent)
{
}
void HelloWorldApplication::start()
{
}

15
helloworldapplication.h Normal file
View File

@@ -0,0 +1,15 @@
#pragma once
#include "webapplication.h"
class QJsonObject;
class HelloWorldApplication : public WebApplication
{
Q_OBJECT
public:
HelloWorldApplication(const QJsonObject &config, QObject *parent = Q_NULLPTR);
void start() Q_DECL_OVERRIDE;
};

20
helloworldplugin.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include "helloworldplugin.h"
#include "helloworldapplication.h"
HelloWorldPlugin::HelloWorldPlugin(QObject *parent) :
WebPlugin(parent)
{
}
QString HelloWorldPlugin::pluginName() const
{
return QStringLiteral("helloworld");
}
WebApplication *HelloWorldPlugin::createApplication(const QJsonObject &config) const
{
return new HelloWorldApplication(config);
}

16
helloworldplugin.h Normal file
View File

@@ -0,0 +1,16 @@
#pragma once
#include "webplugin.h"
class HelloWorldPlugin : public WebPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "dbsoftware.webserver.plugin/1.0" FILE "helloworldplugin.json")
Q_INTERFACES(WebPlugin)
public:
HelloWorldPlugin(QObject *parent = Q_NULLPTR);
QString pluginName() const Q_DECL_OVERRIDE;
WebApplication *createApplication(const QJsonObject &config) const Q_DECL_OVERRIDE;
};

0
helloworldplugin.json Normal file
View File

19
helloworldplugin.pro Normal file
View File

@@ -0,0 +1,19 @@
QT += core network
DBLIBS += webserverlib
HEADERS += helloworldplugin.h \
helloworldapplication.h
SOURCES += helloworldplugin.cpp \
helloworldapplication.cpp
FORMS +=
RESOURCES +=
TRANSLATIONS +=
OTHER_FILES += helloworldplugin.json
include(../plugin.pri)