first test with the lib

pull/1/head
Simon Stuerz 2013-08-15 19:08:22 +02:00
parent ebcabda682
commit 85b11eb80f
8 changed files with 52 additions and 14 deletions

View File

@ -4,7 +4,7 @@
#
#-------------------------------------------------
QT += widgets declarative qml quick network dbus
QT += network declarative
TARGET = libhive
TEMPLATE = lib

View File

@ -1,8 +1,4 @@
#include "server.h"
#include <QNetworkInterface>
#include <QTcpServer>
#include <QTcpSocket>
#include <QDebug>
Server::Server(QObject *parent) :

View File

@ -2,7 +2,9 @@
#define SERVER_H
#include <QObject>
#include <QNetworkInterface>
#include <QTcpServer>
#include <QTcpSocket>
class Server : public QObject
{

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -0,0 +1,7 @@
#include "hivecore.h"
HiveCore::HiveCore(QObject *parent) :
QObject(parent)
{
m_server = new Server(this);
}

View File

@ -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