mirror of https://github.com/nymea/nymea.git
first test with the lib
parent
ebcabda682
commit
85b11eb80f
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += widgets declarative qml quick network dbus
|
||||
QT += network declarative
|
||||
|
||||
TARGET = libhive
|
||||
TEMPLATE = lib
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
#include "server.h"
|
||||
|
||||
#include <QNetworkInterface>
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
#include <QDebug>
|
||||
|
||||
Server::Server(QObject *parent) :
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
#define SERVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QNetworkInterface>
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
|
||||
class Server : public QObject
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core
|
||||
QT += core network
|
||||
|
||||
QT -= gui
|
||||
|
||||
|
|
@ -17,12 +17,14 @@ TEMPLATE = app
|
|||
SOURCES += main.cpp \
|
||||
hivecore.cpp
|
||||
|
||||
|
||||
|
||||
HEADERS += \
|
||||
hivecore.h
|
||||
|
||||
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../libhive/release/ -llibhive
|
||||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../libhive/debug/ -llibhive
|
||||
else:unix: LIBS += -L$$OUT_PWD/../../libhive/ -llibhive
|
||||
|
||||
INCLUDEPATH += $$PWD/../../libhive
|
||||
DEPENDPATH += $$PWD/../../libhive
|
||||
|
||||
HEADERS += \
|
||||
hivecore.h
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define HIVECORE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <libhive/server.h>
|
||||
#include "server.h"
|
||||
|
||||
class HiveCore : public QObject
|
||||
{
|
||||
|
|
@ -11,7 +11,7 @@ public:
|
|||
explicit HiveCore(QObject *parent = 0);
|
||||
|
||||
private:
|
||||
Server m_server;
|
||||
Server *m_server;
|
||||
|
||||
signals:
|
||||
|
||||
|
|
|
|||
|
|
@ -4,20 +4,29 @@
|
|||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core
|
||||
QT += core network
|
||||
|
||||
QT -= gui
|
||||
|
||||
TARGET = hive_pi
|
||||
target.path = /usr/bin
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
target.path = /usr/bin
|
||||
INSTALLS += target
|
||||
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
|
||||
SOURCES += main.cpp
|
||||
SOURCES += main.cpp \
|
||||
hivecore.cpp
|
||||
|
||||
unix:!macx: LIBS += -L$$OUT_PWD/../../libhive/ -llibhive
|
||||
|
||||
INCLUDEPATH += $$PWD/../../libhive
|
||||
DEPENDPATH += $$PWD/../../libhive
|
||||
|
||||
HEADERS += \
|
||||
hivecore.h
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
#include "hivecore.h"
|
||||
|
||||
HiveCore::HiveCore(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
m_server = new Server(this);
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef HIVECORE_H
|
||||
#define HIVECORE_H
|
||||
|
||||
#include <QObject>
|
||||
#include "server.h"
|
||||
|
||||
class HiveCore : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HiveCore(QObject *parent = 0);
|
||||
|
||||
private:
|
||||
Server *m_server;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
#endif // HIVECORE_H
|
||||
Loading…
Reference in New Issue